@dereekb/dbx-firebase 12.6.18 → 12.6.20
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/model/modules/model/entities/model.entities.entity.component.mjs +6 -3
- package/esm2022/lib/model/modules/model/entities/model.entities.mjs +1 -1
- package/esm2022/lib/model/modules/store/store.document.context.store.link.mjs +2 -2
- package/esm2022/lib/model/modules/store/store.document.directive.mjs +8 -2
- package/esm2022/lib/model/modules/store/store.document.mjs +3 -1
- package/esm2022/lib/model/modules/store/store.mjs +1 -1
- package/fesm2022/dereekb-dbx-firebase.mjs +15 -4
- package/fesm2022/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/model/modules/model/entities/model.entities.d.ts +4 -0
- package/lib/model/modules/model/entities/model.entities.entity.component.d.ts +3 -0
- package/lib/model/modules/store/store.d.ts +8 -0
- package/lib/model/modules/store/store.document.context.store.link.d.ts +1 -1
- package/lib/model/modules/store/store.document.d.ts +3 -0
- package/lib/model/modules/store/store.document.directive.d.ts +4 -1
- package/package.json +1 -1
|
@@ -3650,6 +3650,8 @@ class DbxFirebaseModelEntitiesEntityComponent {
|
|
|
3650
3650
|
}), distinctUntilChanged(), shareReplay(1));
|
|
3651
3651
|
modelIdentity$ = this.entity$.pipe(map((x) => x.modelIdentity), distinctUntilChanged(), shareReplay(1));
|
|
3652
3652
|
store$ = this.entity$.pipe(map((x) => x.store), filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
3653
|
+
storeName$ = this.store$.pipe(switchMap((x) => x.storeName$), shareReplay(1));
|
|
3654
|
+
displayName$ = combineLatest([this.storeName$, this.entity$]).pipe(map(([storeName, entity]) => entity.name ?? storeName), distinctUntilChanged(), shareReplay(1));
|
|
3653
3655
|
loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));
|
|
3654
3656
|
currentData$ = this.store$.pipe(switchMap((x) => x.currentData$), shareReplay(1));
|
|
3655
3657
|
currentWidgetEntry$ = this.modelIdentity$.pipe(map((modelIdentity) => this.entitiesWidgetService.getWidgetEntry(modelIdentity)), distinctUntilChanged(), shareReplay(1));
|
|
@@ -3675,6 +3677,7 @@ class DbxFirebaseModelEntitiesEntityComponent {
|
|
|
3675
3677
|
}), shareReplay(1));
|
|
3676
3678
|
widgetInjectionConfig$ = combineLatest([this.currentWidgetEntry$, this.currentEntityWithStore$]).pipe(map(([entry, entity]) => (entity ? this.widgetInjectionConfigFactory(entry, entity) : null)), shareReplay(1));
|
|
3677
3679
|
hasTypeInfoSignal = toSignal(this.hasTypeInfo$);
|
|
3680
|
+
displayNameSignal = toSignal(this.displayName$);
|
|
3678
3681
|
displayInfoSignal = toSignal(this.displayInfo$);
|
|
3679
3682
|
modelIdentitySignal = toSignal(this.modelIdentity$);
|
|
3680
3683
|
modelTypeSignal = computed(() => this.modelIdentitySignal()?.modelType);
|
|
@@ -3687,11 +3690,11 @@ class DbxFirebaseModelEntitiesEntityComponent {
|
|
|
3687
3690
|
this.loadingContext.destroy();
|
|
3688
3691
|
}
|
|
3689
3692
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesEntityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3690
|
-
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 class=\"dbx-hint dbx-small\">{{ modelTypeSignal() }}</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 });
|
|
3693
|
+
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 });
|
|
3691
3694
|
}
|
|
3692
3695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesEntityComponent, decorators: [{
|
|
3693
3696
|
type: Component,
|
|
3694
|
-
args: [{ selector: 'dbx-firebase-model-entities-entity', imports: [DbxInjectionComponent, DbxLoadingComponent, MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelDescription, MatExpansionPanelContent, MatIcon, AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, 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 class=\"dbx-hint dbx-small\">{{ modelTypeSignal() }}</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" }]
|
|
3697
|
+
args: [{ selector: 'dbx-firebase-model-entities-entity', imports: [DbxInjectionComponent, DbxLoadingComponent, MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelDescription, MatExpansionPanelContent, MatIcon, AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, 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" }]
|
|
3695
3698
|
}] });
|
|
3696
3699
|
|
|
3697
3700
|
class DbxFirebaseModelEntitiesComponent {
|
|
@@ -4108,11 +4111,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4108
4111
|
* Abstract directive that contains a DbxFirebaseDocumentStore and provides an interface for communicating with other directives.
|
|
4109
4112
|
*/
|
|
4110
4113
|
class DbxFirebaseDocumentStoreDirective {
|
|
4114
|
+
storeName = model(undefined);
|
|
4111
4115
|
documentId = model(undefined);
|
|
4112
4116
|
key = model(undefined);
|
|
4113
4117
|
flatKey = model(undefined);
|
|
4114
4118
|
ref = model(undefined);
|
|
4115
4119
|
streamMode = model(FirestoreAccessorStreamMode.STREAM);
|
|
4120
|
+
_storeName$ = toObservable(this.storeName).pipe(skipInitialMaybe());
|
|
4116
4121
|
_documentId$ = toObservable(this.documentId).pipe(skipInitialMaybe());
|
|
4117
4122
|
_key$ = toObservable(this.key).pipe(skipInitialMaybe());
|
|
4118
4123
|
_flatKey$ = toObservable(this.flatKey).pipe(skipInitialMaybe());
|
|
@@ -4138,6 +4143,7 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4138
4143
|
// sync inputs to store any time the store changes
|
|
4139
4144
|
this._storeSub.subscription = this._store.subscribe((x) => {
|
|
4140
4145
|
if (x) {
|
|
4146
|
+
x.setStoreName(this._storeName$);
|
|
4141
4147
|
x.setId(this._documentId$);
|
|
4142
4148
|
x.setKey(this._key$);
|
|
4143
4149
|
x.setFlatKey(this._flatKey$);
|
|
@@ -4154,6 +4160,9 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4154
4160
|
return this._store.value;
|
|
4155
4161
|
}
|
|
4156
4162
|
// MARK: Setters
|
|
4163
|
+
setStoreName(storeName) {
|
|
4164
|
+
this.storeName.set(storeName);
|
|
4165
|
+
}
|
|
4157
4166
|
setDocumentId(documentId) {
|
|
4158
4167
|
this.documentId.set(documentId);
|
|
4159
4168
|
}
|
|
@@ -4185,7 +4194,7 @@ class DbxFirebaseDocumentStoreDirective {
|
|
|
4185
4194
|
return keyFromParams.subscribe((x) => this.setFlatKey(x));
|
|
4186
4195
|
}
|
|
4187
4196
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
4188
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseDocumentStoreDirective, inputs: { documentId: { classPropertyName: "documentId", publicName: "documentId", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, flatKey: { classPropertyName: "flatKey", publicName: "flatKey", isSignal: true, isRequired: false, transformFunction: null }, ref: { classPropertyName: "ref", publicName: "ref", isSignal: true, isRequired: false, transformFunction: null }, streamMode: { classPropertyName: "streamMode", publicName: "streamMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { documentId: "documentIdChange", key: "keyChange", flatKey: "flatKeyChange", ref: "refChange", streamMode: "streamModeChange" }, ngImport: i0 });
|
|
4197
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: DbxFirebaseDocumentStoreDirective, inputs: { storeName: { classPropertyName: "storeName", publicName: "storeName", isSignal: true, isRequired: false, transformFunction: null }, documentId: { classPropertyName: "documentId", publicName: "documentId", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, flatKey: { classPropertyName: "flatKey", publicName: "flatKey", isSignal: true, isRequired: false, transformFunction: null }, ref: { classPropertyName: "ref", publicName: "ref", isSignal: true, isRequired: false, transformFunction: null }, streamMode: { classPropertyName: "streamMode", publicName: "streamMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { storeName: "storeNameChange", documentId: "documentIdChange", key: "keyChange", flatKey: "flatKeyChange", ref: "refChange", streamMode: "streamModeChange" }, ngImport: i0 });
|
|
4189
4198
|
}
|
|
4190
4199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, decorators: [{
|
|
4191
4200
|
type: Directive
|
|
@@ -4655,7 +4664,7 @@ function provideDbxFirebaseDocumentStoreContextStore() {
|
|
|
4655
4664
|
/**
|
|
4656
4665
|
* Links a DbxFirebaseDocumentStore to parent DbxFirebaseDocumentStoreContextStore instances.
|
|
4657
4666
|
*
|
|
4658
|
-
* This should be called in an
|
|
4667
|
+
* This should be called in an Angular injection context.
|
|
4659
4668
|
*/
|
|
4660
4669
|
function linkDocumentStoreToParentContextStores(store) {
|
|
4661
4670
|
const contextStores = inject(DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN, { optional: true });
|
|
@@ -4681,6 +4690,7 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
|
4681
4690
|
}
|
|
4682
4691
|
// MARK: Effects
|
|
4683
4692
|
// MARK: Accessors
|
|
4693
|
+
storeName$ = this.state$.pipe(map((x) => x.storeName), distinctUntilChanged(), shareReplay(1));
|
|
4684
4694
|
currentFirestoreCollectionLike$ = this.state$.pipe(map((x) => x.firestoreCollection ?? x.firestoreCollectionLike), distinctUntilChanged(), shareReplay(1));
|
|
4685
4695
|
currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
4686
4696
|
firestoreCollectionLike$ = this.currentFirestoreCollectionLike$.pipe(filterMaybe());
|
|
@@ -4776,6 +4786,7 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
|
4776
4786
|
doesNotExist$ = this.exists$.pipe(map((x) => !x), shareReplay(1));
|
|
4777
4787
|
modelIdentity$ = this.firestoreCollectionLike$.pipe(map((x) => x.modelIdentity), shareReplay(1));
|
|
4778
4788
|
// MARK: State Changes
|
|
4789
|
+
setStoreName = this.updater((state, storeName) => ({ ...state, storeName }));
|
|
4779
4790
|
setId = this.updater((state, id) => (id ? { ...state, id, key: undefined, ref: undefined } : { ...state, id }));
|
|
4780
4791
|
setKey = this.updater((state, key) => (key ? { ...state, key, id: undefined, ref: undefined } : { ...state, key }));
|
|
4781
4792
|
setFlatKey = this.updater((state, key) => (key ? { ...state, key: inferKeyFromTwoWayFlatFirestoreModelKey(key), id: undefined, ref: undefined } : { ...state, key }));
|