@processpuzzle/base-entity 0.3.4 → 0.3.6
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.
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { signalStoreFeature, withState, withMethods, patchState, withHooks, withComputed } from '@ngrx/signals';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { inject, input, Component, computed, effect, Inject, Directive, ViewChild, signal, Injectable, untracked, InjectionToken } from '@angular/core';
|
|
3
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { CommonModule, NgIf, NgStyle, NgClass, NgForOf } from '@angular/common';
|
|
6
|
+
import { Router, ActivatedRoute, RouterOutlet, ROUTER_OUTLET_DATA } from '@angular/router';
|
|
7
|
+
import { MatTabNav, MatTabLink, MatTabNavPanel } from '@angular/material/tabs';
|
|
8
|
+
import { MatToolbar } from '@angular/material/toolbar';
|
|
9
|
+
import { MatIcon } from '@angular/material/icon';
|
|
10
|
+
import { MatButton } from '@angular/material/button';
|
|
11
|
+
import * as i3 from '@angular/material/form-field';
|
|
12
|
+
import { MatFormField, MatFormFieldModule, MatLabel, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
13
|
+
import * as i4 from '@angular/material/input';
|
|
14
|
+
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
15
|
+
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
|
16
|
+
import { signalStoreFeature, withState, withMethods, patchState, withHooks, withComputed } from '@ngrx/signals';
|
|
17
|
+
import { LayoutService, RUNTIME_CONFIGURATION } from '@processpuzzle/util';
|
|
18
|
+
import { __decorate, __param } from 'tslib';
|
|
19
|
+
import { map, pipe, switchMap, tap, from, of } from 'rxjs';
|
|
20
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
21
|
+
import { buildUrl } from 'build-url-ts';
|
|
4
22
|
import * as i1$1 from '@angular/forms';
|
|
5
23
|
import { ReactiveFormsModule, FormsModule, FormControl, Validators, FormBuilder } from '@angular/forms';
|
|
6
|
-
import { ROUTER_OUTLET_DATA, Router, ActivatedRoute } from '@angular/router';
|
|
7
24
|
import { MatCard, MatCardContent, MatCardActions } from '@angular/material/card';
|
|
8
|
-
import * as i3 from '@angular/material/form-field';
|
|
9
|
-
import { MatFormFieldModule, MatLabel, MatFormField, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
10
|
-
import { MatButton } from '@angular/material/button';
|
|
11
|
-
import * as i1 from '@angular/common';
|
|
12
|
-
import { NgIf, NgStyle, CommonModule, NgClass, NgForOf } from '@angular/common';
|
|
13
25
|
import * as i5 from '@angular/material/datepicker';
|
|
14
26
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
15
|
-
import * as i4 from '@angular/material/input';
|
|
16
|
-
import { MatInputModule, MatInput } from '@angular/material/input';
|
|
17
|
-
import { MatIcon } from '@angular/material/icon';
|
|
18
27
|
import * as i2 from '@angular/material/select';
|
|
19
28
|
import { MatSelectModule } from '@angular/material/select';
|
|
20
29
|
import { MatCheckbox } from '@angular/material/checkbox';
|
|
30
|
+
import { NGXLogger } from 'ngx-logging-kit';
|
|
21
31
|
import { MatTableDataSource, MatTable, MatHeaderCell, MatHeaderRow, MatRow, MatCell, MatColumnDef, MatHeaderCellDef, MatCellDef, MatHeaderRowDef, MatRowDef } from '@angular/material/table';
|
|
22
32
|
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
23
33
|
import { MatPaginator } from '@angular/material/paginator';
|
|
@@ -25,8 +35,6 @@ import { MatProgressBar } from '@angular/material/progress-bar';
|
|
|
25
35
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
26
36
|
import { tapResponse } from '@ngrx/operators';
|
|
27
37
|
import { rxMethod } from '@ngrx/signals/rxjs-interop';
|
|
28
|
-
import { pipe, switchMap, tap, from, of, map } from 'rxjs';
|
|
29
|
-
import { __decorate, __param } from 'tslib';
|
|
30
38
|
import { Firestore, collection, doc, deleteDoc, getDoc, setDoc, orderBy, where, query, limit, getDocs, updateDoc } from '@angular/fire/firestore';
|
|
31
39
|
import 'reflect-metadata';
|
|
32
40
|
|
|
@@ -54,6 +62,271 @@ class AbstractAttrDescriptor {
|
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
|
|
65
|
+
var BaseUrlSegments;
|
|
66
|
+
(function (BaseUrlSegments) {
|
|
67
|
+
BaseUrlSegments["DetailsForm"] = "details";
|
|
68
|
+
BaseUrlSegments["Feed"] = "feed";
|
|
69
|
+
BaseUrlSegments["ListForm"] = "list";
|
|
70
|
+
BaseUrlSegments["NewEntity"] = "new";
|
|
71
|
+
BaseUrlSegments["UnknownEntity"] = "unknown";
|
|
72
|
+
})(BaseUrlSegments || (BaseUrlSegments = {}));
|
|
73
|
+
|
|
74
|
+
var RouteSegments;
|
|
75
|
+
(function (RouteSegments) {
|
|
76
|
+
RouteSegments["LIST_ROUTE"] = "LIST_ROUTE";
|
|
77
|
+
RouteSegments["DETAILS_ROUTE"] = "DETAILS_ROUTE";
|
|
78
|
+
})(RouteSegments || (RouteSegments = {}));
|
|
79
|
+
const INITIAL_NAVIGATION_STATE = {
|
|
80
|
+
activeRouteSegment: RouteSegments.LIST_ROUTE,
|
|
81
|
+
entityName: '',
|
|
82
|
+
navigationError: undefined,
|
|
83
|
+
navigateTo: '',
|
|
84
|
+
returnTo: '',
|
|
85
|
+
};
|
|
86
|
+
function snakeCaseName(entityName) {
|
|
87
|
+
return entityName
|
|
88
|
+
.split(/(?=[A-Z])/)
|
|
89
|
+
.join('-')
|
|
90
|
+
.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
function BaseFormNavigatorStore(entityName) {
|
|
93
|
+
return signalStoreFeature(withState(INITIAL_NAVIGATION_STATE), withMethods((store, router = inject(Router), route = inject(ActivatedRoute)) => {
|
|
94
|
+
function determineActiveRouteSegment() {
|
|
95
|
+
const currentUrl = Reflect.get(route, '_routerState').snapshot.url;
|
|
96
|
+
if (currentUrl.endsWith(BaseUrlSegments.ListForm)) {
|
|
97
|
+
patchState(store, { activeRouteSegment: RouteSegments.LIST_ROUTE });
|
|
98
|
+
}
|
|
99
|
+
else if (currentUrl.endsWith(BaseUrlSegments.DetailsForm)) {
|
|
100
|
+
patchState(store, { activeRouteSegment: RouteSegments.DETAILS_ROUTE });
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
patchState(store, { activeRouteSegment: undefined });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function determineBaseUrl() {
|
|
107
|
+
determineActiveRouteSegment();
|
|
108
|
+
const currentUrl = determineCurrentUrl();
|
|
109
|
+
return store.activeRouteSegment() === RouteSegments.DETAILS_ROUTE ? levelUpUrl(levelUpUrl(levelUpUrl(currentUrl))) : levelUpUrl(levelUpUrl(currentUrl));
|
|
110
|
+
}
|
|
111
|
+
function determineCurrentUrl() {
|
|
112
|
+
return Reflect.get(route, '_routerState').snapshot.url;
|
|
113
|
+
}
|
|
114
|
+
function levelUpUrl(currentUrl) {
|
|
115
|
+
return currentUrl.substring(0, currentUrl.lastIndexOf('/'));
|
|
116
|
+
}
|
|
117
|
+
async function navigateBack(defaultUrl) {
|
|
118
|
+
const goTo = store.returnTo() ? store.returnTo() : defaultUrl;
|
|
119
|
+
patchState(store, { returnTo: '' });
|
|
120
|
+
if (goTo) {
|
|
121
|
+
await router
|
|
122
|
+
.navigateByUrl(goTo)
|
|
123
|
+
.then()
|
|
124
|
+
.catch((error) => patchState(store, { navigationError: error.message }));
|
|
125
|
+
}
|
|
126
|
+
else
|
|
127
|
+
await navigateToList();
|
|
128
|
+
}
|
|
129
|
+
async function navigateToDetails(id, returnTo) {
|
|
130
|
+
if (store.activeRouteSegment() != RouteSegments.DETAILS_ROUTE) {
|
|
131
|
+
const snakeCaseEntityName = snakeCaseName(entityName);
|
|
132
|
+
const baseUrl = determineBaseUrl();
|
|
133
|
+
const detailsFormPath = baseUrl + '/' + snakeCaseEntityName + '/' + id + '/details';
|
|
134
|
+
await navigateToUrl(detailsFormPath, returnTo);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async function navigateToList(returnTo) {
|
|
138
|
+
const snakeCaseEntityName = snakeCaseName(entityName);
|
|
139
|
+
const baseUrl = determineBaseUrl();
|
|
140
|
+
const goToUrl = baseUrl + '/' + snakeCaseEntityName + '/list';
|
|
141
|
+
if (store.activeRouteSegment() != RouteSegments.LIST_ROUTE) {
|
|
142
|
+
await navigateToUrl(goToUrl, returnTo);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async function navigateToRelated(relatedTypeName, id, returnTo) {
|
|
146
|
+
const snakeCaseEntityName = snakeCaseName(relatedTypeName);
|
|
147
|
+
const baseUrl = determineBaseUrl();
|
|
148
|
+
const detailsFormPath = baseUrl + '/' + snakeCaseEntityName + '/' + id + '/details';
|
|
149
|
+
await navigateToUrl(detailsFormPath, returnTo);
|
|
150
|
+
}
|
|
151
|
+
async function navigateToUrl(url, returnTo) {
|
|
152
|
+
if (returnTo) {
|
|
153
|
+
patchState(store, { returnTo });
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
patchState(store, { returnTo: router.url });
|
|
157
|
+
}
|
|
158
|
+
patchState(store, { navigateTo: url });
|
|
159
|
+
await router
|
|
160
|
+
.navigateByUrl(url)
|
|
161
|
+
.then(() => determineActiveRouteSegment())
|
|
162
|
+
.catch((error) => patchState(store, { navigationError: error.message }));
|
|
163
|
+
}
|
|
164
|
+
return { determineCurrentUrl, determineActiveRouteSegment, navigateBack, navigateToDetails, navigateToList, navigateToRelated, navigateToUrl };
|
|
165
|
+
}), withHooks((store) => ({
|
|
166
|
+
onInit: () => {
|
|
167
|
+
store.determineActiveRouteSegment();
|
|
168
|
+
},
|
|
169
|
+
})));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
class BaseEntityToolbarComponent {
|
|
173
|
+
baseEntityListOptions = input.required(...(ngDevMode ? [{ debugName: "baseEntityListOptions" }] : /* istanbul ignore next */ []));
|
|
174
|
+
layoutService = inject(LayoutService);
|
|
175
|
+
store;
|
|
176
|
+
// region Angular lifecycle hooks
|
|
177
|
+
ngOnInit() {
|
|
178
|
+
this.store = this.baseEntityListOptions().store;
|
|
179
|
+
}
|
|
180
|
+
// endregion
|
|
181
|
+
// event handling methods
|
|
182
|
+
onAddEntity() {
|
|
183
|
+
this.store.navigateToDetails(BaseUrlSegments.NewEntity);
|
|
184
|
+
}
|
|
185
|
+
onDeleteEntities() {
|
|
186
|
+
this.store.selectedEntities().forEach((entity) => this.store.delete(entity.id));
|
|
187
|
+
}
|
|
188
|
+
onDoFilter($event) {
|
|
189
|
+
const filterValue = $event.target.value;
|
|
190
|
+
this.store.doFilter(filterValue);
|
|
191
|
+
}
|
|
192
|
+
// endregion
|
|
193
|
+
// public queries and mutators
|
|
194
|
+
isSmallDevice() {
|
|
195
|
+
return this.layoutService.isSmallDevice();
|
|
196
|
+
}
|
|
197
|
+
// endregion
|
|
198
|
+
// protected, private helper methods
|
|
199
|
+
RouteSegments = RouteSegments;
|
|
200
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
201
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: BaseEntityToolbarComponent, isStandalone: true, selector: "base-entity-toolbar", inputs: { baseEntityListOptions: { classPropertyName: "baseEntityListOptions", publicName: "baseEntityListOptions", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-toolbar *ngIf=\"store.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n <mat-form-field>\n <input test-id=\"filter-input\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\" placeholder=\"Filter\">\n </mat-form-field>\n </div>\n <span class=\"toolbar-spacer\"></span>\n @if(isSmallDevice()) {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"menu-button\" mat-button [matMenuTriggerFor]=\"beforeMenu\"><mat-icon>menu</mat-icon> Choose action</button>\n <mat-menu test-id=\"menu\" #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button test-id=\"add\" mat-menu-item (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button test-id=\"delete\" mat-menu-item [disabled]=\"store.selectedEntities().length === 0\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"add\" mat-button (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button test-id=\"delete\" mat-button [disabled]=\"store.selectedEntities().length === 0\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
|
202
|
+
}
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityToolbarComponent, decorators: [{
|
|
204
|
+
type: Component,
|
|
205
|
+
args: [{ selector: 'base-entity-toolbar', standalone: true, imports: [CommonModule, MatToolbar, MatIcon, MatFormField, MatInput, MatButton, MatMenu, MatMenuItem, MatMenuTrigger], template: "<mat-toolbar *ngIf=\"store.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n <mat-form-field>\n <input test-id=\"filter-input\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\" placeholder=\"Filter\">\n </mat-form-field>\n </div>\n <span class=\"toolbar-spacer\"></span>\n @if(isSmallDevice()) {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"menu-button\" mat-button [matMenuTriggerFor]=\"beforeMenu\"><mat-icon>menu</mat-icon> Choose action</button>\n <mat-menu test-id=\"menu\" #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button test-id=\"add\" mat-menu-item (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button test-id=\"delete\" mat-menu-item [disabled]=\"store.selectedEntities().length === 0\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button test-id=\"add\" mat-button (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button test-id=\"delete\" mat-button [disabled]=\"store.selectedEntities().length === 0\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>" }]
|
|
206
|
+
}], propDecorators: { baseEntityListOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseEntityListOptions", required: true }] }] } });
|
|
207
|
+
|
|
208
|
+
class BaseEntityStatusbarComponent {
|
|
209
|
+
store;
|
|
210
|
+
baseEntityListOptions = input.required(...(ngDevMode ? [{ debugName: "baseEntityListOptions" }] : /* istanbul ignore next */ []));
|
|
211
|
+
entityTitle = computed(() => this.evaluateEntityTitle(this.baseEntityListOptions().entityTitle), ...(ngDevMode ? [{ debugName: "entityTitle" }] : /* istanbul ignore next */ []));
|
|
212
|
+
isVisible = computed(() => this.store.currentEntity() != undefined || this.store.selectedEntities().length == 1, ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
213
|
+
// region Angular lifecycle hooks
|
|
214
|
+
ngOnInit() {
|
|
215
|
+
this.store = this.baseEntityListOptions().store;
|
|
216
|
+
}
|
|
217
|
+
// endregion
|
|
218
|
+
// event handling methods
|
|
219
|
+
// endregion
|
|
220
|
+
// protected, private helper methods
|
|
221
|
+
evaluateEntityTitle(title) {
|
|
222
|
+
const fn = new Function('ctx', 'return ' + title.replace(/this\./g, 'ctx.'));
|
|
223
|
+
return fn(this);
|
|
224
|
+
}
|
|
225
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityStatusbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
226
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: BaseEntityStatusbarComponent, isStandalone: true, selector: "base-entity-statusbar", inputs: { baseEntityListOptions: { classPropertyName: "baseEntityListOptions", publicName: "baseEntityListOptions", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-toolbar *ngIf=\"isVisible()\">\n <div>\n <span>{{entityTitle()}}</span>\n </div>\n</mat-toolbar>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }] });
|
|
227
|
+
}
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityStatusbarComponent, decorators: [{
|
|
229
|
+
type: Component,
|
|
230
|
+
args: [{ selector: 'base-entity-statusbar', standalone: true, imports: [CommonModule, MatToolbar], template: "<mat-toolbar *ngIf=\"isVisible()\">\n <div>\n <span>{{entityTitle()}}</span>\n </div>\n</mat-toolbar>" }]
|
|
231
|
+
}], propDecorators: { baseEntityListOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseEntityListOptions", required: true }] }] } });
|
|
232
|
+
|
|
233
|
+
class BaseEntityTabsComponent {
|
|
234
|
+
store;
|
|
235
|
+
baseEntityListOptions = input.required(...(ngDevMode ? [{ debugName: "baseEntityListOptions" }] : /* istanbul ignore next */ []));
|
|
236
|
+
selectedEntityId = computed(() => (this.store.currentId() ? this.store.currentId() : BaseUrlSegments.NewEntity), ...(ngDevMode ? [{ debugName: "selectedEntityId" }] : /* istanbul ignore next */ []));
|
|
237
|
+
detailsTabName = computed(() => this.baseEntityListOptions().entityName + ' - details', ...(ngDevMode ? [{ debugName: "detailsTabName" }] : /* istanbul ignore next */ []));
|
|
238
|
+
listTabName = computed(() => this.baseEntityListOptions().entityName + ' - list', ...(ngDevMode ? [{ debugName: "listTabName" }] : /* istanbul ignore next */ []));
|
|
239
|
+
constructor() {
|
|
240
|
+
this.registerEffects();
|
|
241
|
+
}
|
|
242
|
+
// region angular lifecycle hooks
|
|
243
|
+
ngOnDestroy() {
|
|
244
|
+
this.store.tabIsInactive(this.listTabName());
|
|
245
|
+
this.store.tabIsInactive(this.detailsTabName());
|
|
246
|
+
}
|
|
247
|
+
ngOnInit() {
|
|
248
|
+
this.store = this.baseEntityListOptions().store;
|
|
249
|
+
}
|
|
250
|
+
// endregion
|
|
251
|
+
// region event handlers
|
|
252
|
+
async onShowDetails() {
|
|
253
|
+
if (this.store.activeRouteSegment() != RouteSegments.DETAILS_ROUTE) {
|
|
254
|
+
const id = this.selectedEntityId() ? this.selectedEntityId() : BaseUrlSegments.NewEntity;
|
|
255
|
+
await this.store.navigateToDetails(id);
|
|
256
|
+
this.store.tabIsActive(this.detailsTabName());
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async onShowList() {
|
|
260
|
+
if (this.store.activeRouteSegment() != RouteSegments.LIST_ROUTE) {
|
|
261
|
+
await this.store.navigateToList(this.baseEntityListOptions().entityName);
|
|
262
|
+
this.store.tabIsActive(this.listTabName());
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
// endregion
|
|
266
|
+
// region protected, private helper methods
|
|
267
|
+
registerEffects() {
|
|
268
|
+
effect(() => {
|
|
269
|
+
if (this.store.activeRouteSegment() === RouteSegments.DETAILS_ROUTE) {
|
|
270
|
+
this.store.tabIsActive(this.detailsTabName());
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
this.store.tabIsActive(this.listTabName());
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
278
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: BaseEntityTabsComponent, isStandalone: true, selector: "base-entity-tabs", inputs: { baseEntityListOptions: { classPropertyName: "baseEntityListOptions", publicName: "baseEntityListOptions", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<nav mat-tab-nav-bar [tabPanel]=\"tabPanel\">\n <a mat-tab-link (click)=\"onShowList()\" [active]=\"store.currentTab() === listTabName()\">{{listTabName()}}</a>\n <a mat-tab-link [disabled]=\"store.currentEntity() === undefined\" (click)=\"onShowDetails()\" [active]=\"store.currentTab() === detailsTabName()\">{{detailsTabName()}}</a>\n</nav>\n\n<mat-tab-nav-panel #tabPanel>\n <base-entity-statusbar [baseEntityListOptions]=\"baseEntityListOptions()\"/>\n <base-entity-toolbar [baseEntityListOptions]=\"baseEntityListOptions()\"/>\n <router-outlet [routerOutletData]=\"baseEntityListOptions()\"/>\n</mat-tab-nav-panel>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["fitInkBarToContent", "mat-stretch-tabs", "animationDuration", "backgroundColor", "disableRipple", "color", "tabPanel"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["active", "disabled", "disableRipple", "tabIndex", "id"], exportAs: ["matTabLink"] }, { kind: "component", type: MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: BaseEntityToolbarComponent, selector: "base-entity-toolbar", inputs: ["baseEntityListOptions"] }, { kind: "component", type: BaseEntityStatusbarComponent, selector: "base-entity-statusbar", inputs: ["baseEntityListOptions"] }] });
|
|
279
|
+
}
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityTabsComponent, decorators: [{
|
|
281
|
+
type: Component,
|
|
282
|
+
args: [{ selector: 'base-entity-tabs', standalone: true, imports: [CommonModule, MatTabNav, MatTabLink, MatTabNavPanel, RouterOutlet, BaseEntityToolbarComponent, BaseEntityStatusbarComponent], template: "<nav mat-tab-nav-bar [tabPanel]=\"tabPanel\">\n <a mat-tab-link (click)=\"onShowList()\" [active]=\"store.currentTab() === listTabName()\">{{listTabName()}}</a>\n <a mat-tab-link [disabled]=\"store.currentEntity() === undefined\" (click)=\"onShowDetails()\" [active]=\"store.currentTab() === detailsTabName()\">{{detailsTabName()}}</a>\n</nav>\n\n<mat-tab-nav-panel #tabPanel>\n <base-entity-statusbar [baseEntityListOptions]=\"baseEntityListOptions()\"/>\n <base-entity-toolbar [baseEntityListOptions]=\"baseEntityListOptions()\"/>\n <router-outlet [routerOutletData]=\"baseEntityListOptions()\"/>\n</mat-tab-nav-panel>" }]
|
|
283
|
+
}], ctorParameters: () => [], propDecorators: { baseEntityListOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseEntityListOptions", required: true }] }] } });
|
|
284
|
+
|
|
285
|
+
class BaseEntityContainerComponent {
|
|
286
|
+
baseEntityListOptions = input.required(...(ngDevMode ? [{ debugName: "baseEntityListOptions" }] : /* istanbul ignore next */ []));
|
|
287
|
+
snackBar = inject(MatSnackBar);
|
|
288
|
+
store;
|
|
289
|
+
constructor() {
|
|
290
|
+
this.registerEffects();
|
|
291
|
+
}
|
|
292
|
+
// region Angular lifecycle hooks
|
|
293
|
+
ngOnDestroy() {
|
|
294
|
+
this.store.reset();
|
|
295
|
+
}
|
|
296
|
+
ngOnInit() {
|
|
297
|
+
this.store = this.baseEntityListOptions().store;
|
|
298
|
+
}
|
|
299
|
+
// endregion
|
|
300
|
+
// region protected, private helper methods
|
|
301
|
+
registerEffects() {
|
|
302
|
+
effect(() => {
|
|
303
|
+
if (this.store.error()) {
|
|
304
|
+
const errorMessage = this.store.error() ? this.store.error() : 'Undefined Error';
|
|
305
|
+
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
310
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: BaseEntityContainerComponent, isStandalone: true, selector: "base-entity-container", inputs: { baseEntityListOptions: { classPropertyName: "baseEntityListOptions", publicName: "baseEntityListOptions", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
311
|
+
<div>
|
|
312
|
+
<base-entity-tabs [baseEntityListOptions]="baseEntityListOptions()"></base-entity-tabs>
|
|
313
|
+
</div>
|
|
314
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: BaseEntityTabsComponent, selector: "base-entity-tabs", inputs: ["baseEntityListOptions"] }] });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityContainerComponent, decorators: [{
|
|
317
|
+
type: Component,
|
|
318
|
+
args: [{
|
|
319
|
+
selector: 'base-entity-container',
|
|
320
|
+
standalone: true,
|
|
321
|
+
imports: [CommonModule, BaseEntityTabsComponent],
|
|
322
|
+
template: `
|
|
323
|
+
<div>
|
|
324
|
+
<base-entity-tabs [baseEntityListOptions]="baseEntityListOptions()"></base-entity-tabs>
|
|
325
|
+
</div>
|
|
326
|
+
`,
|
|
327
|
+
}]
|
|
328
|
+
}], ctorParameters: () => [], propDecorators: { baseEntityListOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseEntityListOptions", required: true }] }] } });
|
|
329
|
+
|
|
57
330
|
const INITIAL_CONTAINER_STATE = {
|
|
58
331
|
filterKey: undefined,
|
|
59
332
|
};
|
|
@@ -66,6 +339,137 @@ function BaseEntityContainerStore() {
|
|
|
66
339
|
}));
|
|
67
340
|
}
|
|
68
341
|
|
|
342
|
+
let BaseEntityRestService = class BaseEntityRestService {
|
|
343
|
+
entityMapper;
|
|
344
|
+
urlProperty;
|
|
345
|
+
resourceUrl;
|
|
346
|
+
runtimeConfiguration = inject(RUNTIME_CONFIGURATION);
|
|
347
|
+
baseUrl;
|
|
348
|
+
httpClient = inject(HttpClient);
|
|
349
|
+
headers = new HttpHeaders({
|
|
350
|
+
'Content-Type': 'application/json; charset=utf-8',
|
|
351
|
+
'Access-Control-Allow-Methods': 'GET, HEAD, PUT, PATCH, POST, DELETE',
|
|
352
|
+
'Access-Control-Allow-Origin-Credentials': 'true',
|
|
353
|
+
'Access-Control-Allow-Headers': 'Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers',
|
|
354
|
+
});
|
|
355
|
+
constructor(entityMapper, urlProperty, resourceUrl) {
|
|
356
|
+
this.entityMapper = entityMapper;
|
|
357
|
+
this.urlProperty = urlProperty;
|
|
358
|
+
this.resourceUrl = resourceUrl;
|
|
359
|
+
const baseConf = Reflect.get(this.runtimeConfiguration, 'BASE_CONFIGURATION');
|
|
360
|
+
this.baseUrl = Reflect.get(baseConf, urlProperty);
|
|
361
|
+
}
|
|
362
|
+
// region public accessor and mutator methods
|
|
363
|
+
delete(id) {
|
|
364
|
+
return this.httpClient.delete(this.resourceUrl + `/${id}`, { headers: this.headers });
|
|
365
|
+
}
|
|
366
|
+
deleteAll() {
|
|
367
|
+
return this.httpClient.delete(this.resourceUrl, { headers: this.headers });
|
|
368
|
+
}
|
|
369
|
+
findAll(page) {
|
|
370
|
+
return this.findByQuery({ page });
|
|
371
|
+
}
|
|
372
|
+
findByQuery(queryCondition) {
|
|
373
|
+
const fullUrl = this.buildFullUrl(this.resourceUrl, queryCondition);
|
|
374
|
+
if (fullUrl) {
|
|
375
|
+
return this.httpClient.get(fullUrl, { headers: this.headers }).pipe(map((httpResponse) => {
|
|
376
|
+
return queryCondition.page ? this.mapPagedResponse(httpResponse) : this.mapSimpleResponse(httpResponse);
|
|
377
|
+
}));
|
|
378
|
+
}
|
|
379
|
+
else
|
|
380
|
+
throw new Error('Could not determine the full url');
|
|
381
|
+
}
|
|
382
|
+
findById(id) {
|
|
383
|
+
const queryCondition = { pathParams: new Map([['id', id]]) };
|
|
384
|
+
const fullUrl = this.buildFullUrl(this.resourceUrl, queryCondition);
|
|
385
|
+
if (fullUrl) {
|
|
386
|
+
return this.httpClient.get(fullUrl, { headers: this.headers }).pipe(map((httpResponse) => {
|
|
387
|
+
return this.mapSimpleResponse(httpResponse);
|
|
388
|
+
}));
|
|
389
|
+
}
|
|
390
|
+
else
|
|
391
|
+
throw new Error('Could not determine the full url');
|
|
392
|
+
}
|
|
393
|
+
add(entity, id) {
|
|
394
|
+
const dto = this.entityMapper.toDto(entity);
|
|
395
|
+
const fullUrl = this.buildFullUrl(this.resourceUrl, {});
|
|
396
|
+
if (fullUrl) {
|
|
397
|
+
return this.httpClient.post(fullUrl, dto, { headers: this.headers }).pipe(map((response) => {
|
|
398
|
+
return this.entityMapper.fromDto(response, id);
|
|
399
|
+
}));
|
|
400
|
+
}
|
|
401
|
+
else
|
|
402
|
+
throw new Error('Could not determine the full url');
|
|
403
|
+
}
|
|
404
|
+
update(entity) {
|
|
405
|
+
const dto = this.entityMapper.toDto(entity);
|
|
406
|
+
const pathParams = new Map([['id', String(entity.id)]]);
|
|
407
|
+
const fullUrl = this.buildFullUrl(this.resourceUrl + '/%{id}', { pathParams });
|
|
408
|
+
if (fullUrl) {
|
|
409
|
+
return this.httpClient.put(fullUrl, dto, { headers: this.headers }).pipe(map((response) => {
|
|
410
|
+
return this.entityMapper.fromDto(response);
|
|
411
|
+
}));
|
|
412
|
+
}
|
|
413
|
+
else
|
|
414
|
+
throw new Error('Could not determine the full url');
|
|
415
|
+
}
|
|
416
|
+
// endregion
|
|
417
|
+
// region protected, private helper methods
|
|
418
|
+
buildFullUrl(resourceUri, queryCondition) {
|
|
419
|
+
const queryParams = new Map();
|
|
420
|
+
if (queryCondition.page)
|
|
421
|
+
queryParams.set('page', queryCondition.page.toString());
|
|
422
|
+
if (queryCondition.filters !== undefined && queryCondition.filters.length != 0) {
|
|
423
|
+
queryCondition.filters.forEach((filter) => queryParams.set(filter.property, filter.value));
|
|
424
|
+
}
|
|
425
|
+
let params = {};
|
|
426
|
+
if (queryParams.size > 0) {
|
|
427
|
+
for (const [key, value] of queryParams) {
|
|
428
|
+
params = { ...params, [key]: value };
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
else
|
|
432
|
+
params = null;
|
|
433
|
+
if (queryCondition.pathParams !== undefined && queryCondition.pathParams.size != 0) {
|
|
434
|
+
queryCondition.pathParams.forEach((value, key) => {
|
|
435
|
+
const pathParam = '%{' + key + '}';
|
|
436
|
+
resourceUri = resourceUri.replace(pathParam, value);
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
const urlOptions = {
|
|
440
|
+
path: resourceUri,
|
|
441
|
+
hash: queryCondition.hash,
|
|
442
|
+
queryParams: params,
|
|
443
|
+
};
|
|
444
|
+
return buildUrl(this.baseUrl, urlOptions);
|
|
445
|
+
}
|
|
446
|
+
mapPagedResponse(response) {
|
|
447
|
+
const subjectPage = response[0];
|
|
448
|
+
const content = subjectPage.content.map((dto, index) => {
|
|
449
|
+
return this.entityMapper.fromDto(dto, index);
|
|
450
|
+
});
|
|
451
|
+
return {
|
|
452
|
+
page: subjectPage.page,
|
|
453
|
+
pageSize: subjectPage.pageSize,
|
|
454
|
+
totalPageCount: subjectPage.totalPageCount,
|
|
455
|
+
content,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
mapSimpleResponse(response) {
|
|
459
|
+
if (Object.prototype.toString.call(response) === '[object Array]') {
|
|
460
|
+
return response.map((dto, index) => {
|
|
461
|
+
return this.entityMapper.fromDto(dto, index);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
return new Array(this.entityMapper.fromDto(response));
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
BaseEntityRestService = __decorate([
|
|
470
|
+
__param(0, Inject('entityMapper'))
|
|
471
|
+
], BaseEntityRestService);
|
|
472
|
+
|
|
69
473
|
class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
|
|
70
474
|
description;
|
|
71
475
|
styleClass = '';
|
|
@@ -108,10 +512,10 @@ class BaseFormHostDirective {
|
|
|
108
512
|
constructor(viewContainerRef) {
|
|
109
513
|
this.viewContainerRef = viewContainerRef;
|
|
110
514
|
}
|
|
111
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
112
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
515
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseFormHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
516
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.5", type: BaseFormHostDirective, isStandalone: true, selector: "[baseFormHost]", ngImport: i0 });
|
|
113
517
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseFormHostDirective, decorators: [{
|
|
115
519
|
type: Directive,
|
|
116
520
|
args: [{
|
|
117
521
|
standalone: true,
|
|
@@ -119,15 +523,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
119
523
|
}]
|
|
120
524
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
121
525
|
|
|
122
|
-
var BaseUrlSegments;
|
|
123
|
-
(function (BaseUrlSegments) {
|
|
124
|
-
BaseUrlSegments["DetailsForm"] = "details";
|
|
125
|
-
BaseUrlSegments["Feed"] = "feed";
|
|
126
|
-
BaseUrlSegments["ListForm"] = "list";
|
|
127
|
-
BaseUrlSegments["NewEntity"] = "new";
|
|
128
|
-
BaseUrlSegments["UnknownEntity"] = "unknown";
|
|
129
|
-
})(BaseUrlSegments || (BaseUrlSegments = {}));
|
|
130
|
-
|
|
131
526
|
class BaseFormControlComponent {
|
|
132
527
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
133
528
|
entity = input.required(...(ngDevMode ? [{ debugName: "entity" }] : /* istanbul ignore next */ []));
|
|
@@ -135,10 +530,10 @@ class BaseFormControlComponent {
|
|
|
135
530
|
store;
|
|
136
531
|
style = computed(() => this.config().style, ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
|
|
137
532
|
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
139
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
533
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseFormControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
534
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: BaseFormControlComponent, isStandalone: true, selector: "ng-component", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }] });
|
|
140
535
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseFormControlComponent, decorators: [{
|
|
142
537
|
type: Component,
|
|
143
538
|
args: [{
|
|
144
539
|
standalone: true,
|
|
@@ -148,19 +543,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
148
543
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
149
544
|
|
|
150
545
|
class LabelComponent extends BaseFormControlComponent {
|
|
151
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
152
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
546
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
547
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: LabelComponent, isStandalone: true, selector: "base-label", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <ng-container *ngIf=\"config().isHeading; else normalText\">\n <h3 [id]=\"config().attrName\">{{value()}}</h3>\n </ng-container>\n\n <ng-template #normalText>\n <p [id]=\"config().attrName\" [ngStyle]=\"config().style\">{{value()}}</p>\n </ng-template>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
153
548
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LabelComponent, decorators: [{
|
|
155
550
|
type: Component,
|
|
156
551
|
args: [{ selector: 'base-label', standalone: true, imports: [NgIf, NgStyle], template: "<ng-container *ngIf=\"config().visible\">\n <ng-container *ngIf=\"config().isHeading; else normalText\">\n <h3 [id]=\"config().attrName\">{{value()}}</h3>\n </ng-container>\n\n <ng-template #normalText>\n <p [id]=\"config().attrName\" [ngStyle]=\"config().style\">{{value()}}</p>\n </ng-template>\n</ng-container>" }]
|
|
157
552
|
}] });
|
|
158
553
|
|
|
159
554
|
class DatepickerComponent extends BaseFormControlComponent {
|
|
160
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
161
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
555
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: DatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
556
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: DatepickerComponent, isStandalone: true, selector: "base-datepicker", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" formControlName=\"{{config().attrName}}\">\n <mat-hint>MM-DD-YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
162
557
|
}
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
164
559
|
type: Component,
|
|
165
560
|
args: [{ selector: 'base-datepicker', standalone: true, imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" formControlName=\"{{config().attrName}}\">\n <mat-hint>MM-DD-YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n</ng-container>\n" }]
|
|
166
561
|
}] });
|
|
@@ -170,55 +565,55 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
170
565
|
navigateToRelated() {
|
|
171
566
|
this.store.navigateToRelated(this.config().linkedEntityType, this.value());
|
|
172
567
|
}
|
|
173
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
568
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ForeignKeyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
569
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: ForeignKeyComponent, isStandalone: true, selector: "base-foreign-key", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{ config().attrName }}</mat-label>\n <input matInput formControlName=\"{{config().attrName}}\">\n </mat-form-field>\n <a (click)=\"navigateToRelated()\" aria-label=\"Related entity\">\n <mat-icon>link</mat-icon>\n </a>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
175
570
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ForeignKeyComponent, decorators: [{
|
|
177
572
|
type: Component,
|
|
178
573
|
args: [{ selector: 'base-foreign-key', standalone: true, imports: [NgIf, MatIcon, MatLabel, MatFormField, MatInput, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{ config().attrName }}</mat-label>\n <input matInput formControlName=\"{{config().attrName}}\">\n </mat-form-field>\n <a (click)=\"navigateToRelated()\" aria-label=\"Related entity\">\n <mat-icon>link</mat-icon>\n </a>\n </div>\n</ng-container>" }]
|
|
179
574
|
}] });
|
|
180
575
|
|
|
181
576
|
class TextboxComponent extends BaseFormControlComponent {
|
|
182
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
183
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
577
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: TextboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
578
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: TextboxComponent, isStandalone: true, selector: "base-textbox", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <input matInput formControlName=\"{{config().attrName}}\">\n </mat-form-field>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
184
579
|
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: TextboxComponent, decorators: [{
|
|
186
581
|
type: Component,
|
|
187
582
|
args: [{ selector: 'base-textbox', standalone: true, imports: [NgIf, MatFormField, MatInput, MatLabel, FormsModule, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <input matInput formControlName=\"{{config().attrName}}\">\n </mat-form-field>\n </div>\n</ng-container>" }]
|
|
188
583
|
}] });
|
|
189
584
|
|
|
190
585
|
class DropdownComponent extends BaseFormControlComponent {
|
|
191
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
192
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
586
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: DropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
587
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: DropdownComponent, isStandalone: true, selector: "base-dropdown", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <mat-select formControlName=\"{{config().attrName}}\">\n @for (option of config().selectables; track option) {\n <mat-option [value]=\"option.value\">{{option.value}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
|
|
193
588
|
}
|
|
194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
195
590
|
type: Component,
|
|
196
591
|
args: [{ selector: 'base-dropdown', standalone: true, imports: [NgIf, ReactiveFormsModule, MatLabel, MatFormField, MatSelectModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label>{{config().label}}</mat-label>\n <mat-select formControlName=\"{{config().attrName}}\">\n @for (option of config().selectables; track option) {\n <mat-option [value]=\"option.value\">{{option.value}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>" }]
|
|
197
592
|
}] });
|
|
198
593
|
|
|
199
594
|
class CheckboxComponent extends BaseFormControlComponent {
|
|
200
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: CheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: CheckboxComponent, isStandalone: true, selector: "base-checkbox", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{config().attrName}}\">{{config().label}}</mat-checkbox>\n </div>\n</ng-container>", styles: ["mat-checkbox{margin-bottom:12px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
202
597
|
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
204
599
|
type: Component,
|
|
205
600
|
args: [{ selector: 'base-checkbox', standalone: true, imports: [NgClass, NgIf, MatCheckbox, FormsModule, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{config().attrName}}\">{{config().label}}</mat-checkbox>\n </div>\n</ng-container>", styles: ["mat-checkbox{margin-bottom:12px}\n"] }]
|
|
206
601
|
}] });
|
|
207
602
|
|
|
208
603
|
class RadioComponent extends BaseFormControlComponent {
|
|
209
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
210
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
604
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: RadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
605
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: RadioComponent, isStandalone: true, selector: "base-radio", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <ng-container *ngIf=\"config().label\">\n <label [for]=\"config().attrName\">{{config().label}}</label>\n </ng-container>\n <div \n [ngClass]=\"config().styleClass ? config().styleClass : ''\"\n *ngFor=\"let radio of config().selectables; let i = index\">\n <input type=\"radio\"\n class=\"form-check-input\"\n [name]=\"config().attrName\"\n [id]=\"config().attrName + i\"\n [value]=\"radio.value\"\n [checked]=\"radio.key === value()\"\n [disabled]=\"config().disabled\"\n >\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{radio.value}}</label>\n </div>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
211
606
|
}
|
|
212
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: RadioComponent, decorators: [{
|
|
213
608
|
type: Component,
|
|
214
609
|
args: [{ selector: 'base-radio', standalone: true, imports: [NgIf, NgClass, NgForOf, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <ng-container *ngIf=\"config().label\">\n <label [for]=\"config().attrName\">{{config().label}}</label>\n </ng-container>\n <div \n [ngClass]=\"config().styleClass ? config().styleClass : ''\"\n *ngFor=\"let radio of config().selectables; let i = index\">\n <input type=\"radio\"\n class=\"form-check-input\"\n [name]=\"config().attrName\"\n [id]=\"config().attrName + i\"\n [value]=\"radio.value\"\n [checked]=\"radio.key === value()\"\n [disabled]=\"config().disabled\"\n >\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{radio.value}}</label>\n </div>\n </div>\n</ng-container>" }]
|
|
215
610
|
}] });
|
|
216
611
|
|
|
217
612
|
class TextareaComponent extends BaseFormControlComponent {
|
|
218
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
219
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
613
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: TextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
614
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: TextareaComponent, isStandalone: true, selector: "base-textarea", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\">{{config().label}}</mat-label>\n <textarea matInput formControlName=\"{{config().attrName}}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
220
615
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
222
617
|
type: Component,
|
|
223
618
|
args: [{ selector: 'base-textarea', standalone: true, imports: [NgIf, NgClass, MatFormField, MatInput, MatLabel, ReactiveFormsModule], template: "<ng-container *ngIf=\"config().visible\">\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\">{{config().label}}</mat-label>\n <textarea matInput formControlName=\"{{config().attrName}}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n</ng-container>" }]
|
|
224
619
|
}] });
|
|
@@ -228,10 +623,10 @@ class FlexBoxHostDirective {
|
|
|
228
623
|
constructor(viewContainerRef) {
|
|
229
624
|
this.viewContainerRef = viewContainerRef;
|
|
230
625
|
}
|
|
231
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
232
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
626
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: FlexBoxHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
627
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.5", type: FlexBoxHostDirective, isStandalone: true, selector: "[flexBoxHost]", ngImport: i0 });
|
|
233
628
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
629
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: FlexBoxHostDirective, decorators: [{
|
|
235
630
|
type: Directive,
|
|
236
631
|
args: [{
|
|
237
632
|
standalone: true,
|
|
@@ -271,10 +666,10 @@ class FlexBoxComponent extends BaseFormControlComponent {
|
|
|
271
666
|
throw new Error('Unknown flex direction');
|
|
272
667
|
}
|
|
273
668
|
}
|
|
274
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
275
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
669
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: FlexBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: FlexBoxComponent, isStandalone: true, selector: "flex-box", viewQueries: [{ propertyName: "flexBoxHost", first: true, predicate: FlexBoxHostDirective, descendants: true, read: FlexBoxHostDirective, static: true }], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"flexBoxClass()\" [ngStyle]=\"style()\">\n <ng-template flexBoxHost></ng-template>\n</div>\n", styles: [".flex-box-container{display:flex}.flex-box-container-columns{display:flex;flex-direction:column}.flex-box-container-rows{display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: FlexBoxHostDirective, selector: "[flexBoxHost]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
276
671
|
}
|
|
277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: FlexBoxComponent, decorators: [{
|
|
278
673
|
type: Component,
|
|
279
674
|
args: [{ selector: 'flex-box', imports: [FlexBoxHostDirective, NgClass, NgStyle], template: "<div [ngClass]=\"flexBoxClass()\" [ngStyle]=\"style()\">\n <ng-template flexBoxHost></ng-template>\n</div>\n", styles: [".flex-box-container{display:flex}.flex-box-container-columns{display:flex;flex-direction:column}.flex-box-container-rows{display:flex;flex-direction:row}\n"] }]
|
|
280
675
|
}], propDecorators: { flexBoxHost: [{
|
|
@@ -341,10 +736,10 @@ class BaseEntityFormBuilder {
|
|
|
341
736
|
else
|
|
342
737
|
throw Error('Undefined form control type');
|
|
343
738
|
}
|
|
344
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
345
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
739
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityFormBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
740
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityFormBuilder, providedIn: 'root' });
|
|
346
741
|
}
|
|
347
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityFormBuilder, decorators: [{
|
|
348
743
|
type: Injectable,
|
|
349
744
|
args: [{ providedIn: 'root' }]
|
|
350
745
|
}] });
|
|
@@ -359,6 +754,7 @@ class BaseEntityFormComponent {
|
|
|
359
754
|
entityFormBuilder = inject((BaseEntityFormBuilder));
|
|
360
755
|
formBuilder = inject(FormBuilder);
|
|
361
756
|
isNewObject = computed(() => this.entityId() === BaseUrlSegments.NewEntity, ...(ngDevMode ? [{ debugName: "isNewObject" }] : /* istanbul ignore next */ []));
|
|
757
|
+
logger = inject(NGXLogger);
|
|
362
758
|
constructor() {
|
|
363
759
|
this.registerEffects();
|
|
364
760
|
}
|
|
@@ -366,6 +762,7 @@ class BaseEntityFormComponent {
|
|
|
366
762
|
ngOnInit() {
|
|
367
763
|
this.store().determineActiveRouteSegment();
|
|
368
764
|
this.baseEntityForm = this.formBuilder.group({});
|
|
765
|
+
this.logger.info('BaseEntityFormComponent initialized with:', { entityDescriptor: this.baseEntityListOptions() });
|
|
369
766
|
}
|
|
370
767
|
// endregion
|
|
371
768
|
// region event handlers
|
|
@@ -398,10 +795,10 @@ class BaseEntityFormComponent {
|
|
|
398
795
|
this.store().setCurrentEntity(this.entity().id);
|
|
399
796
|
});
|
|
400
797
|
}
|
|
401
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
402
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
798
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
799
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: BaseEntityFormComponent, isStandalone: true, selector: "base-form", inputs: { entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], viewQueries: [{ propertyName: "componentHost", first: true, predicate: BaseFormHostDirective, descendants: true, read: BaseFormHostDirective, static: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\">\n <ng-template baseFormHost></ng-template>\n </form>\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"submit\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", dependencies: [{ kind: "directive", type: BaseFormHostDirective, selector: "[baseFormHost]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
403
800
|
}
|
|
404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityFormComponent, decorators: [{
|
|
405
802
|
type: Component,
|
|
406
803
|
args: [{ selector: 'base-form', standalone: true, imports: [BaseFormHostDirective, ReactiveFormsModule, MatCard, MatCardContent, MatCardActions, MatButton], providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } }], template: "<mat-card appearance=\"outlined\" class=\"dense-3\">\n <mat-card-content>\n <form [formGroup]=\"baseEntityForm\" (ngSubmit)=\"onSubmit()\">\n <ng-template baseFormHost></ng-template>\n </form>\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"submit\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n" }]
|
|
407
804
|
}], ctorParameters: () => [], propDecorators: { entityId: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityId", required: true }] }], componentHost: [{
|
|
@@ -426,6 +823,7 @@ class BaseEntityListComponent {
|
|
|
426
823
|
dataSource = new MatTableDataSource();
|
|
427
824
|
selection = new SelectionModel(true, []);
|
|
428
825
|
entityDescriptor = inject(ROUTER_OUTLET_DATA);
|
|
826
|
+
logger = inject(NGXLogger);
|
|
429
827
|
columnDescriptors = computed(() => {
|
|
430
828
|
return filterAttributeDescriptors(this.entityDescriptor().attrDescriptors);
|
|
431
829
|
}, ...(ngDevMode ? [{ debugName: "columnDescriptors" }] : /* istanbul ignore next */ []));
|
|
@@ -451,6 +849,7 @@ class BaseEntityListComponent {
|
|
|
451
849
|
}
|
|
452
850
|
ngOnInit() {
|
|
453
851
|
this.store.determineActiveRouteSegment();
|
|
852
|
+
this.logger.info('BaseEntityListComponent initialized with:', { columnDescriptors: this.columnDescriptors() });
|
|
454
853
|
}
|
|
455
854
|
// endregion
|
|
456
855
|
// region event handling methods
|
|
@@ -520,10 +919,10 @@ class BaseEntityListComponent {
|
|
|
520
919
|
isSelected(row) {
|
|
521
920
|
return this.selection.isSelected(row);
|
|
522
921
|
}
|
|
523
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
524
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
922
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
923
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: BaseEntityListComponent, isStandalone: true, selector: "base-list", viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<table mat-table [dataSource]=\"dataSource\" class=\"mat-elevation-z8 demo-table\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let colDescriptor of columnDescriptors(); index as i\" [matColumnDef]=\"colDescriptor.attrName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</th>\n <!-- //NOSONAR --><td (click)=\"onRowClick(element)\" *matCellDef=\"let element\" mat-cell>\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns()\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns()\"></tr>\n</table>\n<mat-paginator [pageSizeOptions]=\"[3, 5, 8]\" showFirstLastButtons></mat-paginator>\n", styles: [".mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}\n"], dependencies: [{ kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] });
|
|
525
924
|
}
|
|
526
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: BaseEntityListComponent, decorators: [{
|
|
527
926
|
type: Component,
|
|
528
927
|
args: [{ selector: 'base-list', standalone: true, imports: [
|
|
529
928
|
MatTable,
|
|
@@ -542,7 +941,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
542
941
|
MatSortHeader,
|
|
543
942
|
MatProgressBar,
|
|
544
943
|
MatCheckbox,
|
|
545
|
-
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<table mat-table [dataSource]=\"dataSource\" class=\"mat-elevation-z8 demo-table\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let colDescriptor of columnDescriptors(); index as i\" [matColumnDef]=\"colDescriptor.attrName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</th>\n <!-- //NOSONAR --><td (click)=\"onRowClick(element)\" *matCellDef=\"let element\" mat-cell>\n @if (colDescriptor.isLinkToDetails
|
|
944
|
+
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<table mat-table [dataSource]=\"dataSource\" class=\"mat-elevation-z8 demo-table\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </td>\n </ng-container>\n\n <ng-container *ngFor=\"let colDescriptor of columnDescriptors(); index as i\" [matColumnDef]=\"colDescriptor.attrName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</th>\n <!-- //NOSONAR --><td (click)=\"onRowClick(element)\" *matCellDef=\"let element\" mat-cell>\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns()\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns()\"></tr>\n</table>\n<mat-paginator [pageSizeOptions]=\"[3, 5, 8]\" showFirstLastButtons></mat-paginator>\n", styles: [".mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}\n"] }]
|
|
546
945
|
}], ctorParameters: () => [], propDecorators: { sort: [{
|
|
547
946
|
type: ViewChild,
|
|
548
947
|
args: [MatSort]
|
|
@@ -734,104 +1133,6 @@ function BaseEntityStore(entityType, repositoryType) {
|
|
|
734
1133
|
})));
|
|
735
1134
|
}
|
|
736
1135
|
|
|
737
|
-
var RouteSegments;
|
|
738
|
-
(function (RouteSegments) {
|
|
739
|
-
RouteSegments["LIST_ROUTE"] = "LIST_ROUTE";
|
|
740
|
-
RouteSegments["DETAILS_ROUTE"] = "DETAILS_ROUTE";
|
|
741
|
-
})(RouteSegments || (RouteSegments = {}));
|
|
742
|
-
const INITIAL_NAVIGATION_STATE = {
|
|
743
|
-
activeRouteSegment: RouteSegments.LIST_ROUTE,
|
|
744
|
-
entityName: '',
|
|
745
|
-
navigationError: undefined,
|
|
746
|
-
navigateTo: '',
|
|
747
|
-
returnTo: '',
|
|
748
|
-
};
|
|
749
|
-
function snakeCaseName(entityName) {
|
|
750
|
-
return entityName
|
|
751
|
-
.split(/(?=[A-Z])/)
|
|
752
|
-
.join('-')
|
|
753
|
-
.toLowerCase();
|
|
754
|
-
}
|
|
755
|
-
function BaseFormNavigatorStore(entityName) {
|
|
756
|
-
return signalStoreFeature(withState(INITIAL_NAVIGATION_STATE), withMethods((store, router = inject(Router), route = inject(ActivatedRoute)) => {
|
|
757
|
-
function determineActiveRouteSegment() {
|
|
758
|
-
const currentUrl = Reflect.get(route, '_routerState').snapshot.url;
|
|
759
|
-
if (currentUrl.endsWith(BaseUrlSegments.ListForm)) {
|
|
760
|
-
patchState(store, { activeRouteSegment: RouteSegments.LIST_ROUTE });
|
|
761
|
-
}
|
|
762
|
-
else if (currentUrl.endsWith(BaseUrlSegments.DetailsForm)) {
|
|
763
|
-
patchState(store, { activeRouteSegment: RouteSegments.DETAILS_ROUTE });
|
|
764
|
-
}
|
|
765
|
-
else {
|
|
766
|
-
patchState(store, { activeRouteSegment: undefined });
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
function determineBaseUrl() {
|
|
770
|
-
determineActiveRouteSegment();
|
|
771
|
-
const currentUrl = determineCurrentUrl();
|
|
772
|
-
return store.activeRouteSegment() === RouteSegments.DETAILS_ROUTE ? levelUpUrl(levelUpUrl(levelUpUrl(currentUrl))) : levelUpUrl(levelUpUrl(currentUrl));
|
|
773
|
-
}
|
|
774
|
-
function determineCurrentUrl() {
|
|
775
|
-
return Reflect.get(route, '_routerState').snapshot.url;
|
|
776
|
-
}
|
|
777
|
-
function levelUpUrl(currentUrl) {
|
|
778
|
-
return currentUrl.substring(0, currentUrl.lastIndexOf('/'));
|
|
779
|
-
}
|
|
780
|
-
async function navigateBack(defaultUrl) {
|
|
781
|
-
const goTo = store.returnTo() ? store.returnTo() : defaultUrl;
|
|
782
|
-
patchState(store, { returnTo: '' });
|
|
783
|
-
if (goTo) {
|
|
784
|
-
await router
|
|
785
|
-
.navigateByUrl(goTo)
|
|
786
|
-
.then()
|
|
787
|
-
.catch((error) => patchState(store, { navigationError: error.message }));
|
|
788
|
-
}
|
|
789
|
-
else
|
|
790
|
-
await navigateToList();
|
|
791
|
-
}
|
|
792
|
-
async function navigateToDetails(id, returnTo) {
|
|
793
|
-
if (store.activeRouteSegment() != RouteSegments.DETAILS_ROUTE) {
|
|
794
|
-
const snakeCaseEntityName = snakeCaseName(entityName);
|
|
795
|
-
const baseUrl = determineBaseUrl();
|
|
796
|
-
const detailsFormPath = baseUrl + '/' + snakeCaseEntityName + '/' + id + '/details';
|
|
797
|
-
await navigateToUrl(detailsFormPath, returnTo);
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
async function navigateToList(returnTo) {
|
|
801
|
-
const snakeCaseEntityName = snakeCaseName(entityName);
|
|
802
|
-
const baseUrl = determineBaseUrl();
|
|
803
|
-
const goToUrl = baseUrl + '/' + snakeCaseEntityName + '/list';
|
|
804
|
-
if (store.activeRouteSegment() != RouteSegments.LIST_ROUTE) {
|
|
805
|
-
await navigateToUrl(goToUrl, returnTo);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
async function navigateToRelated(relatedTypeName, id, returnTo) {
|
|
809
|
-
const snakeCaseEntityName = snakeCaseName(relatedTypeName);
|
|
810
|
-
const baseUrl = determineBaseUrl();
|
|
811
|
-
const detailsFormPath = baseUrl + '/' + snakeCaseEntityName + '/' + id + '/details';
|
|
812
|
-
await navigateToUrl(detailsFormPath, returnTo);
|
|
813
|
-
}
|
|
814
|
-
async function navigateToUrl(url, returnTo) {
|
|
815
|
-
if (returnTo) {
|
|
816
|
-
patchState(store, { returnTo });
|
|
817
|
-
}
|
|
818
|
-
else {
|
|
819
|
-
patchState(store, { returnTo: router.url });
|
|
820
|
-
}
|
|
821
|
-
patchState(store, { navigateTo: url });
|
|
822
|
-
await router
|
|
823
|
-
.navigateByUrl(url)
|
|
824
|
-
.then(() => determineActiveRouteSegment())
|
|
825
|
-
.catch((error) => patchState(store, { navigationError: error.message }));
|
|
826
|
-
}
|
|
827
|
-
return { determineCurrentUrl, determineActiveRouteSegment, navigateBack, navigateToDetails, navigateToList, navigateToRelated, navigateToUrl };
|
|
828
|
-
}), withHooks((store) => ({
|
|
829
|
-
onInit: () => {
|
|
830
|
-
store.determineActiveRouteSegment();
|
|
831
|
-
},
|
|
832
|
-
})));
|
|
833
|
-
}
|
|
834
|
-
|
|
835
1136
|
let BaseEntityFirestoreService = class BaseEntityFirestoreService {
|
|
836
1137
|
entityMapper;
|
|
837
1138
|
collectionName;
|
|
@@ -1029,5 +1330,5 @@ const BASE_ENTITY_ROUTES = [
|
|
|
1029
1330
|
* Generated bundle index. Do not edit.
|
|
1030
1331
|
*/
|
|
1031
1332
|
|
|
1032
|
-
export { AbstractAttrDescriptor, BASE_ENTITY_ROUTES, BASE_ENTITY_SERVICE, BASE_ENTITY_STORE, BASE_LIST_DESCRIPTORS, BaseEntityAttrDescriptor, BaseEntityContainerStore, BaseEntityFirestoreService, BaseEntityFormComponent, BaseEntityListComponent, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseFormNavigatorStore, Entity, FlexDirection, FlexboxDescriptor, FormControlType, Id, OrderByDirection, RouteSegments, getEntityIds, getEntityOptions };
|
|
1333
|
+
export { AbstractAttrDescriptor, BASE_ENTITY_ROUTES, BASE_ENTITY_SERVICE, BASE_ENTITY_STORE, BASE_LIST_DESCRIPTORS, BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityFirestoreService, BaseEntityFormComponent, BaseEntityListComponent, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseFormNavigatorStore, Entity, FlexDirection, FlexboxDescriptor, FormControlType, Id, OrderByDirection, RouteSegments, getEntityIds, getEntityOptions };
|
|
1033
1334
|
//# sourceMappingURL=processpuzzle-base-entity.mjs.map
|