@dereekb/dbx-firebase 4.0.1 → 5.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.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/_index.scss +4 -4
  3. package/esm2020/lib/auth/auth.mjs +1 -1
  4. package/esm2020/lib/auth/error.mjs +1 -1
  5. package/esm2020/lib/auth/firebase.auth.module.mjs +1 -1
  6. package/esm2020/lib/auth/login/firebase.login.module.mjs +49 -57
  7. package/esm2020/lib/auth/login/login.anonymous.component.mjs +3 -3
  8. package/esm2020/lib/auth/login/login.apple.component.mjs +3 -3
  9. package/esm2020/lib/auth/login/login.button.component.mjs +36 -38
  10. package/esm2020/lib/auth/login/login.component.mjs +3 -3
  11. package/esm2020/lib/auth/login/login.context.back.component.mjs +8 -8
  12. package/esm2020/lib/auth/login/login.context.directive.mjs +13 -9
  13. package/esm2020/lib/auth/login/login.context.mjs +2 -2
  14. package/esm2020/lib/auth/login/login.email.component.mjs +4 -4
  15. package/esm2020/lib/auth/login/login.email.content.component.mjs +9 -9
  16. package/esm2020/lib/auth/login/login.email.form.component.mjs +12 -8
  17. package/esm2020/lib/auth/login/login.email.recovery.form.component.mjs +10 -6
  18. package/esm2020/lib/auth/login/login.facebook.component.mjs +3 -3
  19. package/esm2020/lib/auth/login/login.github.component.mjs +3 -3
  20. package/esm2020/lib/auth/login/login.google.component.mjs +3 -3
  21. package/esm2020/lib/auth/login/login.list.component.mjs +11 -13
  22. package/esm2020/lib/auth/login/login.microsoft.component.mjs +3 -3
  23. package/esm2020/lib/auth/login/login.mjs +1 -1
  24. package/esm2020/lib/auth/login/login.password.mjs +1 -1
  25. package/esm2020/lib/auth/login/login.service.mjs +8 -8
  26. package/esm2020/lib/auth/login/login.terms.component.mjs +10 -6
  27. package/esm2020/lib/auth/login/login.terms.mjs +1 -1
  28. package/esm2020/lib/auth/login/login.terms.simple.component.mjs +12 -12
  29. package/esm2020/lib/auth/login/login.twitter.component.mjs +3 -3
  30. package/esm2020/lib/auth/login/register.component.mjs +8 -4
  31. package/esm2020/lib/auth/login/register.email.component.mjs +4 -4
  32. package/esm2020/lib/auth/service/firebase.auth.rxjs.mjs +3 -3
  33. package/esm2020/lib/auth/service/firebase.auth.service.mjs +12 -12
  34. package/esm2020/lib/firebase/emulators.mjs +1 -1
  35. package/esm2020/lib/firebase/firebase.emulator.module.mjs +6 -4
  36. package/esm2020/lib/firebase/firebase.module.mjs +37 -23
  37. package/esm2020/lib/firebase/options.mjs +1 -1
  38. package/esm2020/lib/firestore/firebase.firestore.context.service.mjs +1 -1
  39. package/esm2020/lib/firestore/firebase.firestore.module.mjs +11 -8
  40. package/esm2020/lib/function/firebase.function.module.mjs +8 -6
  41. package/esm2020/lib/model/error.mjs +2 -2
  42. package/esm2020/lib/model/loader/collection.loader.instance.mjs +9 -10
  43. package/esm2020/lib/model/loader/collection.loader.mjs +1 -1
  44. package/esm2020/lib/model/model.module.mjs +4 -6
  45. package/esm2020/lib/model/store/model.store.module.mjs +10 -30
  46. package/esm2020/lib/model/store/store.collection.change.directive.mjs +6 -4
  47. package/esm2020/lib/model/store/store.collection.change.if.directive.mjs +1 -1
  48. package/esm2020/lib/model/store/store.collection.directive.mjs +5 -3
  49. package/esm2020/lib/model/store/store.collection.list.directive.mjs +2 -2
  50. package/esm2020/lib/model/store/store.collection.mjs +8 -8
  51. package/esm2020/lib/model/store/store.document.auth.directive.mjs +4 -4
  52. package/esm2020/lib/model/store/store.document.directive.mjs +5 -3
  53. package/esm2020/lib/model/store/store.document.mjs +13 -13
  54. package/esm2020/lib/model/store/store.document.router.directive.mjs +2 -4
  55. package/esm2020/lib/model/store/store.subcollection.document.mjs +3 -3
  56. package/esm2020/lib/model/store/store.subcollection.mjs +3 -3
  57. package/esm2020/lib/model/store/store.subcollection.rxjs.mjs +3 -3
  58. package/esm2020/lib/module.mjs +4 -6
  59. package/fesm2015/dereekb-dbx-firebase.mjs +264 -254
  60. package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
  61. package/fesm2020/dereekb-dbx-firebase.mjs +264 -254
  62. package/fesm2020/dereekb-dbx-firebase.mjs.map +1 -1
  63. package/lib/auth/auth.d.ts +2 -3
  64. package/lib/auth/error.d.ts +2 -2
  65. package/lib/auth/login/_login.scss +5 -5
  66. package/lib/auth/login/firebase.login.module.d.ts +1 -1
  67. package/lib/auth/login/login.anonymous.component.d.ts +2 -2
  68. package/lib/auth/login/login.apple.component.d.ts +2 -2
  69. package/lib/auth/login/login.button.component.d.ts +11 -12
  70. package/lib/auth/login/login.context.back.component.d.ts +3 -3
  71. package/lib/auth/login/login.context.d.ts +1 -1
  72. package/lib/auth/login/login.context.directive.d.ts +2 -2
  73. package/lib/auth/login/login.email.component.d.ts +2 -2
  74. package/lib/auth/login/login.email.content.component.d.ts +5 -5
  75. package/lib/auth/login/login.email.form.component.d.ts +7 -8
  76. package/lib/auth/login/login.email.recovery.form.component.d.ts +2 -2
  77. package/lib/auth/login/login.facebook.component.d.ts +2 -2
  78. package/lib/auth/login/login.github.component.d.ts +2 -2
  79. package/lib/auth/login/login.google.component.d.ts +2 -2
  80. package/lib/auth/login/login.list.component.d.ts +2 -2
  81. package/lib/auth/login/login.microsoft.component.d.ts +2 -2
  82. package/lib/auth/login/login.password.d.ts +2 -3
  83. package/lib/auth/login/login.service.d.ts +10 -10
  84. package/lib/auth/login/login.terms.component.d.ts +1 -1
  85. package/lib/auth/login/login.twitter.component.d.ts +2 -2
  86. package/lib/auth/login/register.email.component.d.ts +2 -2
  87. package/lib/auth/service/firebase.auth.rxjs.d.ts +1 -1
  88. package/lib/auth/service/firebase.auth.service.d.ts +3 -3
  89. package/lib/firebase/firebase.module.d.ts +1 -1
  90. package/lib/firebase/options.d.ts +7 -3
  91. package/lib/firestore/firebase.firestore.module.d.ts +3 -3
  92. package/lib/function/firebase.function.module.d.ts +7 -7
  93. package/lib/model/loader/collection.loader.d.ts +5 -5
  94. package/lib/model/loader/collection.loader.instance.d.ts +4 -4
  95. package/lib/model/store/store.collection.change.directive.d.ts +5 -4
  96. package/lib/model/store/store.collection.change.if.directive.d.ts +2 -2
  97. package/lib/model/store/store.collection.d.ts +3 -3
  98. package/lib/model/store/store.collection.directive.d.ts +3 -3
  99. package/lib/model/store/store.document.auth.directive.d.ts +4 -4
  100. package/lib/model/store/store.document.d.ts +4 -4
  101. package/lib/model/store/store.document.directive.d.ts +3 -3
  102. package/lib/model/store/store.document.router.directive.d.ts +8 -9
  103. package/lib/model/store/store.subcollection.rxjs.d.ts +7 -7
  104. package/lib/style/_config.scss +8 -6
  105. package/lib/style/_core.scss +1 -1
  106. package/lib/style/_mixin.scss +1 -1
  107. package/lib/style/_theming.scss +2 -12
  108. package/lib/style/_variables.scss +1 -1
  109. package/package.json +6 -6
@@ -17,10 +17,10 @@ import { addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, exclu
17
17
  import * as i3 from '@dereekb/dbx-web';
18
18
  import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';
19
19
  import * as i1$1 from '@dereekb/dbx-form';
20
- import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, ProvideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule } from '@dereekb/dbx-form';
20
+ import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, provideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule } from '@dereekb/dbx-form';
21
21
  import { initializeApp } from 'firebase/app';
22
22
  import * as i5 from '@angular/fire/app';
23
- import { provideFirebaseApp } from '@angular/fire/app';
23
+ import { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';
24
24
  import * as i3$2 from '@angular/fire/storage';
25
25
  import { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';
26
26
  import * as i4$1 from '@angular/fire/functions';
@@ -28,7 +28,6 @@ import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } f
28
28
  import * as i1$2 from '@angular/fire/firestore';
29
29
  import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
30
30
  import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, documentDataWithId } from '@dereekb/firebase';
31
- import { shareReplay as shareReplay$1 } from 'rxjs/operators';
32
31
 
33
32
  /**
34
33
  * Derives a user state from the input firebase auth service.
@@ -41,7 +40,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
41
40
  return dbxFirebaseAuthService.hasAuthUser$.pipe(switchMap((hasUser) => {
42
41
  let obs;
43
42
  if (hasUser) {
44
- obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService)));
43
+ obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => (isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService))));
45
44
  }
46
45
  else {
47
46
  obs = of('none');
@@ -60,7 +59,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
60
59
  function readValueFromIdToken(dbxFirebaseAuthService, readBooleanFromIdToken, defaultValue) {
61
60
  return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(switchMap((x) => {
62
61
  if (x) {
63
- return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap(x => readBooleanFromIdToken(x)));
62
+ return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap((x) => readBooleanFromIdToken(x)));
64
63
  }
65
64
  else {
66
65
  return of(defaultValue);
@@ -85,10 +84,10 @@ const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
85
84
  return authUserStateFromFirebaseAuthService(dbxFirebaseAuthService);
86
85
  },
87
86
  authRolesObs(dbxFirebaseAuthService) {
88
- return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user' ? new Set(['user']) : new Set()));
87
+ return dbxFirebaseAuthService.authUserState$.pipe(map((x) => (x === 'user' ? new Set(['user']) : new Set())));
89
88
  },
90
89
  isOnboarded(dbxFirebaseAuthService) {
91
- return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user'));
90
+ return dbxFirebaseAuthService.authUserState$.pipe(map((x) => x === 'user'));
92
91
  }
93
92
  };
94
93
  class DbxFirebaseAuthService {
@@ -99,19 +98,19 @@ class DbxFirebaseAuthService {
99
98
  first: 1000,
100
99
  with: () => this._authState$.pipe(startWith(null))
101
100
  }), distinctUntilChanged(), shareReplay(1));
102
- this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x) ? authUserInfoFromAuthUser(x) : undefined));
101
+ this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));
103
102
  this.authUser$ = this.currentAuthUser$.pipe(filterMaybe());
104
103
  this.authUserInfo$ = this.authUser$.pipe(map(authUserInfoFromAuthUser));
105
- this.hasAuthUser$ = this.currentAuthUser$.pipe(map(x => Boolean(x)), distinctUntilChanged(), shareReplay(1));
106
- this.isAnonymousUser$ = this.authUser$.pipe(map(x => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
104
+ this.hasAuthUser$ = this.currentAuthUser$.pipe(map((x) => Boolean(x)), distinctUntilChanged(), shareReplay(1));
105
+ this.isAnonymousUser$ = this.authUser$.pipe(map((x) => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
107
106
  this.isNotAnonymousUser$ = this.isAnonymousUser$.pipe(isNot());
108
107
  this.isLoggedIn$ = this.hasAuthUser$;
109
108
  this.isNotLoggedIn$ = this.isLoggedIn$.pipe(isNot());
110
109
  this.onLogIn$ = loggedInObsFromIsLoggedIn(this.isLoggedIn$);
111
110
  this.onLogOut$ = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);
112
- this.userIdentifier$ = this.currentAuthUser$.pipe(map(x => authUserIdentifier(x?.uid)));
113
- this.idTokenResult$ = this.authUser$.pipe(switchMap(x => x.getIdTokenResult()));
114
- this.claims$ = this.idTokenResult$.pipe(map(x => x.claims));
111
+ this.userIdentifier$ = this.currentAuthUser$.pipe(map((x) => authUserIdentifier(x?.uid)));
112
+ this.idTokenResult$ = this.authUser$.pipe(switchMap((x) => x.getIdTokenResult()));
113
+ this.claims$ = this.idTokenResult$.pipe(map((x) => x.claims));
115
114
  delegate = delegate ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;
116
115
  this.authUserState$ = delegate.authUserStateObs(this).pipe(distinctUntilChanged(), shareReplay(1));
117
116
  this.authRoles$ = delegate.authRolesObs(this);
@@ -185,21 +184,21 @@ class DbxFirebaseLoginTermsSimpleComponent {
185
184
  }
186
185
  DbxFirebaseLoginTermsSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [{ token: DbxFirebaseLoginTermsConfig }], target: i0.ɵɵFactoryTarget.Component });
187
186
  DbxFirebaseLoginTermsSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
188
- <div class="dbx-firebase-login-terms-view">
189
- <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
190
- <span class="dbx-link-spacer"></span>
191
- <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
192
- </div>
187
+ <div class="dbx-firebase-login-terms-view">
188
+ <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
189
+ <span class="dbx-link-spacer"></span>
190
+ <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
191
+ </div>
193
192
  `, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
194
193
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, decorators: [{
195
194
  type: Component,
196
195
  args: [{
197
196
  template: `
198
- <div class="dbx-firebase-login-terms-view">
199
- <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
200
- <span class="dbx-link-spacer"></span>
201
- <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
202
- </div>
197
+ <div class="dbx-firebase-login-terms-view">
198
+ <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
199
+ <span class="dbx-link-spacer"></span>
200
+ <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
201
+ </div>
203
202
  `
204
203
  }]
205
204
  }], ctorParameters: function () { return [{ type: DbxFirebaseLoginTermsConfig }]; } });
@@ -289,7 +288,7 @@ class DbxFirebaseAuthLoginService {
289
288
  return Array.from(this._providers.keys());
290
289
  }
291
290
  getEnabledTypes() {
292
- return (this._enableAll) ? this.getRegisteredTypes() : Array.from(this._enabled);
291
+ return this._enableAll ? this.getRegisteredTypes() : Array.from(this._enabled);
293
292
  }
294
293
  getLoginProvider(type) {
295
294
  return this._providers.get(type);
@@ -301,7 +300,7 @@ class DbxFirebaseAuthLoginService {
301
300
  return this._providers.get(type);
302
301
  }
303
302
  getRegisterProviders(types) {
304
- return filterMaybeValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter(x => x.registrationComponentClass !== false);
303
+ return filterMaybeValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter((x) => x.registrationComponentClass !== false);
305
304
  }
306
305
  getProviderAssets(type) {
307
306
  return this._assets.get(type);
@@ -318,7 +317,7 @@ DbxFirebaseAuthLoginService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "1
318
317
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, decorators: [{
319
318
  type: Injectable,
320
319
  args: [{
321
- providedIn: 'root',
320
+ providedIn: 'root'
322
321
  }]
323
322
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
324
323
  type: Optional
@@ -348,11 +347,11 @@ class DbxFirebaseLoginContext extends DbxInjectionContext {
348
347
  */
349
348
  class DbxFirebaseLoginButtonComponent {
350
349
  constructor() {
351
- this.handleAction = (value) => {
350
+ this.handleAction = () => {
352
351
  const loginPromise = this.config.handleLogin();
353
352
  return from(loginPromise);
354
353
  };
355
- this.onActionSuccess = (value) => {
354
+ this.onActionSuccess = () => {
356
355
  // todo: show checkmark on success?
357
356
  };
358
357
  }
@@ -374,39 +373,37 @@ class DbxFirebaseLoginButtonComponent {
374
373
  }
375
374
  DbxFirebaseLoginButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
376
375
  DbxFirebaseLoginButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: { config: "config" }, host: { classAttribute: "dbx-firebase-login-button" }, ngImport: i0, template: `
377
- <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
378
- [dbxActionSuccessHandler]="onActionSuccess">
379
- <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
380
- <div class="dbx-firebase-login-button-content">
381
- <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
382
- <img *ngIf="iconUrl" [src]="iconUrl"/>
383
- <mat-icon *ngIf="icon">{{icon}}</mat-icon>
384
- </span>
385
- <span class="dbx-firebase-login-button-text">{{ text }}</span>
386
- </div>
387
- </dbx-button>
388
- </ng-container>
376
+ <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
377
+ <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
378
+ <div class="dbx-firebase-login-button-content">
379
+ <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
380
+ <img *ngIf="iconUrl" [src]="iconUrl" />
381
+ <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
382
+ </span>
383
+ <span class="dbx-firebase-login-button-text">{{ text }}</span>
384
+ </div>
385
+ </dbx-button>
386
+ </ng-container>
389
387
  `, isInline: true, components: [{ type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i3$1.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
390
388
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, decorators: [{
391
389
  type: Component,
392
390
  args: [{
393
391
  selector: 'dbx-firebase-login-button',
394
392
  template: `
395
- <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
396
- [dbxActionSuccessHandler]="onActionSuccess">
397
- <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
398
- <div class="dbx-firebase-login-button-content">
399
- <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
400
- <img *ngIf="iconUrl" [src]="iconUrl"/>
401
- <mat-icon *ngIf="icon">{{icon}}</mat-icon>
402
- </span>
403
- <span class="dbx-firebase-login-button-text">{{ text }}</span>
404
- </div>
405
- </dbx-button>
406
- </ng-container>
393
+ <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
394
+ <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
395
+ <div class="dbx-firebase-login-button-content">
396
+ <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
397
+ <img *ngIf="iconUrl" [src]="iconUrl" />
398
+ <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
399
+ </span>
400
+ <span class="dbx-firebase-login-button-text">{{ text }}</span>
401
+ </div>
402
+ </dbx-button>
403
+ </ng-container>
407
404
  `,
408
405
  host: {
409
- 'class': 'dbx-firebase-login-button'
406
+ class: 'dbx-firebase-login-button'
410
407
  }
411
408
  }]
412
409
  }], propDecorators: { config: [{
@@ -416,18 +413,18 @@ class DbxFirebaseLoginButtonContainerComponent {
416
413
  }
417
414
  DbxFirebaseLoginButtonContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
418
415
  DbxFirebaseLoginButtonContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container", ngImport: i0, template: `
419
- <div class="dbx-firebase-login-button-container">
420
- <ng-content></ng-content>
421
- </div>
416
+ <div class="dbx-firebase-login-button-container">
417
+ <ng-content></ng-content>
418
+ </div>
422
419
  `, isInline: true });
423
420
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, decorators: [{
424
421
  type: Component,
425
422
  args: [{
426
423
  selector: 'dbx-firebase-login-button-container',
427
424
  template: `
428
- <div class="dbx-firebase-login-button-container">
429
- <ng-content></ng-content>
430
- </div>
425
+ <div class="dbx-firebase-login-button-container">
426
+ <ng-content></ng-content>
427
+ </div>
431
428
  `
432
429
  }]
433
430
  }] });
@@ -519,8 +516,8 @@ class DbxFirebaseLoginListComponent {
519
516
  this._omitProviderTypes = new BehaviorSubject(undefined);
520
517
  this._inputProviderTypes = new BehaviorSubject(undefined);
521
518
  this.providerTypes$ = combineLatest([this._inputProviderTypes, this._omitProviderTypes]).pipe(map(([providerTypes, omitProviderTypes]) => {
522
- const baseTypes = (providerTypes) ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
523
- const types = (omitProviderTypes) ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
519
+ const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
520
+ const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
524
521
  return types;
525
522
  }), shareReplay(1));
526
523
  this.providers$ = combineLatest([this.providerTypes$, this._inputProviderCategories]).pipe(map(([x, inputProviderCategories]) => {
@@ -528,14 +525,12 @@ class DbxFirebaseLoginListComponent {
528
525
  let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(x);
529
526
  if (providerCategories.length) {
530
527
  const categories = new Set(providerCategories);
531
- providers = providers.filter(x => containsStringAnyCase(categories, x.category ?? ''));
528
+ providers = providers.filter((x) => containsStringAnyCase(categories, x.category ?? ''));
532
529
  }
533
530
  return providers;
534
531
  }));
535
532
  this.providerInjectionConfigs$ = combineLatest([this._loginMode, this.providers$]).pipe(map(([mode, providers]) => {
536
- const mapFn = (mode === 'register') ?
537
- ((x) => ({ componentClass: x.registrationComponentClass ?? x.componentClass })) :
538
- ((x) => ({ componentClass: x.componentClass }));
533
+ const mapFn = mode === 'register' ? (x) => ({ componentClass: x.registrationComponentClass ?? x.componentClass }) : (x) => ({ componentClass: x.componentClass });
539
534
  return providers.map(mapFn);
540
535
  }));
541
536
  }
@@ -560,21 +555,21 @@ class DbxFirebaseLoginListComponent {
560
555
  }
561
556
  DbxFirebaseLoginListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
562
557
  DbxFirebaseLoginListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: { loginMode: "loginMode", providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, host: { classAttribute: "dbx-firebase-login-list" }, ngImport: i0, template: `
563
- <div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
558
+ <div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
564
559
  <dbx-injection [config]="config"></dbx-injection>
565
560
  </div>
566
- `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
561
+ `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
567
562
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, decorators: [{
568
563
  type: Component,
569
564
  args: [{
570
565
  selector: 'dbx-firebase-login-list',
571
566
  template: `
572
- <div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
567
+ <div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
573
568
  <dbx-injection [config]="config"></dbx-injection>
574
569
  </div>
575
- `,
570
+ `,
576
571
  host: {
577
- 'class': 'dbx-firebase-login-list'
572
+ class: 'dbx-firebase-login-list'
578
573
  }
579
574
  }]
580
575
  }], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; }, propDecorators: { loginMode: [{
@@ -593,18 +588,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
593
588
  class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective {
594
589
  }
595
590
  DbxFirebaseLoginContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
596
- DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [{
591
+ DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [
592
+ {
597
593
  provide: DbxFirebaseLoginContext,
598
594
  useExisting: DbxFirebaseLoginContextDirective
599
- }], usesInheritance: true, ngImport: i0 });
595
+ }
596
+ ], usesInheritance: true, ngImport: i0 });
600
597
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, decorators: [{
601
598
  type: Directive,
602
599
  args: [{
603
- 'selector': '[dbxFirebaseLoginContext]',
604
- providers: [{
600
+ selector: '[dbxFirebaseLoginContext]',
601
+ providers: [
602
+ {
605
603
  provide: DbxFirebaseLoginContext,
606
604
  useExisting: DbxFirebaseLoginContextDirective
607
- }]
605
+ }
606
+ ]
608
607
  }]
609
608
  }] });
610
609
 
@@ -632,7 +631,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
632
631
  </ng-container>
633
632
  `,
634
633
  host: {
635
- 'class': 'd-block dbx-firebase-login',
634
+ class: 'd-block dbx-firebase-login',
636
635
  '[class]': '{ "dbx-firebase-register": loginMode === "register" }'
637
636
  }
638
637
  }]
@@ -679,7 +678,7 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
679
678
  super(...arguments);
680
679
  this._config = new BehaviorSubject({ loginMode: 'login' });
681
680
  this.fields$ = this._config.pipe(map(({ loginMode = 'login', passwordConfig }) => {
682
- const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: (loginMode === 'register') });
681
+ const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });
683
682
  return fields;
684
683
  }));
685
684
  }
@@ -692,13 +691,17 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
692
691
  }
693
692
  }
694
693
  DbxFirebaseEmailFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
695
- DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [ProvideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
694
+ DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
695
+ <dbx-formly></dbx-formly>
696
+ `, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
696
697
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, decorators: [{
697
698
  type: Component,
698
699
  args: [{
699
- template: `<dbx-formly></dbx-formly>`,
700
+ template: `
701
+ <dbx-formly></dbx-formly>
702
+ `,
700
703
  selector: 'dbx-firebase-email-form',
701
- providers: [ProvideFormlyContext()]
704
+ providers: [provideFormlyContext()]
702
705
  }]
703
706
  }], propDecorators: { config: [{
704
707
  type: Input
@@ -711,13 +714,17 @@ class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirect
711
714
  }
712
715
  }
713
716
  DbxFirebaseEmailRecoveryFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
714
- DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [ProvideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
717
+ DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
718
+ <dbx-formly></dbx-formly>
719
+ `, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
715
720
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, decorators: [{
716
721
  type: Component,
717
722
  args: [{
718
- template: `<dbx-formly></dbx-formly>`,
723
+ template: `
724
+ <dbx-formly></dbx-formly>
725
+ `,
719
726
  selector: 'dbx-firebase-email-recovery-form',
720
- providers: [ProvideFormlyContext()]
727
+ providers: [provideFormlyContext()]
721
728
  }]
722
729
  }] });
723
730
 
@@ -756,15 +763,12 @@ class DbxFirebaseLoginEmailContentComponent {
756
763
  this.handleRecoveryAction = (value) => {
757
764
  this.recoveryFormValue = value;
758
765
  this.emailFormValue = { username: value.email, password: '' };
759
- let result = this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email);
766
+ const result = this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email);
760
767
  return from(result).pipe(tap(() => {
761
768
  this.onRecoveringSuccess();
762
769
  }));
763
770
  };
764
771
  }
765
- ngOnDestroy() {
766
- this._emailMode.complete();
767
- }
768
772
  static openEmailLoginContext(dbxFirebaseLoginContext, config) {
769
773
  return dbxFirebaseLoginContext.showContext({
770
774
  config: {
@@ -774,6 +778,9 @@ class DbxFirebaseLoginEmailContentComponent {
774
778
  use: (instance) => firstValueFrom(instance.doneOrCancelled)
775
779
  });
776
780
  }
781
+ ngOnDestroy() {
782
+ this._emailMode.complete();
783
+ }
777
784
  get loginMode() {
778
785
  return this.config.loginMode;
779
786
  }
@@ -792,6 +799,7 @@ class DbxFirebaseLoginEmailContentComponent {
792
799
  }
793
800
  // MARK: Recovering
794
801
  onRecoveringSuccess() {
802
+ // optionally override in parent
795
803
  }
796
804
  // MARK: Cancel
797
805
  onCancel() {
@@ -802,10 +810,10 @@ class DbxFirebaseLoginEmailContentComponent {
802
810
  }
803
811
  }
804
812
  DbxFirebaseLoginEmailContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, deps: [{ token: DbxFirebaseAuthService }, { token: DBX_INJECTION_COMPONENT_DATA }], target: i0.ɵɵFactoryTarget.Component });
805
- DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,dbxButtonSpacer" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
813
+ DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
806
814
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, decorators: [{
807
815
  type: Component,
808
- args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
816
+ args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
809
817
  }], ctorParameters: function () { return [{ type: DbxFirebaseAuthService }, { type: undefined, decorators: [{
810
818
  type: Inject,
811
819
  args: [DBX_INJECTION_COMPONENT_DATA]
@@ -871,12 +879,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
871
879
  class DbxFirebaseRegisterComponent {
872
880
  }
873
881
  DbxFirebaseRegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
874
- DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
882
+ DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `
883
+ <dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
884
+ `, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
875
885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, decorators: [{
876
886
  type: Component,
877
887
  args: [{
878
888
  selector: 'dbx-firebase-register',
879
- template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`
889
+ template: `
890
+ <dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
891
+ `
880
892
  }]
881
893
  }], propDecorators: { providerTypes: [{
882
894
  type: Input
@@ -965,39 +977,43 @@ class DbxFirebaseLoginTermsComponent {
965
977
  }
966
978
  }
967
979
  DbxFirebaseLoginTermsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
968
- DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `<dbx-injection [config]="config"></dbx-injection>`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
980
+ DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `
981
+ <dbx-injection [config]="config"></dbx-injection>
982
+ `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
969
983
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, decorators: [{
970
984
  type: Component,
971
985
  args: [{
972
986
  selector: 'dbx-firebase-login-terms',
973
- template: `<dbx-injection [config]="config"></dbx-injection>`,
987
+ template: `
988
+ <dbx-injection [config]="config"></dbx-injection>
989
+ `,
974
990
  host: {
975
- 'class': 'dbx-firebase-login-terms d-block',
991
+ class: 'dbx-firebase-login-terms d-block'
976
992
  }
977
993
  }]
978
994
  }], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; } });
979
995
 
980
996
  class DbxFirebaseLoginContextBackButtonComponent {
981
997
  constructor() {
982
- this.onCancel = new EventEmitter();
998
+ this.cancelLogin = new EventEmitter();
983
999
  this.anchor = {
984
- onClick: () => this.onCancel.emit()
1000
+ onClick: () => this.cancelLogin.emit()
985
1001
  };
986
1002
  }
987
1003
  }
988
1004
  DbxFirebaseLoginContextBackButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
989
- DbxFirebaseLoginContextBackButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextBackButtonComponent, selector: "dbx-firebase-login-context-back-button", outputs: { onCancel: "onCancel" }, ngImport: i0, template: `
1005
+ DbxFirebaseLoginContextBackButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextBackButtonComponent, selector: "dbx-firebase-login-context-back-button", outputs: { cancelLogin: "cancelLogin" }, ngImport: i0, template: `
990
1006
  <dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
991
1007
  `, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
992
1008
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, decorators: [{
993
1009
  type: Component,
994
1010
  args: [{
995
- 'selector': 'dbx-firebase-login-context-back-button',
996
- 'template': `
1011
+ selector: 'dbx-firebase-login-context-back-button',
1012
+ template: `
997
1013
  <dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
998
1014
  `
999
1015
  }]
1000
- }], propDecorators: { onCancel: [{
1016
+ }], propDecorators: { cancelLogin: [{
1001
1017
  type: Output
1002
1018
  }] } });
1003
1019
 
@@ -1008,7 +1024,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1008
1024
  // https://firebase.google.com/docs/auth/web/firebaseui
1009
1025
  const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;
1010
1026
  // NOTE: Colors are from https://brandcolors.net/
1011
- return [{
1027
+ return [
1028
+ {
1012
1029
  category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
1013
1030
  loginMethodType: 'email',
1014
1031
  componentClass: DbxFirebaseLoginEmailComponent,
@@ -1019,7 +1036,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1019
1036
  backgroundColor: '#ea4335',
1020
1037
  textColor: '#FFF'
1021
1038
  }
1022
- }, {
1039
+ },
1040
+ {
1023
1041
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1024
1042
  loginMethodType: 'google',
1025
1043
  componentClass: DbxFirebaseLoginGoogleComponent,
@@ -1029,7 +1047,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1029
1047
  backgroundColor: '#FFF',
1030
1048
  textColor: '#757575'
1031
1049
  }
1032
- }, {
1050
+ },
1051
+ {
1033
1052
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1034
1053
  loginMethodType: 'facebook',
1035
1054
  componentClass: DbxFirebaseLoginFacebookComponent,
@@ -1039,7 +1058,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1039
1058
  backgroundColor: '#4267B2',
1040
1059
  textColor: '#FFF'
1041
1060
  }
1042
- }, {
1061
+ },
1062
+ {
1043
1063
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1044
1064
  loginMethodType: 'twitter',
1045
1065
  componentClass: DbxFirebaseLoginTwitterComponent,
@@ -1049,7 +1069,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1049
1069
  backgroundColor: '#1da1f2',
1050
1070
  textColor: '#FFF'
1051
1071
  }
1052
- }, {
1072
+ },
1073
+ {
1053
1074
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1054
1075
  loginMethodType: 'github',
1055
1076
  componentClass: DbxFirebaseLoginGitHubComponent,
@@ -1060,7 +1081,27 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1060
1081
  textColor: '#FFF'
1061
1082
  }
1062
1083
  },
1063
- {
1084
+ /*{
1085
+ category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1086
+ loginMethodType: 'apple' as KnownFirebaseLoginMethodType,
1087
+ componentClass: DbxFirebaseLoginGitHubComponent,
1088
+ assets: {
1089
+ logoUrl: `${baseFirebaseJSUrl}/apple.svg`,
1090
+ loginText: 'Continue with Apple',
1091
+ backgroundColor: '#333',
1092
+ textColor: '#FFF'
1093
+ }
1094
+ }, {
1095
+ category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1096
+ loginMethodType: 'microsoft' as KnownFirebaseLoginMethodType,
1097
+ componentClass: DbxFirebaseLoginGitHubComponent,
1098
+ assets: {
1099
+ logoUrl: `${baseFirebaseJSUrl}/microsoft.svg`,
1100
+ loginText: 'Continue with Microsoft',
1101
+ backgroundColor: '#ea3e23',
1102
+ textColor: '#FFF'
1103
+ }
1104
+ },*/ {
1064
1105
  category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
1065
1106
  loginMethodType: 'anonymous',
1066
1107
  componentClass: DbxFirebaseLoginAnonymousComponent,
@@ -1070,7 +1111,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1070
1111
  backgroundColor: '#000',
1071
1112
  textColor: '#FFF'
1072
1113
  }
1073
- }];
1114
+ }
1115
+ ];
1074
1116
  }
1075
1117
  /**
1076
1118
  * Contains components related to logging in.
@@ -1087,22 +1129,28 @@ class DbxFirebaseLoginModule {
1087
1129
  static forRoot(config) {
1088
1130
  return {
1089
1131
  ngModule: DbxFirebaseLoginModule,
1090
- providers: [{
1132
+ providers: [
1133
+ {
1091
1134
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,
1092
1135
  useFactory: defaultFirebaseAuthLoginProvidersFactory
1093
- }, {
1136
+ },
1137
+ {
1094
1138
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,
1095
1139
  useValue: config.termsComponentClass
1096
- }, {
1140
+ },
1141
+ {
1097
1142
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,
1098
1143
  useValue: config.passwordConfig
1099
- }, {
1144
+ },
1145
+ {
1100
1146
  provide: DbxFirebaseLoginModuleRootConfig,
1101
1147
  useValue: config
1102
- }, {
1148
+ },
1149
+ {
1103
1150
  provide: DbxFirebaseLoginTermsConfig,
1104
1151
  useValue: config
1105
- }]
1152
+ }
1153
+ ]
1106
1154
  };
1107
1155
  }
1108
1156
  }
@@ -1127,19 +1175,7 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
1127
1175
  DbxFirebaseLoginFacebookComponent,
1128
1176
  DbxFirebaseLoginAnonymousComponent,
1129
1177
  DbxFirebaseLoginTermsComponent,
1130
- DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule,
1131
- MatIconModule,
1132
- MatButtonModule,
1133
- DbxRouterAnchorModule,
1134
- DbxFormIoModule,
1135
- DbxFormModule,
1136
- DbxFormlyModule,
1137
- DbxFormActionModule,
1138
- DbxFormFormlyTextFieldModule,
1139
- DbxReadableErrorModule,
1140
- DbxActionModule,
1141
- DbxButtonModule,
1142
- DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
1178
+ DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
1143
1179
  DbxFirebaseLoginContextDirective,
1144
1180
  DbxFirebaseLoginContextBackButtonComponent,
1145
1181
  DbxFirebaseRegisterComponent,
@@ -1160,39 +1196,11 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
1160
1196
  DbxFirebaseLoginAnonymousComponent,
1161
1197
  DbxFirebaseLoginTermsComponent,
1162
1198
  DbxFirebaseLoginTermsSimpleComponent] });
1163
- DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[
1164
- CommonModule,
1165
- MatIconModule,
1166
- MatButtonModule,
1167
- DbxRouterAnchorModule,
1168
- DbxFormIoModule,
1169
- DbxFormModule,
1170
- DbxFormlyModule,
1171
- DbxFormActionModule,
1172
- DbxFormFormlyTextFieldModule,
1173
- DbxReadableErrorModule,
1174
- DbxActionModule,
1175
- DbxButtonModule,
1176
- DbxInjectionComponentModule
1177
- ]] });
1199
+ DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule]] });
1178
1200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, decorators: [{
1179
1201
  type: NgModule,
1180
1202
  args: [{
1181
- imports: [
1182
- CommonModule,
1183
- MatIconModule,
1184
- MatButtonModule,
1185
- DbxRouterAnchorModule,
1186
- DbxFormIoModule,
1187
- DbxFormModule,
1188
- DbxFormlyModule,
1189
- DbxFormActionModule,
1190
- DbxFormFormlyTextFieldModule,
1191
- DbxReadableErrorModule,
1192
- DbxActionModule,
1193
- DbxButtonModule,
1194
- DbxInjectionComponentModule
1195
- ],
1203
+ imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule],
1196
1204
  declarations: [
1197
1205
  DbxFirebaseLoginComponent,
1198
1206
  DbxFirebaseLoginContextDirective,
@@ -1286,7 +1294,8 @@ DbxFirebaseDefaultFirestoreProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minV
1286
1294
  DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$2.FirestoreModule] });
1287
1295
  DbxFirebaseDefaultFirestoreProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [[
1288
1296
  provideFirestore(((injector) => {
1289
- const firestore = getFirestore();
1297
+ const firebaseApp = injector.get(FirebaseApp);
1298
+ const firestore = getFirestore(firebaseApp);
1290
1299
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1291
1300
  if (emulators?.useEmulators && emulators?.firestore) {
1292
1301
  connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
@@ -1300,7 +1309,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1300
1309
  args: [{
1301
1310
  imports: [
1302
1311
  provideFirestore(((injector) => {
1303
- const firestore = getFirestore();
1312
+ const firebaseApp = injector.get(FirebaseApp);
1313
+ const firestore = getFirestore(firebaseApp);
1304
1314
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1305
1315
  if (emulators?.useEmulators && emulators?.firestore) {
1306
1316
  connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
@@ -1320,7 +1330,8 @@ DbxFirebaseDefaultAuthProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersio
1320
1330
  DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1.AuthModule] });
1321
1331
  DbxFirebaseDefaultAuthProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [[
1322
1332
  provideAuth(((injector) => {
1323
- const auth = getAuth();
1333
+ const firebaseApp = injector.get(FirebaseApp);
1334
+ const auth = getAuth(firebaseApp);
1324
1335
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1325
1336
  if (emulators?.useEmulators && emulators?.auth) {
1326
1337
  connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);
@@ -1333,7 +1344,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1333
1344
  args: [{
1334
1345
  imports: [
1335
1346
  provideAuth(((injector) => {
1336
- const auth = getAuth();
1347
+ const firebaseApp = injector.get(FirebaseApp);
1348
+ const auth = getAuth(firebaseApp);
1337
1349
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1338
1350
  if (emulators?.useEmulators && emulators?.auth) {
1339
1351
  connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);
@@ -1352,7 +1364,8 @@ DbxFirebaseDefaultStorageProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVer
1352
1364
  DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i3$2.StorageModule] });
1353
1365
  DbxFirebaseDefaultStorageProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [[
1354
1366
  provideStorage(((injector) => {
1355
- const storage = getStorage();
1367
+ const firebaseApp = injector.get(FirebaseApp);
1368
+ const storage = getStorage(firebaseApp);
1356
1369
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1357
1370
  if (emulators?.useEmulators && emulators?.storage) {
1358
1371
  connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});
@@ -1365,7 +1378,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1365
1378
  args: [{
1366
1379
  imports: [
1367
1380
  provideStorage(((injector) => {
1368
- const storage = getStorage();
1381
+ const firebaseApp = injector.get(FirebaseApp);
1382
+ const storage = getStorage(firebaseApp);
1369
1383
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1370
1384
  if (emulators?.useEmulators && emulators?.storage) {
1371
1385
  connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});
@@ -1384,7 +1398,10 @@ DbxFirebaseDefaultFunctionsProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minV
1384
1398
  DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i4$1.FunctionsModule] });
1385
1399
  DbxFirebaseDefaultFunctionsProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [[
1386
1400
  provideFunctions(((injector) => {
1387
- const functions = getFunctions();
1401
+ const firebaseApp = injector.get(FirebaseApp);
1402
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1403
+ const { functionsRegionOrCustomDomain } = firebaseOptions;
1404
+ const functions = getFunctions(firebaseApp, functionsRegionOrCustomDomain);
1388
1405
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1389
1406
  if (emulators?.useEmulators && emulators?.functions) {
1390
1407
  connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);
@@ -1397,7 +1414,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1397
1414
  args: [{
1398
1415
  imports: [
1399
1416
  provideFunctions(((injector) => {
1400
- const functions = getFunctions();
1417
+ const firebaseApp = injector.get(FirebaseApp);
1418
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1419
+ const { functionsRegionOrCustomDomain } = firebaseOptions;
1420
+ const functions = getFunctions(firebaseApp, functionsRegionOrCustomDomain);
1401
1421
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1402
1422
  if (emulators?.useEmulators && emulators?.functions) {
1403
1423
  connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);
@@ -1415,37 +1435,39 @@ class DbxFirebaseDefaultFirebaseProvidersModule {
1415
1435
  static forRoot(firebaseOptions) {
1416
1436
  return {
1417
1437
  ngModule: DbxFirebaseDefaultFirebaseProvidersModule,
1418
- providers: [{
1438
+ providers: [
1439
+ {
1419
1440
  provide: DBX_FIREBASE_OPTIONS_TOKEN,
1420
1441
  useValue: firebaseOptions
1421
- }]
1442
+ }
1443
+ ]
1422
1444
  };
1423
1445
  }
1424
1446
  }
1425
1447
  DbxFirebaseDefaultFirebaseProvidersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1426
- DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule, i5.FirebaseAppModule] });
1448
+ DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [i5.FirebaseAppModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule] });
1427
1449
  DbxFirebaseDefaultFirebaseProvidersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [[
1428
- DbxFirebaseDefaultFirestoreProviderModule,
1429
- DbxFirebaseDefaultAuthProviderModule,
1430
- DbxFirebaseDefaultStorageProviderModule,
1431
- DbxFirebaseDefaultFunctionsProviderModule,
1432
1450
  provideFirebaseApp(((injector) => {
1433
1451
  const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1434
1452
  return initializeApp(firebaseOptions);
1435
- }))
1453
+ })),
1454
+ DbxFirebaseDefaultFirestoreProviderModule,
1455
+ DbxFirebaseDefaultAuthProviderModule,
1456
+ DbxFirebaseDefaultStorageProviderModule,
1457
+ DbxFirebaseDefaultFunctionsProviderModule
1436
1458
  ]] });
1437
1459
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, decorators: [{
1438
1460
  type: NgModule,
1439
1461
  args: [{
1440
1462
  imports: [
1441
- DbxFirebaseDefaultFirestoreProviderModule,
1442
- DbxFirebaseDefaultAuthProviderModule,
1443
- DbxFirebaseDefaultStorageProviderModule,
1444
- DbxFirebaseDefaultFunctionsProviderModule,
1445
1463
  provideFirebaseApp(((injector) => {
1446
1464
  const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1447
1465
  return initializeApp(firebaseOptions);
1448
- }))
1466
+ })),
1467
+ DbxFirebaseDefaultFirestoreProviderModule,
1468
+ DbxFirebaseDefaultAuthProviderModule,
1469
+ DbxFirebaseDefaultStorageProviderModule,
1470
+ DbxFirebaseDefaultFunctionsProviderModule
1449
1471
  ]
1450
1472
  }]
1451
1473
  }] });
@@ -1457,7 +1479,7 @@ class DbxFirebaseEmulatorModule {
1457
1479
  static forRoot(config) {
1458
1480
  const defaultHost = config.host ?? 'localhost';
1459
1481
  function emulatorConfig(emulator) {
1460
- return (emulator) ? { host: emulator.host ?? defaultHost, port: emulator.port } : undefined;
1482
+ return emulator ? { host: emulator.host ?? defaultHost, port: emulator.port } : undefined;
1461
1483
  }
1462
1484
  const finalConfig = {
1463
1485
  useEmulators: config.useEmulators !== false,
@@ -1469,10 +1491,12 @@ class DbxFirebaseEmulatorModule {
1469
1491
  };
1470
1492
  return {
1471
1493
  ngModule: DbxFirebaseEmulatorModule,
1472
- providers: [{
1494
+ providers: [
1495
+ {
1473
1496
  provide: DbxFirebaseParsedEmulatorsConfig,
1474
1497
  useValue: finalConfig
1475
- }]
1498
+ }
1499
+ ]
1476
1500
  };
1477
1501
  }
1478
1502
  }
@@ -1495,15 +1519,18 @@ class DbxFirebaseFirestoreCollectionModule {
1495
1519
  static forRoot(config) {
1496
1520
  return {
1497
1521
  ngModule: DbxFirebaseFirestoreCollectionModule,
1498
- providers: [{
1522
+ providers: [
1523
+ {
1499
1524
  provide: DBX_FIRESTORE_CONTEXT_TOKEN,
1500
1525
  useFactory: firebaseFirestoreContextFactory,
1501
1526
  deps: [Firestore]
1502
- }, {
1527
+ },
1528
+ {
1503
1529
  provide: config.appCollectionClass,
1504
1530
  useFactory: config.collectionFactory,
1505
1531
  deps: [DBX_FIRESTORE_CONTEXT_TOKEN]
1506
- }]
1532
+ }
1533
+ ]
1507
1534
  };
1508
1535
  }
1509
1536
  }
@@ -1539,11 +1566,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1539
1566
  */
1540
1567
  class DbxFirebaseFunctionsModule {
1541
1568
  static forRoot(config) {
1542
- const providers = [{
1569
+ const providers = [
1570
+ {
1543
1571
  provide: config.functionsGetterToken,
1544
1572
  useFactory: config.functionsGetterFactory,
1545
1573
  deps: [Functions]
1546
- }];
1574
+ }
1575
+ ];
1547
1576
  if (config.functionsConfigMap) {
1548
1577
  forEachKeyValue(config.functionsConfigMap, {
1549
1578
  forEach: ([key, entry]) => {
@@ -1591,10 +1620,7 @@ class DbxFirebaseCollectionLoaderInstance {
1591
1620
  this._maxPagesSub = new SubscriptionObject();
1592
1621
  this.collection$ = this._collection.pipe(distinctUntilChanged());
1593
1622
  this.constraints$ = this._constraints.pipe(distinctUntilChanged());
1594
- this.iteratorFilter$ = combineLatest([
1595
- this._itemsPerPage.pipe(distinctUntilChanged()),
1596
- this.constraints$
1597
- ]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
1623
+ this.iteratorFilter$ = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
1598
1624
  this.firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
1599
1625
  if (collection) {
1600
1626
  return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
@@ -1606,16 +1632,18 @@ class DbxFirebaseCollectionLoaderInstance {
1606
1632
  }
1607
1633
  }), cleanupDestroyable(), // cleanup the iteration
1608
1634
  shareReplay(1));
1609
- this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map(instance => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
1610
- this.accumulator$ = this.firestoreIteration$.pipe(map(x => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
1611
- this.pageLoadingState$ = this.accumulator$.pipe(switchMap(x => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
1635
+ this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map((instance) => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
1636
+ this.accumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
1637
+ this.pageLoadingState$ = this.accumulator$.pipe(switchMap((x) => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
1612
1638
  }
1613
1639
  init() {
1614
1640
  // When max pages changes, update the iteration's max page limit.
1615
- this._maxPagesSub.subscription = this._maxPages.pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
1641
+ this._maxPagesSub.subscription = this._maxPages
1642
+ .pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
1616
1643
  switchMap((maxPageLoadLimit) => this.firestoreIteration$.pipe(tap((iteration) => {
1617
1644
  iteration.maxPageLoadLimit = maxPageLoadLimit;
1618
- })))).subscribe();
1645
+ }))))
1646
+ .subscribe();
1619
1647
  }
1620
1648
  destroy() {
1621
1649
  this._maxPages.complete();
@@ -1715,10 +1743,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1715
1743
  type: Input
1716
1744
  }] } });
1717
1745
  function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
1718
- const providers = [{
1746
+ const providers = [
1747
+ {
1719
1748
  provide: DbxFirebaseCollectionStoreDirective,
1720
1749
  useExisting: forwardRef(() => sourceType)
1721
- }];
1750
+ }
1751
+ ];
1722
1752
  if (storeType) {
1723
1753
  providers.push(storeType);
1724
1754
  }
@@ -1734,16 +1764,18 @@ class DbxFirebaseCollectionChangeDirective extends AbstractSubscriptionDirective
1734
1764
  this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
1735
1765
  this._mode = new BehaviorSubject('manual');
1736
1766
  this.mode$ = this._mode.pipe(distinctUntilChanged());
1737
- this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter(x => x.type !== 'none'), // do not share 'none' events.
1767
+ this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter((x) => x.type !== 'none'), // do not share 'none' events.
1738
1768
  take(1), // only need one event to mark as change is available.
1739
1769
  startWith({
1740
1770
  time: new Date(),
1741
1771
  type: 'none'
1742
1772
  }))), shareReplay(1));
1743
- this.hasChangeAvailable$ = this.event$.pipe(map(x => x.type !== 'none'), shareReplay(1));
1773
+ this.hasChangeAvailable$ = this.event$.pipe(map((x) => x.type !== 'none'), shareReplay(1));
1744
1774
  }
1745
1775
  ngOnInit() {
1746
- this.sub = combineLatest([this.mode$, this.hasChangeAvailable$]).pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange)).subscribe(() => {
1776
+ this.sub = combineLatest([this.mode$, this.hasChangeAvailable$])
1777
+ .pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange))
1778
+ .subscribe(() => {
1747
1779
  this.restart();
1748
1780
  });
1749
1781
  }
@@ -1879,10 +1911,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1879
1911
  type: Input
1880
1912
  }] } });
1881
1913
  function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
1882
- const providers = [{
1914
+ const providers = [
1915
+ {
1883
1916
  provide: DbxFirebaseDocumentStoreDirective,
1884
1917
  useExisting: forwardRef(() => sourceType)
1885
- }];
1918
+ }
1919
+ ];
1886
1920
  if (storeType) {
1887
1921
  providers.push(storeType);
1888
1922
  }
@@ -1928,7 +1962,7 @@ class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirec
1928
1962
  this.idParamKey$ = this._idParamKey.asObservable();
1929
1963
  this.idFromParams$ = combineLatest([this.idParamKey$, this.dbxRouterService.params$]).pipe(map(([key, params]) => {
1930
1964
  return params[key] ?? undefined;
1931
- }), distinctUntilChanged(), shareReplay$1(1));
1965
+ }), distinctUntilChanged(), shareReplay(1));
1932
1966
  }
1933
1967
  ngOnInit() {
1934
1968
  this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
@@ -1962,34 +1996,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1962
1996
  class DbxFirebaseModelStoreModule {
1963
1997
  }
1964
1998
  DbxFirebaseModelStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1965
- DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective,
1966
- DbxFirebaseCollectionChangeDirective,
1967
- DbxFirebaseCollectionHasChangeDirective,
1968
- DbxFirebaseDocumentStoreRouteIdDirective,
1969
- DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective,
1970
- DbxFirebaseCollectionChangeDirective,
1971
- DbxFirebaseCollectionHasChangeDirective,
1972
- DbxFirebaseDocumentStoreRouteIdDirective,
1973
- DbxFirebaseDocumentAuthIdDirective] });
1999
+ DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective] });
1974
2000
  DbxFirebaseModelStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, imports: [[]] });
1975
2001
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, decorators: [{
1976
2002
  type: NgModule,
1977
2003
  args: [{
1978
2004
  imports: [],
1979
- declarations: [
1980
- DbxFirebaseCollectionListDirective,
1981
- DbxFirebaseCollectionChangeDirective,
1982
- DbxFirebaseCollectionHasChangeDirective,
1983
- DbxFirebaseDocumentStoreRouteIdDirective,
1984
- DbxFirebaseDocumentAuthIdDirective
1985
- ],
1986
- exports: [
1987
- DbxFirebaseCollectionListDirective,
1988
- DbxFirebaseCollectionChangeDirective,
1989
- DbxFirebaseCollectionHasChangeDirective,
1990
- DbxFirebaseDocumentStoreRouteIdDirective,
1991
- DbxFirebaseDocumentAuthIdDirective
1992
- ]
2005
+ declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective],
2006
+ exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective]
1993
2007
  }]
1994
2008
  }] });
1995
2009
 
@@ -2001,10 +2015,10 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
2001
2015
  super(...arguments);
2002
2016
  // MARK: Effects
2003
2017
  this.setMaxPages = this.effect((input) => {
2004
- return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.maxPages = maxPages))));
2018
+ return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => (x.maxPages = maxPages)))));
2005
2019
  });
2006
2020
  this.setItemsPerPage = this.effect((input) => {
2007
- return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.itemsPerPage = itemsPerPage))));
2021
+ return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => (x.itemsPerPage = itemsPerPage)))));
2008
2022
  });
2009
2023
  this.setConstraints = this.effect((input) => {
2010
2024
  return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));
@@ -2018,16 +2032,16 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
2018
2032
  // MARK: Accessors
2019
2033
  this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
2020
2034
  this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
2021
- this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map(x => dbxFirebaseCollectionLoaderInstance({
2035
+ this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map((x) => dbxFirebaseCollectionLoaderInstance({
2022
2036
  collection,
2023
2037
  maxPages: x.maxPages,
2024
2038
  itemsPerPage: x.itemsPerPage,
2025
2039
  constraints: x.constraints
2026
2040
  })))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
2027
- this.firestoreIteration$ = this.loader$.pipe(switchMap(x => x.firestoreIteration$));
2028
- this.queryChangeWatcher$ = this.loader$.pipe(switchMap(x => x.queryChangeWatcher$));
2029
- this.accumulator$ = this.loader$.pipe(switchMap(x => x.accumulator$));
2030
- this.pageLoadingState$ = this.loader$.pipe(switchMap(x => x.pageLoadingState$));
2041
+ this.firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
2042
+ this.queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
2043
+ this.accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
2044
+ this.pageLoadingState$ = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));
2031
2045
  this.setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
2032
2046
  }
2033
2047
  }
@@ -2052,9 +2066,9 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2052
2066
  // MARK: Accessors
2053
2067
  this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
2054
2068
  this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
2055
- this.currentInputId$ = this.state$.pipe(map(x => x.id), distinctUntilChanged(), shareReplay(1));
2069
+ this.currentInputId$ = this.state$.pipe(map((x) => x.id), distinctUntilChanged(), shareReplay(1));
2056
2070
  this.inputId$ = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2057
- this.currentInputRef$ = this.state$.pipe(map(x => x.ref), distinctUntilChanged(), shareReplay(1));
2071
+ this.currentInputRef$ = this.state$.pipe(map((x) => x.ref), distinctUntilChanged(), shareReplay(1));
2058
2072
  this.inputRef$ = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2059
2073
  this.currentDocument$ = combineLatest([this.currentFirestoreCollection$, this.currentInputId$, this.currentInputRef$]).pipe(map(([collection, id, ref]) => {
2060
2074
  let document;
@@ -2069,12 +2083,12 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2069
2083
  return document;
2070
2084
  }), distinctUntilChanged(), shareReplay(1));
2071
2085
  this.document$ = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2072
- this.documentLoadingState$ = this.currentDocument$.pipe(map(x => (x) ? successResult(x) : beginLoading()), shareReplay(1));
2073
- this.id$ = this.document$.pipe(map(x => x.id), shareReplay());
2074
- this.ref$ = this.document$.pipe(map(x => x.documentRef), shareReplay());
2075
- this.snapshot$ = this.document$.pipe(switchMap(x => x.accessor.stream()), shareReplay(1));
2076
- this.snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(_ => loadingStateFromObs(this.snapshot$)), shareReplay(1));
2077
- this.currentData$ = this.document$.pipe(switchMap(x => x.accessor.stream().pipe(map(y => documentDataWithId(y)))), shareReplay(1));
2086
+ this.documentLoadingState$ = this.currentDocument$.pipe(map((x) => (x ? successResult(x) : beginLoading())), shareReplay(1));
2087
+ this.id$ = this.document$.pipe(map((x) => x.id), shareReplay());
2088
+ this.ref$ = this.document$.pipe(map((x) => x.documentRef), shareReplay());
2089
+ this.snapshot$ = this.document$.pipe(switchMap((x) => x.accessor.stream()), shareReplay(1));
2090
+ this.snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(() => loadingStateFromObs(this.snapshot$)), shareReplay(1));
2091
+ this.currentData$ = this.document$.pipe(switchMap((x) => x.accessor.stream().pipe(map((y) => documentDataWithId(y)))), shareReplay(1));
2078
2092
  this.data$ = this.currentDocument$.pipe(switchMap(() => this.currentData$.pipe(filterMaybe())), shareReplay(1));
2079
2093
  this.dataLoadingState$ = this.snapshotLoadingState$.pipe(map((x) => {
2080
2094
  let result;
@@ -2095,17 +2109,17 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2095
2109
  }
2096
2110
  return result;
2097
2111
  }), shareReplay(1));
2098
- this.exists$ = this.currentData$.pipe(map(x => isMaybeSo(x)), shareReplay(1));
2099
- this.doesNotExist$ = this.exists$.pipe(map(x => !x), shareReplay(1));
2112
+ this.exists$ = this.currentData$.pipe(map((x) => isMaybeSo(x)), shareReplay(1));
2113
+ this.doesNotExist$ = this.exists$.pipe(map((x) => !x), shareReplay(1));
2100
2114
  // MARK: State Changes
2101
2115
  /**
2102
2116
  * Sets the id of the document to load.
2103
2117
  */
2104
- this.setId = this.updater((state, id) => (id) ? ({ ...state, id, ref: undefined }) : ({ ...state, id }));
2118
+ this.setId = this.updater((state, id) => (id ? { ...state, id, ref: undefined } : { ...state, id }));
2105
2119
  /**
2106
2120
  * Sets the ref of the document to load.
2107
2121
  */
2108
- this.setRef = this.updater((state, ref) => (ref) ? ({ ...state, id: undefined, ref }) : ({ ...state, ref }));
2122
+ this.setRef = this.updater((state, ref) => (ref ? { ...state, id: undefined, ref } : { ...state, ref }));
2109
2123
  this.setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
2110
2124
  }
2111
2125
  }
@@ -2165,9 +2179,9 @@ class AbstractDbxFirebaseCollectionWithParentStore extends AbstractDbxFirebaseCo
2165
2179
  this.setParent = setParentEffect(this);
2166
2180
  this.setParentStore = setParentStoreEffect(this);
2167
2181
  // MARK: Accessors
2168
- this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
2182
+ this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
2169
2183
  this.parent$ = this.currentParent$.pipe(filterMaybe());
2170
- this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2184
+ this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2171
2185
  this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
2172
2186
  // MARK: State Changes
2173
2187
  /**
@@ -2196,9 +2210,9 @@ class AbstractDbxFirebaseDocumentWithParentStore extends AbstractDbxFirebaseDocu
2196
2210
  this.setParent = setParentEffect(this);
2197
2211
  this.setParentStore = setParentStoreEffect(this);
2198
2212
  // MARK: Accessors
2199
- this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
2213
+ this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
2200
2214
  this.parent$ = this.currentParent$.pipe(filterMaybe());
2201
- this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2215
+ this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2202
2216
  this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
2203
2217
  // MARK: State Changes
2204
2218
  /**
@@ -2225,9 +2239,7 @@ DbxFirebaseModelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
2225
2239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, decorators: [{
2226
2240
  type: NgModule,
2227
2241
  args: [{
2228
- exports: [
2229
- DbxFirebaseModelStoreModule
2230
- ]
2242
+ exports: [DbxFirebaseModelStoreModule]
2231
2243
  }]
2232
2244
  }] });
2233
2245
 
@@ -2239,9 +2251,7 @@ DbxFirebaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
2239
2251
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, decorators: [{
2240
2252
  type: NgModule,
2241
2253
  args: [{
2242
- exports: [
2243
- DbxFirebaseModelModule
2244
- ]
2254
+ exports: [DbxFirebaseModelModule]
2245
2255
  }]
2246
2256
  }] });
2247
2257