@dereekb/dbx-firebase 12.6.21 → 12.7.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/esm2022/lib/auth/login/login.email.form.component.mjs +1 -1
- package/esm2022/lib/development/development.directive.mjs +6 -5
- package/esm2022/lib/development/development.popup.content.component.mjs +7 -13
- package/esm2022/lib/model/modules/model/entities/model.entities.component.mjs +4 -6
- package/esm2022/lib/model/modules/model/entities/model.entities.entity.component.mjs +4 -7
- package/esm2022/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.mjs +3 -6
- package/esm2022/lib/model/modules/model/model.types.view.directive.mjs +9 -9
- package/esm2022/lib/model/modules/store/store.collection.change.directive.mjs +6 -9
- package/esm2022/lib/model/modules/store/store.collection.directive.mjs +6 -10
- package/esm2022/lib/model/modules/store/store.collection.list.directive.mjs +9 -10
- package/esm2022/lib/model/modules/store/store.document.directive.mjs +6 -11
- package/esm2022/lib/model/modules/store/store.document.twoway.key.directive.mjs +5 -6
- package/esm2022/lib/model/modules/store/store.subcollection.directive.mjs +5 -9
- package/esm2022/lib/model/system/systemstate.document.store.accessor.mjs +1 -4
- package/esm2022/lib/modules/notification/store/notification.item.store.mjs +1 -1
- package/esm2022/lib/modules/storagefile/container/storagefile.upload.action.handler.directive.mjs +12 -19
- package/esm2022/lib/modules/storagefile/container/storagefile.upload.initialize.document.directive.mjs +7 -12
- package/esm2022/lib/modules/storagefile/container/storagefile.upload.store.directive.mjs +5 -10
- package/esm2022/lib/modules/storagefile/container/storagefile.upload.sync.directive.mjs +5 -13
- package/esm2022/lib/modules/storagefile/store/storagefile.upload.store.mjs +1 -1
- package/fesm2022/dereekb-dbx-firebase.mjs +62 -126
- package/fesm2022/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/auth/login/login.email.form.component.d.ts +1 -2
- package/lib/development/development.directive.d.ts +3 -3
- package/lib/development/development.popup.content.component.d.ts +2 -5
- package/lib/model/modules/model/entities/model.entities.component.d.ts +1 -3
- package/lib/model/modules/model/entities/model.entities.entity.component.d.ts +1 -3
- package/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.d.ts +3 -4
- package/lib/model/modules/model/model.types.view.directive.d.ts +2 -4
- package/lib/model/modules/store/store.collection.change.directive.d.ts +2 -4
- package/lib/model/modules/store/store.collection.directive.d.ts +2 -4
- package/lib/model/modules/store/store.collection.list.directive.d.ts +1 -4
- package/lib/model/modules/store/store.document.directive.d.ts +2 -4
- package/lib/model/modules/store/store.document.twoway.key.directive.d.ts +1 -2
- package/lib/model/modules/store/store.subcollection.directive.d.ts +2 -4
- package/lib/model/system/systemstate.document.store.accessor.d.ts +1 -3
- package/lib/modules/notification/store/notification.item.store.d.ts +1 -2
- package/lib/modules/storagefile/container/storagefile.upload.action.handler.directive.d.ts +2 -8
- package/lib/modules/storagefile/container/storagefile.upload.initialize.document.directive.d.ts +1 -4
- package/lib/modules/storagefile/container/storagefile.upload.store.directive.d.ts +1 -5
- package/lib/modules/storagefile/container/storagefile.upload.sync.directive.d.ts +1 -6
- package/lib/modules/storagefile/store/storagefile.upload.store.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable, APP_INITIALIZER, makeEnvironmentProviders, InjectionToken, Component, Optional, Inject, model, computed, ChangeDetectionStrategy, signal, Directive, input, EventEmitter, output, NgModule, Injector, viewChild, HostListener, ElementRef, forwardRef, effect, DestroyRef, Pipe } from '@angular/core';
|
|
3
3
|
import { DbxAnalyticsService } from '@dereekb/dbx-analytics';
|
|
4
|
-
import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, distinctUntilKeysChange, cleanupDestroyable, iterationHasNextAndCanLoadMore, pageItemAccumulatorCurrentPage, accumulatorFlattenPageListLoadingState, useFirst, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageLoadingStateFromObs, useAsObservable, filterMaybeArray, mapEachAsync, invertObservableDecision, filterItemsWithObservableDecision,
|
|
4
|
+
import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, distinctUntilKeysChange, cleanupDestroyable, iterationHasNextAndCanLoadMore, pageItemAccumulatorCurrentPage, accumulatorFlattenPageListLoadingState, useFirst, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageLoadingStateFromObs, useAsObservable, filterMaybeArray, mapEachAsync, invertObservableDecision, filterItemsWithObservableDecision, switchMapMaybe, beginLoading, mapLoadingStateValueWithOperator, valueFromFinishedLoadingState, skipInitialMaybe, distinctUntilModelKeyChange, successResult, tapLog, errorResult, isLoadingStateLoading, cleanup, mapLoadingState, throwErrorFromLoadingStateError, maybeValueFromObservableOrValue, distinctUntilHasDifferentValues, MultiSubscriptionObject, startWithBeginLoading, skipAllInitialMaybe } from '@dereekb/rxjs';
|
|
5
5
|
import { switchMap, of, shareReplay, map, distinctUntilChanged, EMPTY, catchError, firstValueFrom, BehaviorSubject, combineLatest, first, from, tap, interval, exhaustMap, filter, take, startWith, Subject, throttleTime, NEVER, defaultIfEmpty, combineLatestWith, mergeMap, Observable } from 'rxjs';
|
|
6
6
|
import * as i2 from '@dereekb/dbx-core';
|
|
7
|
-
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, DbxInjectionComponent, AbstractForwardDbxInjectionContextDirective, DbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxAuthService, DbxActionButtonDirective, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionAutoTriggerDirective, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate,
|
|
7
|
+
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, DbxInjectionComponent, AbstractForwardDbxInjectionContextDirective, DbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxAuthService, DbxActionButtonDirective, completeOnDestroy, cleanSubscription, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionAutoTriggerDirective, clean, cleanLoadingContext, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate, AbstractIfDirective, LockSetComponentStore, newWithInjector, CutTextPipe, DbxActionContextStoreSourceInstance, DbxActionHandlerInstance, SimpleStorageAccessorFactory, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '@dereekb/dbx-core';
|
|
8
8
|
import { Auth, authState, idToken, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, reauthenticateWithPopup, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
9
9
|
import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeArrayValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, pushArrayItemsIntoArray, forEachKeyValue, countAllInNestedArray, invertDecision, filterUniqueValues, reverseCompareFn, sortByNumberFunction, separateValues, readableError, isMaybeSo, firstValue, splitJoinRemainder, MS_IN_HOUR, SECONDS_IN_MINUTE, MS_IN_DAY, unixDateTimeSecondsNumberForNow, MS_IN_MINUTE, addMilliseconds, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeSecondsNumber, MS_IN_SECOND, isPast } from '@dereekb/util';
|
|
10
10
|
import { safeFormatToISO8601DateString, msToSeconds, isSameDate } from '@dereekb/date';
|
|
@@ -1903,11 +1903,10 @@ class DbxFirebaseDevelopmentPopupContentComponent {
|
|
|
1903
1903
|
dbxFirebaseDevelopmentWidgetService = inject(DbxFirebaseDevelopmentWidgetService);
|
|
1904
1904
|
dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);
|
|
1905
1905
|
dbxFirebaseEmulatorService = inject(DbxFirebaseEmulatorService);
|
|
1906
|
-
_backSub = new SubscriptionObject();
|
|
1907
1906
|
showEmulatorButton = this.dbxFirebaseEmulatorService.useEmulators === true;
|
|
1908
1907
|
emulatorUIAnchor = this.dbxFirebaseEmulatorService.emulatorUIAnchor ?? {};
|
|
1909
1908
|
entries = this.dbxFirebaseDevelopmentWidgetService.getEntries();
|
|
1910
|
-
_activeEntrySelector = new BehaviorSubject(DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY);
|
|
1909
|
+
_activeEntrySelector = completeOnDestroy(new BehaviorSubject(DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY));
|
|
1911
1910
|
isLoggedIn$ = this.dbxAuthService.isLoggedIn$;
|
|
1912
1911
|
entries$ = this.isLoggedIn$.pipe(distinctUntilChanged(), map((isLoggedIn) => this.entries), shareReplay(1));
|
|
1913
1912
|
formConfig$ = this.entries$.pipe(map((entries) => ({ entries })));
|
|
@@ -1932,15 +1931,11 @@ class DbxFirebaseDevelopmentPopupContentComponent {
|
|
|
1932
1931
|
}
|
|
1933
1932
|
return widgetConfig;
|
|
1934
1933
|
});
|
|
1935
|
-
|
|
1934
|
+
constructor() {
|
|
1936
1935
|
this.twoColumnsContextStore.setShowRight(this.showRight$);
|
|
1937
|
-
this.
|
|
1936
|
+
cleanSubscription(this.twoColumnsContextStore.back$.subscribe(() => {
|
|
1938
1937
|
this.clearSelection();
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
ngOnDestroy() {
|
|
1942
|
-
this._backSub.destroy();
|
|
1943
|
-
this._activeEntrySelector.complete();
|
|
1938
|
+
}));
|
|
1944
1939
|
}
|
|
1945
1940
|
handleFormUpdate = (value, context) => {
|
|
1946
1941
|
this._activeEntrySelector.next(value.specifier);
|
|
@@ -1958,7 +1953,7 @@ class DbxFirebaseDevelopmentPopupContentComponent {
|
|
|
1958
1953
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentComponent, decorators: [{
|
|
1959
1954
|
type: Component,
|
|
1960
1955
|
args: [{ selector: 'dbx-firebase-development-popup-content', imports: [DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, DbxWidgetViewComponent, DbxFirebaseDevelopmentPopupContentFormComponent, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionFormDirective, DbxFormSourceDirective, DbxActionAutoTriggerDirective, MatButtonModule], providers: [TwoColumnsContextStore], standalone: true, template: "<dbx-two-column class=\"dbx-firebase-development-popup-content\" [dbxTwoColumnFullLeft]=\"true\">\n <dbx-two-block left>\n <div>\n <h4>Info</h4>\n <p>Scheduler (Running): {{ schedulerRunningSignal() }} : {{ schedulerIntervalSignal() }}s : {{ schedulerErrorSignal() }}</p>\n <div>\n @if (showEmulatorButton) {\n <dbx-anchor [anchor]=\"emulatorUIAnchor\">\n <button mat-flat-button color=\"accent\">Emulator Enabled</button>\n </dbx-anchor>\n }\n </div>\n </div>\n <div>\n <h4>Tools</h4>\n <div dbxAction dbxActionEnforceModified dbxActionAutoTrigger useInstantTriggerPreset [dbxActionHandler]=\"handleFormUpdate\">\n <dbx-firebase-development-popup-content-form [config]=\"formConfig$\" dbxActionForm [dbxActionFormIsModified]=\"isFormModified\" [dbxFormSource]=\"formData$\" dbxFormSourceMode=\"always\"></dbx-firebase-development-popup-content-form>\n </div>\n </div>\n </dbx-two-block>\n <dbx-two-column-right right [header]=\"rightTitleSignal()\">\n <dbx-widget-view [config]=\"widgetConfigSignal()\"></dbx-widget-view>\n </dbx-two-column-right>\n</dbx-two-column>\n", styles: [".dbx-firebase-development-popup-content{height:400px;overflow:hidden}\n"] }]
|
|
1961
|
-
}] });
|
|
1956
|
+
}], ctorParameters: () => [] });
|
|
1962
1957
|
|
|
1963
1958
|
const DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY = 'devpopup';
|
|
1964
1959
|
class DbxFirebaseDevelopmentPopupComponent extends AbstractPopupDirective {
|
|
@@ -2029,6 +2024,9 @@ class DbxFirebaseDevelopmentDirective {
|
|
|
2029
2024
|
get enabled() {
|
|
2030
2025
|
return this.dbxFirebaseDevelopmentService.enabled;
|
|
2031
2026
|
}
|
|
2027
|
+
constructor() {
|
|
2028
|
+
clean(() => this.closePopup());
|
|
2029
|
+
}
|
|
2032
2030
|
handleKeyboardEvent(event) {
|
|
2033
2031
|
if (this.enabled && event.shiftKey && event.altKey && event.code === 'KeyD') {
|
|
2034
2032
|
this.togglePopup();
|
|
@@ -2073,9 +2071,6 @@ class DbxFirebaseDevelopmentDirective {
|
|
|
2073
2071
|
});
|
|
2074
2072
|
}
|
|
2075
2073
|
}
|
|
2076
|
-
ngOnDestroy() {
|
|
2077
|
-
this.closePopup();
|
|
2078
|
-
}
|
|
2079
2074
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDevelopmentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2080
2075
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseDevelopmentDirective, isStandalone: true, selector: "[dbxFirebaseDevelopment]", host: { listeners: { "window:keydown": "handleKeyboardEvent($event)" } }, ngImport: i0 });
|
|
2081
2076
|
}
|
|
@@ -2085,7 +2080,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2085
2080
|
selector: '[dbxFirebaseDevelopment]',
|
|
2086
2081
|
standalone: true
|
|
2087
2082
|
}]
|
|
2088
|
-
}], propDecorators: { handleKeyboardEvent: [{
|
|
2083
|
+
}], ctorParameters: () => [], propDecorators: { handleKeyboardEvent: [{
|
|
2089
2084
|
type: HostListener,
|
|
2090
2085
|
args: ['window:keydown', ['$event']]
|
|
2091
2086
|
}] } });
|
|
@@ -3685,10 +3680,7 @@ class DbxFirebaseModelEntitiesEntityComponent {
|
|
|
3685
3680
|
entityWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.entityComponentConfig);
|
|
3686
3681
|
commonWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.commonComponentConfig);
|
|
3687
3682
|
debugWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.debugComponentConfig);
|
|
3688
|
-
loadingContext =
|
|
3689
|
-
ngOnDestroy() {
|
|
3690
|
-
this.loadingContext.destroy();
|
|
3691
|
-
}
|
|
3683
|
+
loadingContext = cleanLoadingContext({ obs: this.loadingState$ });
|
|
3692
3684
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesEntityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3693
3685
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelEntitiesEntityComponent, isStandalone: true, selector: "dbx-firebase-model-entities-entity", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n @if (displayInfoSignal(); as displayInfo) {\n <div class=\"dbx-list-two-line-item\">\n <div class=\"item-left\">\n <span class=\"dbx-pb2 dbx-flex-bar\">\n @if (displayInfo.icon) {\n <mat-icon class=\"dbx-button-spacer\">{{ displayInfo.icon }}</mat-icon>\n }\n <span>{{ displayInfo.title }}</span>\n </span>\n <span>\n <span class=\"dbx-hint dbx-small\">{{ modelTypeSignal() }}</span>\n @if (displayNameSignal(); as displayName) {\n <span class=\"dbx-small dbx-u dbx-pl2\">{{ displayName }}</span>\n }\n </span>\n </div>\n </div>\n }\n </mat-panel-title>\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"dbx-firebase-model-entities-entity-panel-content\">\n <dbx-loading [context]=\"loadingContext\">\n @if (entityWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-entity-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (commonWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-common-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (debugWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-debug-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n </dbx-loading>\n </div>\n </ng-template>\n</mat-expansion-panel>\n", dependencies: [{ kind: "component", type: DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: DbxLoadingComponent, selector: "dbx-loading", inputs: ["padding", "show", "text", "mode", "color", "diameter", "linear", "loading", "error", "context"] }, { kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: MatExpansionPanelContent, selector: "ng-template[matExpansionPanelContent]" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3694
3686
|
}
|
|
@@ -3752,10 +3744,7 @@ class DbxFirebaseModelEntitiesComponent {
|
|
|
3752
3744
|
return onlyShowRegisteredTypes && Boolean(unregisteredEntities?.length);
|
|
3753
3745
|
});
|
|
3754
3746
|
hasNoEntitiesSignal = computed(() => !this.entitiesWithKeysSignal()?.length);
|
|
3755
|
-
context =
|
|
3756
|
-
ngOnDestroy() {
|
|
3757
|
-
this.context.destroy();
|
|
3758
|
-
}
|
|
3747
|
+
context = cleanLoadingContext({ obs: this.allEntitiesState$ });
|
|
3759
3748
|
clickShowUnregisteredEntities() {
|
|
3760
3749
|
this.showUnregisteredTypesSignal.set(true);
|
|
3761
3750
|
}
|
|
@@ -4099,10 +4088,7 @@ class DbxFirebaseModelEntitiesDebugWidgetComponent extends AbstractDbxFirebaseMo
|
|
|
4099
4088
|
}
|
|
4100
4089
|
return content;
|
|
4101
4090
|
});
|
|
4102
|
-
context =
|
|
4103
|
-
ngOnDestroy() {
|
|
4104
|
-
this.context.destroy();
|
|
4105
|
-
}
|
|
4091
|
+
context = cleanLoadingContext(this.store.dataLoadingState$);
|
|
4106
4092
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesDebugWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4107
4093
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelEntitiesDebugWidgetComponent, isStandalone: true, selector: "dbx-firebase-model-entities-debug-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-download-text-view [showTitle]=\"false\" [content]=\"contentSignal()\"></dbx-download-text-view>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: DbxFirebaseModelKeyComponent, selector: "dbx-firebase-model-key", inputs: ["modelKey"] }, { kind: "component", type: DbxDownloadTextViewComponent, selector: "dbx-download-text-view", inputs: ["showDownloadButton", "loadingText", "linear", "showTitle", "showPreview", "showExpandPreviewButton", "expandPreview", "content", "contentState"], outputs: ["expandPreviewChange"] }, { kind: "component", type: DbxLoadingComponent, selector: "dbx-loading", inputs: ["padding", "show", "text", "mode", "color", "diameter", "linear", "loading", "error", "context"] }] });
|
|
4108
4094
|
}
|
|
@@ -4127,8 +4113,7 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4127
4113
|
_flatKey$ = toObservable(this.flatKey).pipe(skipInitialMaybe());
|
|
4128
4114
|
_ref$ = toObservable(this.ref).pipe(skipInitialMaybe());
|
|
4129
4115
|
_streamMode$ = toObservable(this.streamMode).pipe(skipInitialMaybe());
|
|
4130
|
-
_store = new BehaviorSubject(undefined);
|
|
4131
|
-
_storeSub = new SubscriptionObject();
|
|
4116
|
+
_store = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4132
4117
|
store$ = this._store.pipe(filterMaybe(), shareReplay(1));
|
|
4133
4118
|
exists$ = this.store$.pipe(switchMap((x) => x.exists$));
|
|
4134
4119
|
document$ = this.store$.pipe(switchMap((x) => x.document$));
|
|
@@ -4145,7 +4130,7 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4145
4130
|
constructor(store) {
|
|
4146
4131
|
this.replaceStore(store);
|
|
4147
4132
|
// sync inputs to store any time the store changes
|
|
4148
|
-
this.
|
|
4133
|
+
cleanSubscription(this._store.subscribe((x) => {
|
|
4149
4134
|
if (x) {
|
|
4150
4135
|
x.setStoreName(this._storeName$);
|
|
4151
4136
|
x.setId(this._documentId$);
|
|
@@ -4154,11 +4139,7 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4154
4139
|
x.setRef(this._ref$);
|
|
4155
4140
|
x.setStreamMode(this._streamMode$);
|
|
4156
4141
|
}
|
|
4157
|
-
});
|
|
4158
|
-
}
|
|
4159
|
-
ngOnDestroy() {
|
|
4160
|
-
this._store.complete();
|
|
4161
|
-
this._storeSub.destroy();
|
|
4142
|
+
}));
|
|
4162
4143
|
}
|
|
4163
4144
|
get store() {
|
|
4164
4145
|
return this._store.value;
|
|
@@ -4221,13 +4202,13 @@ function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
|
|
|
4221
4202
|
/**
|
|
4222
4203
|
* Used with a DbxFirebaseDocumentStoreDirective to emit model viewed events.
|
|
4223
4204
|
*/
|
|
4224
|
-
class DbxFirebaseModelViewedEventDirective
|
|
4205
|
+
class DbxFirebaseModelViewedEventDirective {
|
|
4225
4206
|
dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective);
|
|
4226
4207
|
dbxModelObjectStateService = inject(DbxModelObjectStateService);
|
|
4227
4208
|
dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);
|
|
4228
4209
|
modelViewContext = input(undefined, { alias: 'dbxFirebaseModelViewedEvent' });
|
|
4229
|
-
|
|
4230
|
-
this.
|
|
4210
|
+
constructor() {
|
|
4211
|
+
cleanSubscription(this.dbxFirebaseDocumentStoreDirective.data$
|
|
4231
4212
|
.pipe(
|
|
4232
4213
|
//
|
|
4233
4214
|
distinctUntilModelKeyChange(), combineLatestWith(this.dbxFirebaseDocumentStoreDirective.modelIdentity$.pipe(switchMap((x) => this.dbxFirebaseModelTypesService.infoForType(x.modelType)), first()), this.dbxFirebaseDocumentStoreDirective.key$), map(([data, typeInfo, key]) => {
|
|
@@ -4242,10 +4223,10 @@ class DbxFirebaseModelViewedEventDirective extends AbstractSubscriptionDirective
|
|
|
4242
4223
|
.subscribe((modelKeyTypeNamePair) => {
|
|
4243
4224
|
const context = this.modelViewContext();
|
|
4244
4225
|
this.dbxModelObjectStateService.emitModelViewEvent({ modelKeyTypeNamePair, context });
|
|
4245
|
-
});
|
|
4226
|
+
}));
|
|
4246
4227
|
}
|
|
4247
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelViewedEventDirective, deps:
|
|
4248
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseModelViewedEventDirective, isStandalone: true, selector: "[dbxFirebaseModelViewedEvent]", inputs: { modelViewContext: { classPropertyName: "modelViewContext", publicName: "dbxFirebaseModelViewedEvent", isSignal: true, isRequired: false, transformFunction: null } },
|
|
4228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelViewedEventDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4229
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseModelViewedEventDirective, isStandalone: true, selector: "[dbxFirebaseModelViewedEvent]", inputs: { modelViewContext: { classPropertyName: "modelViewContext", publicName: "dbxFirebaseModelViewedEvent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
4249
4230
|
}
|
|
4250
4231
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelViewedEventDirective, decorators: [{
|
|
4251
4232
|
type: Directive,
|
|
@@ -4253,7 +4234,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4253
4234
|
selector: '[dbxFirebaseModelViewedEvent]',
|
|
4254
4235
|
standalone: true
|
|
4255
4236
|
}]
|
|
4256
|
-
}] });
|
|
4237
|
+
}], ctorParameters: () => [] });
|
|
4257
4238
|
|
|
4258
4239
|
const importsAndExports$4 = [DbxFirebaseModelViewedEventDirective, DbxFirebaseModelTypeInstanceListComponent, DbxFirebaseModelTypeInstanceListViewComponent, DbxFirebaseModelTypeInstanceListViewItemComponent];
|
|
4259
4240
|
/**
|
|
@@ -4295,14 +4276,13 @@ class DbxFirebaseCollectionStoreDirective {
|
|
|
4295
4276
|
_itemsPerPage = toObservable(this.itemsPerPage).pipe(skipInitialMaybe());
|
|
4296
4277
|
_constraints = toObservable(this.constraints).pipe(skipInitialMaybe());
|
|
4297
4278
|
_waitForNonNullConstraints = toObservable(this.waitForNonNullConstraints).pipe(skipInitialMaybe());
|
|
4298
|
-
_store = new BehaviorSubject(undefined);
|
|
4299
|
-
_storeSub = new SubscriptionObject();
|
|
4279
|
+
_store = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4300
4280
|
store$ = this._store.pipe(filterMaybe(), shareReplay(1));
|
|
4301
4281
|
pageLoadingState$ = this.store$.pipe(switchMap((x) => x.pageLoadingState$));
|
|
4302
4282
|
constructor(store) {
|
|
4303
4283
|
this.replaceStore(store);
|
|
4304
4284
|
// sync inputs to store any time the store changes
|
|
4305
|
-
this.
|
|
4285
|
+
cleanSubscription(this.store$.subscribe((x) => {
|
|
4306
4286
|
x.setCollectionMode(this._collectionMode);
|
|
4307
4287
|
x.setCollectionKeys(this._collectionKeys);
|
|
4308
4288
|
x.setCollectionRefs(this._collectionRefs);
|
|
@@ -4310,15 +4290,11 @@ class DbxFirebaseCollectionStoreDirective {
|
|
|
4310
4290
|
x.setMaxPages(this._maxPages);
|
|
4311
4291
|
x.setItemsPerPage(this._itemsPerPage);
|
|
4312
4292
|
x.setWaitForNonNullConstraints(this._waitForNonNullConstraints);
|
|
4313
|
-
});
|
|
4293
|
+
}));
|
|
4314
4294
|
}
|
|
4315
4295
|
get store() {
|
|
4316
4296
|
return this._store.value;
|
|
4317
4297
|
}
|
|
4318
|
-
ngOnDestroy() {
|
|
4319
|
-
this._store.complete();
|
|
4320
|
-
this._storeSub.destroy();
|
|
4321
|
-
}
|
|
4322
4298
|
/**
|
|
4323
4299
|
* Replaces the internal store.
|
|
4324
4300
|
*/
|
|
@@ -4377,8 +4353,8 @@ function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
|
4377
4353
|
class DbxFirebaseCollectionChangeDirective {
|
|
4378
4354
|
dbxFirebaseCollectionStoreDirective = inject((DbxFirebaseCollectionStoreDirective));
|
|
4379
4355
|
mode = input('off', { alias: 'dbxFirebaseCollectionChange', transform: (x) => x || 'off' });
|
|
4380
|
-
_watcher = dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store);
|
|
4381
|
-
_trigger = dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart());
|
|
4356
|
+
_watcher = clean(dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store));
|
|
4357
|
+
_trigger = clean(dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart()));
|
|
4382
4358
|
mode$ = this._watcher.mode$;
|
|
4383
4359
|
event$ = this._watcher.event$;
|
|
4384
4360
|
hasChangeAvailable$ = this._watcher.hasChangeAvailable$;
|
|
@@ -4390,13 +4366,9 @@ class DbxFirebaseCollectionChangeDirective {
|
|
|
4390
4366
|
get store() {
|
|
4391
4367
|
return this._watcher.store;
|
|
4392
4368
|
}
|
|
4393
|
-
|
|
4369
|
+
constructor() {
|
|
4394
4370
|
this._trigger.init();
|
|
4395
4371
|
}
|
|
4396
|
-
ngOnDestroy() {
|
|
4397
|
-
this._watcher.destroy();
|
|
4398
|
-
this._trigger.destroy();
|
|
4399
|
-
}
|
|
4400
4372
|
restart() {
|
|
4401
4373
|
this.dbxFirebaseCollectionStoreDirective.store.restart();
|
|
4402
4374
|
}
|
|
@@ -4409,7 +4381,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4409
4381
|
selector: '[dbxFirebaseCollectionChange]',
|
|
4410
4382
|
standalone: true
|
|
4411
4383
|
}]
|
|
4412
|
-
}] });
|
|
4384
|
+
}], ctorParameters: () => [] });
|
|
4413
4385
|
|
|
4414
4386
|
/**
|
|
4415
4387
|
* Structural directive that displays the content when the target change is detected.
|
|
@@ -4450,20 +4422,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4450
4422
|
/**
|
|
4451
4423
|
* Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.
|
|
4452
4424
|
*/
|
|
4453
|
-
class DbxFirebaseCollectionListDirective
|
|
4425
|
+
class DbxFirebaseCollectionListDirective {
|
|
4454
4426
|
dbxFirebaseCollectionStoreDirective = inject((DbxFirebaseCollectionStoreDirective));
|
|
4455
4427
|
dbxListViewWrapper = inject((DbxListViewWrapper), { host: true });
|
|
4456
4428
|
constructor() {
|
|
4457
|
-
super();
|
|
4458
4429
|
this.dbxListViewWrapper.setState(this.dbxFirebaseCollectionStoreDirective.pageLoadingState$);
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
}
|
|
4430
|
+
if (this.dbxListViewWrapper.loadMore) {
|
|
4431
|
+
cleanSubscription(this.dbxListViewWrapper.loadMore.subscribe(() => {
|
|
4432
|
+
this.dbxFirebaseCollectionStoreDirective.next();
|
|
4433
|
+
}));
|
|
4434
|
+
}
|
|
4464
4435
|
}
|
|
4465
4436
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseCollectionListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4466
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseCollectionListDirective, isStandalone: true, selector: "[dbxFirebaseCollectionList]",
|
|
4437
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseCollectionListDirective, isStandalone: true, selector: "[dbxFirebaseCollectionList]", ngImport: i0 });
|
|
4467
4438
|
}
|
|
4468
4439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseCollectionListDirective, decorators: [{
|
|
4469
4440
|
type: Directive,
|
|
@@ -4509,15 +4480,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4509
4480
|
/**
|
|
4510
4481
|
* Used for providing an id from the twoWayFlatKey$ from a DbxFirebaseDocumentStoreTwoWayKeyProvider.
|
|
4511
4482
|
*/
|
|
4512
|
-
class DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective
|
|
4483
|
+
class DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective {
|
|
4513
4484
|
dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective, { host: true });
|
|
4514
4485
|
dbxFirebaseDocumentStoreTwoWayKeyProvider = inject(DbxFirebaseDocumentStoreTwoWayKeyProvider, { skipSelf: true, host: false });
|
|
4515
4486
|
constructor() {
|
|
4516
|
-
|
|
4517
|
-
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseDocumentStoreTwoWayKeyProvider.twoWayFlatKey$);
|
|
4487
|
+
cleanSubscription(this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseDocumentStoreTwoWayKeyProvider.twoWayFlatKey$));
|
|
4518
4488
|
}
|
|
4519
4489
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4520
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, isStandalone: true, selector: "[dbxFirebaseDocumentStoreIdFromTwoWayModelKey]",
|
|
4490
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, isStandalone: true, selector: "[dbxFirebaseDocumentStoreIdFromTwoWayModelKey]", ngImport: i0 });
|
|
4521
4491
|
}
|
|
4522
4492
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, decorators: [{
|
|
4523
4493
|
type: Directive,
|
|
@@ -5139,17 +5109,12 @@ class AbstractSingleItemDbxFirebaseDocument extends AbstractDbxFirebaseDocumentW
|
|
|
5139
5109
|
class DbxFirebaseCollectionWithParentStoreDirective extends DbxFirebaseCollectionStoreDirective {
|
|
5140
5110
|
sourceMode = model(undefined);
|
|
5141
5111
|
_sourceMode$ = toObservable(this.sourceMode).pipe(skipInitialMaybe());
|
|
5142
|
-
_parentSourceModeSub = new SubscriptionObject();
|
|
5143
5112
|
constructor(store) {
|
|
5144
5113
|
super(store);
|
|
5145
5114
|
// sync inputs to store any time the store changes
|
|
5146
|
-
this.
|
|
5115
|
+
cleanSubscription(this.store$.subscribe((x) => {
|
|
5147
5116
|
x.setSourceMode(this._sourceMode$);
|
|
5148
|
-
});
|
|
5149
|
-
}
|
|
5150
|
-
ngOnDestroy() {
|
|
5151
|
-
super.ngOnDestroy();
|
|
5152
|
-
this._parentSourceModeSub.destroy();
|
|
5117
|
+
}));
|
|
5153
5118
|
}
|
|
5154
5119
|
// MARK: Inputs
|
|
5155
5120
|
setSourceMode(sourceMode) {
|
|
@@ -5239,9 +5204,6 @@ class AbstractSystemStateDocumentStoreAccessor {
|
|
|
5239
5204
|
constructor(type) {
|
|
5240
5205
|
this.systemStateDocumentStore.setId(type);
|
|
5241
5206
|
}
|
|
5242
|
-
ngOnDestroy() {
|
|
5243
|
-
this.systemStateDocumentStore.ngOnDestroy();
|
|
5244
|
-
}
|
|
5245
5207
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AbstractSystemStateDocumentStoreAccessor, deps: [{ token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5246
5208
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AbstractSystemStateDocumentStoreAccessor });
|
|
5247
5209
|
}
|
|
@@ -6849,13 +6811,9 @@ class StorageFileUploadFilesError extends BaseError {
|
|
|
6849
6811
|
* Connects a DbxFirebaseStorageFileUploadStore to a DbxActionContext, and handles the upload action.
|
|
6850
6812
|
*/
|
|
6851
6813
|
class DbxFirebaseStorageFileUploadActionHandlerDirective {
|
|
6852
|
-
_triggerSub = new SubscriptionObject();
|
|
6853
|
-
_readySub = new SubscriptionObject();
|
|
6854
|
-
_isWorkingSub = new SubscriptionObject();
|
|
6855
|
-
_progressSub = new SubscriptionObject();
|
|
6856
6814
|
source = inject((DbxActionContextStoreSourceInstance));
|
|
6857
6815
|
uploadStore = inject(DbxFirebaseStorageFileUploadStore);
|
|
6858
|
-
_dbxActionHandlerInstance = new DbxActionHandlerInstance(this.source);
|
|
6816
|
+
_dbxActionHandlerInstance = clean(new DbxActionHandlerInstance(this.source));
|
|
6859
6817
|
/**
|
|
6860
6818
|
* If true, the action will be triggered when files are set.
|
|
6861
6819
|
*
|
|
@@ -6914,10 +6872,10 @@ class DbxFirebaseStorageFileUploadActionHandlerDirective {
|
|
|
6914
6872
|
});
|
|
6915
6873
|
files$ = this.uploadStore.files$;
|
|
6916
6874
|
uploadHandler$ = toObservable(this.uploadHandler);
|
|
6917
|
-
|
|
6875
|
+
constructor() {
|
|
6918
6876
|
this._dbxActionHandlerInstance.init();
|
|
6919
6877
|
// trigger the action if files are available
|
|
6920
|
-
this.
|
|
6878
|
+
cleanSubscription(this.triggerOnFiles$
|
|
6921
6879
|
.pipe(switchMap((triggerOnFiles) => {
|
|
6922
6880
|
if (triggerOnFiles) {
|
|
6923
6881
|
return this.files$.pipe(map((x) => x?.length));
|
|
@@ -6930,18 +6888,15 @@ class DbxFirebaseStorageFileUploadActionHandlerDirective {
|
|
|
6930
6888
|
if (canTrigger) {
|
|
6931
6889
|
this.source.trigger();
|
|
6932
6890
|
}
|
|
6933
|
-
});
|
|
6891
|
+
}));
|
|
6934
6892
|
// ready the source with files after trigger is called and files are available
|
|
6935
|
-
this.
|
|
6893
|
+
cleanSubscription(this.files$.pipe(switchMap((files) => this.source.triggered$.pipe(map(() => files)))).subscribe((files) => {
|
|
6936
6894
|
this.source.readyValue(files);
|
|
6937
|
-
});
|
|
6895
|
+
}));
|
|
6938
6896
|
// sync isWorking
|
|
6939
|
-
this.
|
|
6897
|
+
cleanSubscription(this.uploadStore.setIsUploadHandlerWorking(this.source.isWorking$));
|
|
6940
6898
|
// sync progress amount
|
|
6941
|
-
this.
|
|
6942
|
-
}
|
|
6943
|
-
ngOnDestroy() {
|
|
6944
|
-
this._dbxActionHandlerInstance.destroy();
|
|
6899
|
+
this.source.setWorkProgress(this.uploadStore.latestProgressEvent$.pipe(throttleTime(100, undefined, { leading: true, trailing: true }), map((x) => x?.overallProgress), distinctUntilChanged()));
|
|
6945
6900
|
}
|
|
6946
6901
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseStorageFileUploadActionHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6947
6902
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseStorageFileUploadActionHandlerDirective, isStandalone: true, selector: "[dbxFirebaseStorageFileUploadActionHandler]", inputs: { triggerOnFiles: { classPropertyName: "triggerOnFiles", publicName: "triggerOnFiles", isSignal: true, isRequired: false, transformFunction: null }, cancelUploadsOnUploadError: { classPropertyName: "cancelUploadsOnUploadError", publicName: "cancelUploadsOnUploadError", isSignal: true, isRequired: false, transformFunction: null }, actionFailureOnUploadError: { classPropertyName: "actionFailureOnUploadError", publicName: "actionFailureOnUploadError", isSignal: true, isRequired: false, transformFunction: null }, uploadHandler: { classPropertyName: "uploadHandler", publicName: "dbxFirebaseStorageFileUploadActionHandler", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
@@ -6952,7 +6907,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
6952
6907
|
selector: '[dbxFirebaseStorageFileUploadActionHandler]',
|
|
6953
6908
|
standalone: true
|
|
6954
6909
|
}]
|
|
6955
|
-
}] });
|
|
6910
|
+
}], ctorParameters: () => [] });
|
|
6956
6911
|
|
|
6957
6912
|
class StorageFileCollectionStore extends AbstractDbxFirebaseCollectionStore {
|
|
6958
6913
|
storageFileFunctions = inject(StorageFileFunctions);
|
|
@@ -7054,22 +7009,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7054
7009
|
*
|
|
7055
7010
|
* Use with a DbxAction instance.
|
|
7056
7011
|
*/
|
|
7057
|
-
class DbxFirebaseStorageFileUploadInitializeDocumentDirective
|
|
7012
|
+
class DbxFirebaseStorageFileUploadInitializeDocumentDirective {
|
|
7058
7013
|
uploadStore = inject(DbxFirebaseStorageFileUploadStore);
|
|
7059
7014
|
storageFileDocumentStore = inject(StorageFileDocumentStore);
|
|
7060
7015
|
initializeWithExpediteProcessing = input();
|
|
7061
7016
|
source = inject((DbxActionContextStoreSourceInstance), { host: true });
|
|
7062
|
-
_dbxActionHandlerInstance = new DbxActionHandlerInstance(this.source);
|
|
7017
|
+
_dbxActionHandlerInstance = clean(new DbxActionHandlerInstance(this.source));
|
|
7063
7018
|
constructor() {
|
|
7064
|
-
super();
|
|
7065
7019
|
// set the trigger
|
|
7066
|
-
this.
|
|
7020
|
+
cleanSubscription(this.uploadStore.uploadResult$.subscribe(async (result) => {
|
|
7067
7021
|
const successFileResult = result.successFileResults.find((x) => x.fileRef != null);
|
|
7068
7022
|
const fileRef = successFileResult?.fileRef;
|
|
7069
7023
|
if (fileRef) {
|
|
7070
7024
|
this.source.triggerWithValue(fileRef);
|
|
7071
7025
|
}
|
|
7072
|
-
});
|
|
7026
|
+
}));
|
|
7073
7027
|
// set the handler function
|
|
7074
7028
|
this._dbxActionHandlerInstance.setHandlerFunction((fileRef, context) => {
|
|
7075
7029
|
context.startWorkingWithLoadingStateObservable(this.storageFileDocumentStore.initializeStorageFileFromUpload({
|
|
@@ -7080,12 +7034,8 @@ class DbxFirebaseStorageFileUploadInitializeDocumentDirective extends AbstractSu
|
|
|
7080
7034
|
});
|
|
7081
7035
|
this._dbxActionHandlerInstance.init();
|
|
7082
7036
|
}
|
|
7083
|
-
ngOnDestroy() {
|
|
7084
|
-
super.ngOnDestroy();
|
|
7085
|
-
this._dbxActionHandlerInstance.destroy();
|
|
7086
|
-
}
|
|
7087
7037
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseStorageFileUploadInitializeDocumentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7088
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseStorageFileUploadInitializeDocumentDirective, isStandalone: true, selector: "[dbxFirebaseStorageFileUploadInitializeDocument]", inputs: { initializeWithExpediteProcessing: { classPropertyName: "initializeWithExpediteProcessing", publicName: "initializeWithExpediteProcessing", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["dbxFirebaseStorageFileUploadInitializeDocument"],
|
|
7038
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseStorageFileUploadInitializeDocumentDirective, isStandalone: true, selector: "[dbxFirebaseStorageFileUploadInitializeDocument]", inputs: { initializeWithExpediteProcessing: { classPropertyName: "initializeWithExpediteProcessing", publicName: "initializeWithExpediteProcessing", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["dbxFirebaseStorageFileUploadInitializeDocument"], ngImport: i0 });
|
|
7089
7039
|
}
|
|
7090
7040
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseStorageFileUploadInitializeDocumentDirective, decorators: [{
|
|
7091
7041
|
type: Directive,
|
|
@@ -7100,20 +7050,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7100
7050
|
* Directive that provides a DbxFirebaseStorageFileUploadStore, and sync's the inputs to the store.
|
|
7101
7051
|
*/
|
|
7102
7052
|
class DbxFirebaseStorageFileUploadStoreDirective {
|
|
7103
|
-
_allowedSub = new SubscriptionObject();
|
|
7104
|
-
_multiSub = new SubscriptionObject();
|
|
7105
7053
|
uploadStore = inject(DbxFirebaseStorageFileUploadStore);
|
|
7106
7054
|
multipleUpload = input();
|
|
7107
7055
|
fileTypesAccepted = input();
|
|
7108
7056
|
fileTypesAccepted$ = toObservable(this.fileTypesAccepted).pipe(skipAllInitialMaybe(), shareReplay(1));
|
|
7109
7057
|
isMultiUploadAllowed$ = toObservable(this.multipleUpload).pipe(skipAllInitialMaybe(), shareReplay(1));
|
|
7110
7058
|
constructor() {
|
|
7111
|
-
this.
|
|
7112
|
-
this.
|
|
7113
|
-
}
|
|
7114
|
-
ngOnDestroy() {
|
|
7115
|
-
this._allowedSub.destroy();
|
|
7116
|
-
this._multiSub.destroy();
|
|
7059
|
+
cleanSubscription(this.fileTypesAccepted$.subscribe((x) => this.uploadStore.setFileTypesAccepted(x)));
|
|
7060
|
+
cleanSubscription(this.isMultiUploadAllowed$.subscribe((x) => this.uploadStore.setIsMultiUploadAllowed(x)));
|
|
7117
7061
|
}
|
|
7118
7062
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseStorageFileUploadStoreDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7119
7063
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseStorageFileUploadStoreDirective, isStandalone: true, selector: "[dbxFirebaseStorageFileUploadStore]", inputs: { multipleUpload: { classPropertyName: "multipleUpload", publicName: "multipleUpload", isSignal: true, isRequired: false, transformFunction: null }, fileTypesAccepted: { classPropertyName: "fileTypesAccepted", publicName: "fileTypesAccepted", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DbxFirebaseStorageFileUploadStore], exportAs: ["dbxFirebaseStorageFileUploadStore"], ngImport: i0 });
|
|
@@ -7132,20 +7076,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7132
7076
|
* Directive that syncs a DbxFirebaseStorageFileUploadStore's configuration to a DbxFileUploadComponent.
|
|
7133
7077
|
*/
|
|
7134
7078
|
class DbxFirebaseStorageFileUploadSyncDirective {
|
|
7135
|
-
_allowedSub = new SubscriptionObject();
|
|
7136
|
-
_multiSub = new SubscriptionObject();
|
|
7137
|
-
_filesSub = new SubscriptionObject();
|
|
7138
7079
|
uploadStore = inject(DbxFirebaseStorageFileUploadStore);
|
|
7139
7080
|
uploadComponent = inject(DbxFileUploadComponent);
|
|
7140
7081
|
constructor() {
|
|
7141
|
-
this.
|
|
7142
|
-
this.
|
|
7143
|
-
this.
|
|
7144
|
-
}
|
|
7145
|
-
ngOnDestroy() {
|
|
7146
|
-
this._allowedSub.destroy();
|
|
7147
|
-
this._multiSub.destroy();
|
|
7148
|
-
this._filesSub.destroy();
|
|
7082
|
+
cleanSubscription(this.uploadStore.fileTypesAllowed$.subscribe((x) => this.uploadComponent.setAccept(x)));
|
|
7083
|
+
cleanSubscription(this.uploadStore.isMultiUploadAllowed$.subscribe((x) => this.uploadComponent.setMultiple(x)));
|
|
7084
|
+
cleanSubscription(this.uploadComponent.filesChanged.subscribe((files) => this.uploadStore.setFiles(files.matchResult.accepted)));
|
|
7149
7085
|
}
|
|
7150
7086
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseStorageFileUploadSyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7151
7087
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DbxFirebaseStorageFileUploadSyncDirective, isStandalone: true, selector: "[dbxFirebaseStorageFileUploadSync]", exportAs: ["dbxFirebaseStorageFileUploadSync"], ngImport: i0 });
|