@processpuzzle/base-entity 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, Component, effect, InjectionToken, Inject, Directive, Injector, signal,
|
|
2
|
+
import { inject, Injectable, input, computed, Component, effect, InjectionToken, Inject, Directive, Injector, signal, HostBinding, EventEmitter, Output, ViewChild, DestroyRef, untracked, runInInjectionContext, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
|
-
import { CommonModule, NgClass, NgStyle,
|
|
6
|
-
import {
|
|
5
|
+
import { CommonModule, NgClass, NgStyle, NgTemplateOutlet, SlicePipe } from '@angular/common';
|
|
6
|
+
import { Router, RouteConfigLoadEnd, NavigationEnd, ActivatedRoute, RouterOutlet, ROUTER_OUTLET_DATA } from '@angular/router';
|
|
7
7
|
import { MatTabNav, MatTabLink, MatTabNavPanel } from '@angular/material/tabs';
|
|
8
8
|
import * as i2 from '@angular/material/toolbar';
|
|
9
9
|
import { MatToolbarModule, MatToolbar } from '@angular/material/toolbar';
|
|
10
10
|
import { MatIcon } from '@angular/material/icon';
|
|
11
11
|
import { MatButton, MatIconButton } from '@angular/material/button';
|
|
12
|
-
import * as
|
|
13
|
-
import { MatFormField, MatSuffix, MatFormFieldModule,
|
|
14
|
-
import * as
|
|
12
|
+
import * as i2$1 from '@angular/material/form-field';
|
|
13
|
+
import { MatFormField, MatLabel, MatSuffix, MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
14
|
+
import * as i3 from '@angular/material/input';
|
|
15
15
|
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
16
16
|
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
|
17
17
|
import { signalStore, withState, withMethods, patchState, withHooks, signalStoreFeature, withProps, withComputed } from '@ngrx/signals';
|
|
18
18
|
import { withDevtools } from '@angular-architects/ngrx-toolkit';
|
|
19
19
|
import { LayoutService, RUNTIME_CONFIGURATION } from '@processpuzzle/util';
|
|
20
20
|
import { __decorate, __param } from 'tslib';
|
|
21
|
-
import { map, filter, switchMap, from, of, firstValueFrom, pipe, tap } from 'rxjs';
|
|
21
|
+
import { map, filter, switchMap, Subject, from, of, firstValueFrom, pipe, tap } from 'rxjs';
|
|
22
22
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
23
23
|
import { buildUrl } from 'build-url-ts';
|
|
24
24
|
import * as i1$1 from '@angular/forms';
|
|
@@ -28,14 +28,14 @@ import { NGXLogger } from 'ngx-logging-kit';
|
|
|
28
28
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
29
29
|
import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
30
30
|
import { TranslocoService, provideTranslocoScope } from '@jsverse/transloco';
|
|
31
|
-
import * as
|
|
31
|
+
import * as i4 from '@angular/material/datepicker';
|
|
32
32
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
33
|
-
import * as i2$
|
|
33
|
+
import * as i2$2 from '@angular/material/select';
|
|
34
34
|
import { MatSelectModule } from '@angular/material/select';
|
|
35
35
|
import { MatCheckbox } from '@angular/material/checkbox';
|
|
36
36
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
37
37
|
import { MatChipGrid, MatChipRow, MatChipInput, MatChipRemove } from '@angular/material/chips';
|
|
38
|
-
import * as i2$
|
|
38
|
+
import * as i2$3 from '@angular/material/autocomplete';
|
|
39
39
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
40
40
|
import { MatTableDataSource, MatTable, MatHeaderCell, MatHeaderRow, MatRow, MatCell, MatColumnDef, MatHeaderCellDef, MatCellDef, MatHeaderRowDef, MatRowDef } from '@angular/material/table';
|
|
41
41
|
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
@@ -85,6 +85,60 @@ var BaseUrlSegments;
|
|
|
85
85
|
BaseUrlSegments["UnknownEntity"] = "unknown";
|
|
86
86
|
})(BaseUrlSegments || (BaseUrlSegments = {}));
|
|
87
87
|
|
|
88
|
+
const ENTITY_NAME_ROUTE_DATA_KEY = 'entityName';
|
|
89
|
+
class EntityRouteRegistry {
|
|
90
|
+
router = inject(Router);
|
|
91
|
+
basePaths = new Map();
|
|
92
|
+
scan() {
|
|
93
|
+
this.basePaths.clear();
|
|
94
|
+
this.walk(this.router.config, '');
|
|
95
|
+
}
|
|
96
|
+
observeLazyLoads() {
|
|
97
|
+
this.router.events.subscribe((event) => {
|
|
98
|
+
if (event instanceof RouteConfigLoadEnd)
|
|
99
|
+
this.scan();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
basePath(entityName) {
|
|
103
|
+
return this.basePaths.get(entityName);
|
|
104
|
+
}
|
|
105
|
+
listPath(entityName) {
|
|
106
|
+
const base = this.basePaths.get(entityName);
|
|
107
|
+
return base ? `${base}/list` : undefined;
|
|
108
|
+
}
|
|
109
|
+
detailsPath(entityName, id) {
|
|
110
|
+
const base = this.basePaths.get(entityName);
|
|
111
|
+
return base ? `${base}/${id}/details` : undefined;
|
|
112
|
+
}
|
|
113
|
+
registeredEntities() {
|
|
114
|
+
return [...this.basePaths.keys()];
|
|
115
|
+
}
|
|
116
|
+
walk(routes, prefix) {
|
|
117
|
+
if (!routes)
|
|
118
|
+
return;
|
|
119
|
+
for (const route of routes) {
|
|
120
|
+
const segment = this.append(prefix, route.path);
|
|
121
|
+
const entityName = route.data?.[ENTITY_NAME_ROUTE_DATA_KEY];
|
|
122
|
+
if (typeof entityName === 'string' && entityName.length > 0) {
|
|
123
|
+
this.basePaths.set(entityName, segment);
|
|
124
|
+
}
|
|
125
|
+
this.walk(route.children, segment);
|
|
126
|
+
this.walk(route._loadedRoutes, segment);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
append(prefix, path) {
|
|
130
|
+
if (!path)
|
|
131
|
+
return prefix;
|
|
132
|
+
return `${prefix}/${path}`;
|
|
133
|
+
}
|
|
134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityRouteRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
135
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityRouteRegistry, providedIn: 'root' });
|
|
136
|
+
}
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityRouteRegistry, decorators: [{
|
|
138
|
+
type: Injectable,
|
|
139
|
+
args: [{ providedIn: 'root' }]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
88
142
|
var RouteSegments;
|
|
89
143
|
(function (RouteSegments) {
|
|
90
144
|
RouteSegments["LIST_ROUTE"] = "LIST_ROUTE";
|
|
@@ -103,9 +157,9 @@ const INITIAL_NAVIGATION_STATE = {
|
|
|
103
157
|
};
|
|
104
158
|
function snakeCaseName(entityName) {
|
|
105
159
|
return entityName
|
|
106
|
-
.replace(/\s+/g, '')
|
|
107
|
-
.
|
|
108
|
-
.
|
|
160
|
+
.replace(/\s+/g, '') // strip whitespace
|
|
161
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') // "ITVariant" -> "IT-Variant"
|
|
162
|
+
.replace(/([a-z\d])([A-Z])/g, '$1-$2') // "DeviceType" -> "Device-Type"
|
|
109
163
|
.toLowerCase();
|
|
110
164
|
}
|
|
111
165
|
function payloadKey(payload) {
|
|
@@ -118,13 +172,19 @@ function setLast(target, key, payload) {
|
|
|
118
172
|
target.delete(key);
|
|
119
173
|
target.set(key, payload);
|
|
120
174
|
}
|
|
175
|
+
function levelUpUrl(currentUrl) {
|
|
176
|
+
return currentUrl.substring(0, currentUrl.lastIndexOf('/'));
|
|
177
|
+
}
|
|
178
|
+
function normalizeUrl(url) {
|
|
179
|
+
return url.startsWith('/') ? url : '/' + url;
|
|
180
|
+
}
|
|
121
181
|
function lastKeyOf(target) {
|
|
122
182
|
let last;
|
|
123
183
|
for (const key of target.keys())
|
|
124
184
|
last = key;
|
|
125
185
|
return last;
|
|
126
186
|
}
|
|
127
|
-
const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, withState(INITIAL_NAVIGATION_STATE), withDevtools('Base Form Navigator'), withMethods((store, router = inject(Router), route = inject(ActivatedRoute)) => {
|
|
187
|
+
const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, withState(INITIAL_NAVIGATION_STATE), withDevtools('Base Form Navigator'), withMethods((store, router = inject(Router), route = inject(ActivatedRoute), entityRouteRegistry = inject(EntityRouteRegistry)) => {
|
|
128
188
|
let pendingNavigatorUrl;
|
|
129
189
|
let routerEventsSubscription;
|
|
130
190
|
function clearPayloadStacks() {
|
|
@@ -162,12 +222,6 @@ const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, with
|
|
|
162
222
|
function determineCurrentUrl() {
|
|
163
223
|
return Reflect.get(route, '_routerState').snapshot.url;
|
|
164
224
|
}
|
|
165
|
-
function levelUpUrl(currentUrl) {
|
|
166
|
-
return currentUrl.substring(0, currentUrl.lastIndexOf('/'));
|
|
167
|
-
}
|
|
168
|
-
function normalizeUrl(url) {
|
|
169
|
-
return url.startsWith('/') ? url : '/' + url;
|
|
170
|
-
}
|
|
171
225
|
function isPendingNavigatorUrl(navigationEnd) {
|
|
172
226
|
if (!pendingNavigatorUrl) {
|
|
173
227
|
return false;
|
|
@@ -236,6 +290,11 @@ const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, with
|
|
|
236
290
|
async function navigateToRelated(relatedTypeName, id, returnTo, payload) {
|
|
237
291
|
patchState(store, { entityName: relatedTypeName });
|
|
238
292
|
pushPayload(payload);
|
|
293
|
+
const registeredPath = entityRouteRegistry.detailsPath(relatedTypeName, id);
|
|
294
|
+
if (registeredPath) {
|
|
295
|
+
await navigateToUrl(registeredPath, returnTo);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
239
298
|
const snakeCaseEntityName = snakeCaseName(relatedTypeName);
|
|
240
299
|
const baseUrl = determineBaseUrl();
|
|
241
300
|
const detailsFormPath = baseUrl + '/' + snakeCaseEntityName + '/' + id + '/details';
|
|
@@ -244,6 +303,11 @@ const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, with
|
|
|
244
303
|
async function navigateToRelatedList(relatedTypeName, returnTo, payload) {
|
|
245
304
|
patchState(store, { entityName: relatedTypeName });
|
|
246
305
|
pushPayload(payload);
|
|
306
|
+
const registeredPath = entityRouteRegistry.listPath(relatedTypeName);
|
|
307
|
+
if (registeredPath) {
|
|
308
|
+
await navigateToUrl(registeredPath, returnTo);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
247
311
|
const snakeCaseEntityName = snakeCaseName(relatedTypeName);
|
|
248
312
|
const baseUrl = determineBaseUrl();
|
|
249
313
|
const listPath = baseUrl + '/' + snakeCaseEntityName + '/list';
|
|
@@ -405,14 +469,32 @@ class BaseEntityToolbarComponent {
|
|
|
405
469
|
// endregion
|
|
406
470
|
// protected, private helper methods
|
|
407
471
|
RouteSegments = RouteSegments;
|
|
408
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
409
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
472
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
473
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: BaseEntityToolbarComponent, isStandalone: true, selector: "base-entity-toolbar", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n <mat-form-field>\n <mat-label [attr.for]=\"entityDescriptor().createTestId('filter-input')\">Filter</mat-label>\n <input #filterInput [id]=\"entityDescriptor().createTestId('filter-input')\" [attr.data-testid]=\"entityDescriptor().createTestId('filter')\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\" placeholder=\"Filter\">\n @if (filterInput.value) {\n <button [attr.data-testid]=\"entityDescriptor().createTestId('filter-clear')\" type=\"button\" mat-icon-button matSuffix aria-label=\"Clear filter\" (click)=\"onClearFilter(filterInput)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\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 #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-menu-item [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-menu-item [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-menu-item [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-button [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-button [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-button [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>\n", 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: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2.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: MatLabel, selector: "mat-label" }, { 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: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { 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"] }] });
|
|
410
474
|
}
|
|
411
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityToolbarComponent, decorators: [{
|
|
412
476
|
type: Component,
|
|
413
|
-
args: [{ selector: 'base-entity-toolbar', standalone: true, imports: [CommonModule, MatToolbarModule, MatIcon, MatFormField, MatInput, MatButton, MatIconButton, MatSuffix, MatMenu, MatMenuItem, MatMenuTrigger], template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n <mat-form-field>\n <input #filterInput [attr.data-testid]=\"entityDescriptor().createTestId('filter')\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\" placeholder=\"Filter\">\n @if (filterInput.value) {\n <button [attr.data-testid]=\"entityDescriptor().createTestId('filter-clear')\" type=\"button\" mat-icon-button matSuffix aria-label=\"Clear filter\" (click)=\"onClearFilter(filterInput)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\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 #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-menu-item [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-menu-item [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-menu-item [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-button [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-button [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-button [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>\n" }]
|
|
477
|
+
args: [{ selector: 'base-entity-toolbar', standalone: true, imports: [CommonModule, MatToolbarModule, MatIcon, MatFormField, MatLabel, MatInput, MatButton, MatIconButton, MatSuffix, MatMenu, MatMenuItem, MatMenuTrigger], template: "<mat-toolbar *ngIf=\"formNavigator.activeRouteSegment() === RouteSegments.LIST_ROUTE\">\n <div class=\"dense-3\" [ngStyle]=\"{'padding-top': '12px' }\">\n <mat-form-field>\n <mat-label [attr.for]=\"entityDescriptor().createTestId('filter-input')\">Filter</mat-label>\n <input #filterInput [id]=\"entityDescriptor().createTestId('filter-input')\" [attr.data-testid]=\"entityDescriptor().createTestId('filter')\" matInput type=\"text\" (keyup)=\"onDoFilter( $event )\" placeholder=\"Filter\">\n @if (filterInput.value) {\n <button [attr.data-testid]=\"entityDescriptor().createTestId('filter-clear')\" type=\"button\" mat-icon-button matSuffix aria-label=\"Clear filter\" (click)=\"onClearFilter(filterInput)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\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 #beforeMenu=\"matMenu\" xPosition=\"before\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-menu-item [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-menu-item [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-menu-item [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </mat-menu>\n </div>\n } @else {\n <div [ngClass]=\"layoutService.layoutClass()\">\n <button [attr.data-testid]=\"entityDescriptor().createTestId('edit')\" mat-button [disabled]=\"!isEditEnabled()\" (click)=\"onEditEntity()\"><mat-icon>edit</mat-icon> Edit</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('new')\" mat-button [disabled]=\"!isNewEnabled()\" (click)=\"onAddEntity()\"><mat-icon>add</mat-icon> New</button>\n <button [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-button [disabled]=\"!isDeleteEnabled()\" (click)=\"onDeleteEntities()\"><mat-icon>delete</mat-icon> Delete</button>\n </div>\n }\n</mat-toolbar>\n" }]
|
|
414
478
|
}], propDecorators: { entityDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDescriptor", required: true }] }] } });
|
|
415
479
|
|
|
480
|
+
const INITIAL_STATE = {
|
|
481
|
+
entityName: undefined,
|
|
482
|
+
violations: [],
|
|
483
|
+
};
|
|
484
|
+
const RuleViolationsSingletonStore = signalStore({ providedIn: 'root' }, withState(INITIAL_STATE), withDevtools('Rule Violations'), withMethods((store) => ({
|
|
485
|
+
setViolations(entityName, violations) {
|
|
486
|
+
patchState(store, { entityName, violations });
|
|
487
|
+
},
|
|
488
|
+
clearViolations() {
|
|
489
|
+
patchState(store, INITIAL_STATE);
|
|
490
|
+
},
|
|
491
|
+
})), withComputed((store) => ({
|
|
492
|
+
errorCount: computed(() => store.violations().filter((v) => v.severity === 'ERROR').length),
|
|
493
|
+
warningCount: computed(() => store.violations().filter((v) => v.severity === 'WARNING').length),
|
|
494
|
+
infoCount: computed(() => store.violations().filter((v) => v.severity === 'INFO').length),
|
|
495
|
+
hasViolations: computed(() => store.violations().length > 0),
|
|
496
|
+
})));
|
|
497
|
+
|
|
416
498
|
class BaseEntityStatusbarComponent {
|
|
417
499
|
store;
|
|
418
500
|
entityDescriptor = input.required(/* @ts-ignore */
|
|
@@ -421,6 +503,12 @@ class BaseEntityStatusbarComponent {
|
|
|
421
503
|
...(ngDevMode ? [{ debugName: "entityTitle" }] : /* istanbul ignore next */ []));
|
|
422
504
|
isVisible = computed(() => this.store != null && (this.store.currentEntity() !== undefined || this.store.selectedEntities().length === 1), /* @ts-ignore */
|
|
423
505
|
...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
506
|
+
violationsStore = inject(RuleViolationsSingletonStore);
|
|
507
|
+
errorCount = this.violationsStore.errorCount;
|
|
508
|
+
warningCount = this.violationsStore.warningCount;
|
|
509
|
+
infoCount = this.violationsStore.infoCount;
|
|
510
|
+
showViolationSummary = computed(() => this.violationsStore.entityName() === this.entityDescriptor().entityName && this.violationsStore.hasViolations(), /* @ts-ignore */
|
|
511
|
+
...(ngDevMode ? [{ debugName: "showViolationSummary" }] : /* istanbul ignore next */ []));
|
|
424
512
|
// region Angular lifecycle hooks
|
|
425
513
|
ngOnInit() {
|
|
426
514
|
this.store = this.entityDescriptor().store;
|
|
@@ -432,29 +520,54 @@ class BaseEntityStatusbarComponent {
|
|
|
432
520
|
evaluateEntityTitle(title) {
|
|
433
521
|
return typeof title === 'function' ? title() : title;
|
|
434
522
|
}
|
|
435
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
436
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
523
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityStatusbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
524
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: BaseEntityStatusbarComponent, isStandalone: true, selector: "base-entity-statusbar", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
437
525
|
<mat-toolbar *ngIf="isVisible()">
|
|
438
526
|
<div>
|
|
439
527
|
<span>{{ entityTitle() }}</span>
|
|
440
528
|
</div>
|
|
529
|
+
<span class="statusbar-spacer"></span>
|
|
530
|
+
<div class="rule-summary" *ngIf="showViolationSummary()">
|
|
531
|
+
<span class="chip severity-error" *ngIf="errorCount() > 0">
|
|
532
|
+
<mat-icon>error</mat-icon>
|
|
533
|
+
<span>{{ errorCount() }}</span>
|
|
534
|
+
</span>
|
|
535
|
+
<span class="chip severity-warning" *ngIf="warningCount() > 0">
|
|
536
|
+
<mat-icon>warning</mat-icon>
|
|
537
|
+
<span>{{ warningCount() }}</span>
|
|
538
|
+
</span>
|
|
539
|
+
<span class="chip severity-info" *ngIf="infoCount() > 0">
|
|
540
|
+
<mat-icon>info</mat-icon>
|
|
541
|
+
<span>{{ infoCount() }}</span>
|
|
542
|
+
</span>
|
|
543
|
+
</div>
|
|
441
544
|
</mat-toolbar>
|
|
442
|
-
`, isInline: true, 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"] }] });
|
|
545
|
+
`, isInline: true, styles: [".statusbar-spacer{flex:1 1 auto}.rule-summary{display:flex;align-items:center;gap:8px}.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:12px;font-size:13px;line-height:1}.chip mat-icon{width:16px;height:16px;font-size:16px;line-height:16px}.chip.severity-error{background-color:#d32f2f26;color:#b71c1c}.chip.severity-warning{background-color:#f57c0026;color:#b26a00}.chip.severity-info{background-color:#1976d226;color:#0d47a1}\n"], 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"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
443
546
|
}
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityStatusbarComponent, decorators: [{
|
|
445
548
|
type: Component,
|
|
446
|
-
args: [{
|
|
447
|
-
selector: 'base-entity-statusbar',
|
|
448
|
-
standalone: true,
|
|
449
|
-
imports: [CommonModule, MatToolbar],
|
|
450
|
-
template: `
|
|
549
|
+
args: [{ selector: 'base-entity-statusbar', standalone: true, imports: [CommonModule, MatToolbar, MatIcon], template: `
|
|
451
550
|
<mat-toolbar *ngIf="isVisible()">
|
|
452
551
|
<div>
|
|
453
552
|
<span>{{ entityTitle() }}</span>
|
|
454
553
|
</div>
|
|
554
|
+
<span class="statusbar-spacer"></span>
|
|
555
|
+
<div class="rule-summary" *ngIf="showViolationSummary()">
|
|
556
|
+
<span class="chip severity-error" *ngIf="errorCount() > 0">
|
|
557
|
+
<mat-icon>error</mat-icon>
|
|
558
|
+
<span>{{ errorCount() }}</span>
|
|
559
|
+
</span>
|
|
560
|
+
<span class="chip severity-warning" *ngIf="warningCount() > 0">
|
|
561
|
+
<mat-icon>warning</mat-icon>
|
|
562
|
+
<span>{{ warningCount() }}</span>
|
|
563
|
+
</span>
|
|
564
|
+
<span class="chip severity-info" *ngIf="infoCount() > 0">
|
|
565
|
+
<mat-icon>info</mat-icon>
|
|
566
|
+
<span>{{ infoCount() }}</span>
|
|
567
|
+
</span>
|
|
568
|
+
</div>
|
|
455
569
|
</mat-toolbar>
|
|
456
|
-
`,
|
|
457
|
-
}]
|
|
570
|
+
`, styles: [".statusbar-spacer{flex:1 1 auto}.rule-summary{display:flex;align-items:center;gap:8px}.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:12px;font-size:13px;line-height:1}.chip mat-icon{width:16px;height:16px;font-size:16px;line-height:16px}.chip.severity-error{background-color:#d32f2f26;color:#b71c1c}.chip.severity-warning{background-color:#f57c0026;color:#b26a00}.chip.severity-info{background-color:#1976d226;color:#0d47a1}\n"] }]
|
|
458
571
|
}], propDecorators: { entityDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDescriptor", required: true }] }] } });
|
|
459
572
|
|
|
460
573
|
class BaseEntityTabsComponent {
|
|
@@ -507,8 +620,8 @@ class BaseEntityTabsComponent {
|
|
|
507
620
|
}
|
|
508
621
|
});
|
|
509
622
|
}
|
|
510
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
511
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: BaseEntityTabsComponent, isStandalone: true, selector: "base-entity-tabs", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
512
625
|
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
|
|
513
626
|
<a mat-tab-link [attr.data-testid]="entityDescriptor().createTestId('show-list')" (click)="onShowList()" [active]="store.currentTab() === listTabName()">{{ listTabName() }}</a>
|
|
514
627
|
<a
|
|
@@ -528,7 +641,7 @@ class BaseEntityTabsComponent {
|
|
|
528
641
|
</mat-tab-nav-panel>
|
|
529
642
|
`, isInline: true, 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: ["entityDescriptor"] }, { kind: "component", type: BaseEntityStatusbarComponent, selector: "base-entity-statusbar", inputs: ["entityDescriptor"] }] });
|
|
530
643
|
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityTabsComponent, decorators: [{
|
|
532
645
|
type: Component,
|
|
533
646
|
args: [{
|
|
534
647
|
selector: 'base-entity-tabs',
|
|
@@ -581,6 +694,7 @@ class BaseEntityContainerComponent {
|
|
|
581
694
|
...(ngDevMode ? [{ debugName: "resolvedDescriptor" }] : /* istanbul ignore next */ []));
|
|
582
695
|
constructor() {
|
|
583
696
|
this.registerEffects();
|
|
697
|
+
this.registerFacadeDescriptorMerge();
|
|
584
698
|
}
|
|
585
699
|
// region Angular lifecycle hooks
|
|
586
700
|
ngOnDestroy() {
|
|
@@ -599,15 +713,28 @@ class BaseEntityContainerComponent {
|
|
|
599
713
|
}
|
|
600
714
|
});
|
|
601
715
|
}
|
|
602
|
-
|
|
603
|
-
|
|
716
|
+
registerFacadeDescriptorMerge() {
|
|
717
|
+
effect(() => {
|
|
718
|
+
const facade = this.activeFacade();
|
|
719
|
+
const input = this.entityDescriptor();
|
|
720
|
+
if (!facade || !input)
|
|
721
|
+
return;
|
|
722
|
+
const facadeDescriptor = facade.descriptor;
|
|
723
|
+
if (input.entityTitle)
|
|
724
|
+
facadeDescriptor.entityTitle = input.entityTitle;
|
|
725
|
+
if (input.extraFormActionsTemplate)
|
|
726
|
+
facadeDescriptor.extraFormActionsTemplate = input.extraFormActionsTemplate;
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
730
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: BaseEntityContainerComponent, isStandalone: true, selector: "base-entity-container", inputs: { entityDescriptor: { classPropertyName: "entityDescriptor", publicName: "entityDescriptor", isSignal: true, isRequired: false, transformFunction: null }, facade: { classPropertyName: "facade", publicName: "facade", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
604
731
|
<ng-content></ng-content>
|
|
605
732
|
<div>
|
|
606
733
|
<base-entity-tabs [entityDescriptor]="resolvedDescriptor()"></base-entity-tabs>
|
|
607
734
|
</div>
|
|
608
735
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: BaseEntityTabsComponent, selector: "base-entity-tabs", inputs: ["entityDescriptor"] }] });
|
|
609
736
|
}
|
|
610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityContainerComponent, decorators: [{
|
|
611
738
|
type: Component,
|
|
612
739
|
args: [{
|
|
613
740
|
selector: 'base-entity-container',
|
|
@@ -639,6 +766,70 @@ function assertPersistedEntity(entity) {
|
|
|
639
766
|
throw new Error('Persisted entity must have an id');
|
|
640
767
|
}
|
|
641
768
|
|
|
769
|
+
function isFilterGroup(node) {
|
|
770
|
+
return node.conditions !== undefined;
|
|
771
|
+
}
|
|
772
|
+
var OrderByDirection;
|
|
773
|
+
(function (OrderByDirection) {
|
|
774
|
+
OrderByDirection["ASC"] = "asc";
|
|
775
|
+
OrderByDirection["DESC"] = "desc";
|
|
776
|
+
})(OrderByDirection || (OrderByDirection = {}));
|
|
777
|
+
|
|
778
|
+
const OP_MAP = {
|
|
779
|
+
'==': '==',
|
|
780
|
+
'!=': '!=',
|
|
781
|
+
'<': '=lt=',
|
|
782
|
+
'<=': '=le=',
|
|
783
|
+
'>': '=gt=',
|
|
784
|
+
'>=': '=ge=',
|
|
785
|
+
in: '=in=',
|
|
786
|
+
'not-in': '=out=',
|
|
787
|
+
'array-contains': '=in=',
|
|
788
|
+
'array-contains-any': '=in=',
|
|
789
|
+
};
|
|
790
|
+
function toRsql(input) {
|
|
791
|
+
if (Array.isArray(input)) {
|
|
792
|
+
return input.map(conditionToRsql).join(';');
|
|
793
|
+
}
|
|
794
|
+
return groupToRsql(input);
|
|
795
|
+
}
|
|
796
|
+
function groupToRsql(group) {
|
|
797
|
+
const separator = group.operator === 'OR' ? ',' : ';';
|
|
798
|
+
const parts = group.conditions.map((node) => (isFilterGroup(node) ? `(${groupToRsql(node)})` : conditionToRsql(node)));
|
|
799
|
+
return parts.join(separator);
|
|
800
|
+
}
|
|
801
|
+
function conditionToRsql(condition) {
|
|
802
|
+
const rsqlOp = mapOperator(condition.operator);
|
|
803
|
+
return `${condition.property}${rsqlOp}${encodeValue(condition.value, condition.operator)}`;
|
|
804
|
+
}
|
|
805
|
+
function mapOperator(operator) {
|
|
806
|
+
const mapped = OP_MAP[operator];
|
|
807
|
+
if (!mapped)
|
|
808
|
+
throw new Error(`Unsupported filter operator for RSQL translation: ${operator}`);
|
|
809
|
+
return mapped;
|
|
810
|
+
}
|
|
811
|
+
function encodeValue(value, operator) {
|
|
812
|
+
if (operator === 'in' || operator === 'not-in' || operator === 'array-contains-any') {
|
|
813
|
+
const items = Array.isArray(value) ? value : [value];
|
|
814
|
+
return `(${items.map(encodeScalar).join(',')})`;
|
|
815
|
+
}
|
|
816
|
+
if (operator === 'array-contains') {
|
|
817
|
+
return `(${encodeScalar(value)})`;
|
|
818
|
+
}
|
|
819
|
+
return encodeScalar(value);
|
|
820
|
+
}
|
|
821
|
+
function encodeScalar(value) {
|
|
822
|
+
if (value === null || value === undefined)
|
|
823
|
+
return 'null';
|
|
824
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
825
|
+
return String(value);
|
|
826
|
+
const asString = String(value);
|
|
827
|
+
if (/[\s,;()"'=<>!]/.test(asString)) {
|
|
828
|
+
return `"${asString.replace(/"/g, '\\"')}"`;
|
|
829
|
+
}
|
|
830
|
+
return asString;
|
|
831
|
+
}
|
|
832
|
+
|
|
642
833
|
let BaseEntityRestService = class BaseEntityRestService {
|
|
643
834
|
entityMapper;
|
|
644
835
|
urlProperty;
|
|
@@ -725,9 +916,9 @@ let BaseEntityRestService = class BaseEntityRestService {
|
|
|
725
916
|
const queryParams = new Map();
|
|
726
917
|
if (queryCondition.page)
|
|
727
918
|
queryParams.set('page', queryCondition.page.toString());
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
919
|
+
const rsql = this.buildRsql(queryCondition);
|
|
920
|
+
if (rsql)
|
|
921
|
+
queryParams.set('filter', rsql);
|
|
731
922
|
let params = {};
|
|
732
923
|
if (queryParams.size > 0) {
|
|
733
924
|
for (const [key, value] of queryParams) {
|
|
@@ -749,6 +940,13 @@ let BaseEntityRestService = class BaseEntityRestService {
|
|
|
749
940
|
};
|
|
750
941
|
return buildUrl(this.baseUrl, urlOptions);
|
|
751
942
|
}
|
|
943
|
+
buildRsql(queryCondition) {
|
|
944
|
+
if (queryCondition.filterGroup)
|
|
945
|
+
return toRsql(queryCondition.filterGroup);
|
|
946
|
+
if (queryCondition.filters?.length)
|
|
947
|
+
return toRsql(queryCondition.filters);
|
|
948
|
+
return undefined;
|
|
949
|
+
}
|
|
752
950
|
mapPagedResponse(response) {
|
|
753
951
|
const pages = response;
|
|
754
952
|
const subjectPage = pages[0];
|
|
@@ -796,6 +994,7 @@ class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
|
|
|
796
994
|
lines;
|
|
797
995
|
options;
|
|
798
996
|
required = false;
|
|
997
|
+
referenceIdField = 'id';
|
|
799
998
|
_label;
|
|
800
999
|
_linkedEntityType;
|
|
801
1000
|
constructor(attrName, formControlType, label, selectables, isLinkToDetails, options) {
|
|
@@ -805,6 +1004,11 @@ class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
|
|
|
805
1004
|
this.isLinkToDetails = isLinkToDetails;
|
|
806
1005
|
this.options = { inputType: 'text', ...options };
|
|
807
1006
|
}
|
|
1007
|
+
getSelectables() {
|
|
1008
|
+
if (this.selectables === undefined)
|
|
1009
|
+
return undefined;
|
|
1010
|
+
return typeof this.selectables === 'function' ? this.selectables() : this.selectables;
|
|
1011
|
+
}
|
|
808
1012
|
// region properties
|
|
809
1013
|
get label() {
|
|
810
1014
|
return this._label ? this._label : this.attrName;
|
|
@@ -825,10 +1029,10 @@ class BaseFormHostDirective {
|
|
|
825
1029
|
constructor(viewContainerRef) {
|
|
826
1030
|
this.viewContainerRef = viewContainerRef;
|
|
827
1031
|
}
|
|
828
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
829
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
1032
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseFormHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1033
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: BaseFormHostDirective, isStandalone: true, selector: "[baseFormHost]", ngImport: i0 });
|
|
830
1034
|
}
|
|
831
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseFormHostDirective, decorators: [{
|
|
832
1036
|
type: Directive,
|
|
833
1037
|
args: [{
|
|
834
1038
|
standalone: true,
|
|
@@ -907,7 +1111,7 @@ class EntityRegistryComponent {
|
|
|
907
1111
|
labelClass: attr.labelClass,
|
|
908
1112
|
format: attr.format,
|
|
909
1113
|
isLinkToDetails: attr.isLinkToDetails,
|
|
910
|
-
selectables: attr.
|
|
1114
|
+
selectables: attr.getSelectables(),
|
|
911
1115
|
visible: attr.visible,
|
|
912
1116
|
hideInTable: attr.hideInTable,
|
|
913
1117
|
isHeading: attr.isHeading,
|
|
@@ -919,10 +1123,10 @@ class EntityRegistryComponent {
|
|
|
919
1123
|
}),
|
|
920
1124
|
};
|
|
921
1125
|
}
|
|
922
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
923
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
1126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityRegistryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: EntityRegistryComponent, isStandalone: true, selector: "pp-entity-registry", ngImport: i0, template: ` <pre>{{ registryJson() }}</pre> `, isInline: true });
|
|
924
1128
|
}
|
|
925
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityRegistryComponent, decorators: [{
|
|
926
1130
|
type: Component,
|
|
927
1131
|
args: [{
|
|
928
1132
|
selector: 'pp-entity-registry',
|
|
@@ -947,12 +1151,12 @@ class BaseEntityDescriptorRegistry {
|
|
|
947
1151
|
const facadeToken = this.registry[entityName];
|
|
948
1152
|
if (!facadeToken)
|
|
949
1153
|
return undefined;
|
|
950
|
-
return this.injector.get(facadeToken, undefined
|
|
1154
|
+
return this.injector.get(facadeToken, null, { optional: true }) ?? undefined;
|
|
951
1155
|
}
|
|
952
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
953
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
1156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityDescriptorRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1157
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityDescriptorRegistry, providedIn: 'root' });
|
|
954
1158
|
}
|
|
955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityDescriptorRegistry, decorators: [{
|
|
956
1160
|
type: Injectable,
|
|
957
1161
|
args: [{ providedIn: 'root' }]
|
|
958
1162
|
}] });
|
|
@@ -1008,13 +1212,21 @@ class BaseFormControlComponent {
|
|
|
1008
1212
|
return null;
|
|
1009
1213
|
return createTestId(entityName, attrName);
|
|
1010
1214
|
}
|
|
1215
|
+
get hostStyle() {
|
|
1216
|
+
const s = this.config()?.style;
|
|
1217
|
+
if (!s)
|
|
1218
|
+
return null;
|
|
1219
|
+
return Object.entries(s)
|
|
1220
|
+
.map(([k, v]) => `${k}:${v}`)
|
|
1221
|
+
.join(';');
|
|
1222
|
+
}
|
|
1011
1223
|
logger = inject(NGXLogger);
|
|
1012
1224
|
formNavigator = inject(BaseFormNavigatorSingletonStore);
|
|
1013
1225
|
descriptorRegistry = inject(BaseEntityDescriptorRegistry);
|
|
1014
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1015
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
1226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseFormControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.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 }, entityName: { classPropertyName: "entityName", publicName: "entityName", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.data-testid": "this.testId", "attr.style": "this.hostStyle" } }, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }] });
|
|
1016
1228
|
}
|
|
1017
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseFormControlComponent, decorators: [{
|
|
1018
1230
|
type: Component,
|
|
1019
1231
|
args: [{
|
|
1020
1232
|
standalone: true,
|
|
@@ -1024,6 +1236,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1024
1236
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: true }] }], entityName: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityName", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], testId: [{
|
|
1025
1237
|
type: HostBinding,
|
|
1026
1238
|
args: ['attr.data-testid']
|
|
1239
|
+
}], hostStyle: [{
|
|
1240
|
+
type: HostBinding,
|
|
1241
|
+
args: ['attr.style']
|
|
1027
1242
|
}] } });
|
|
1028
1243
|
|
|
1029
1244
|
class ObjectStoreService {
|
|
@@ -1067,10 +1282,10 @@ class ObjectStoreService {
|
|
|
1067
1282
|
const baseConfiguration = Reflect.get(this.runtimeConfiguration, 'BASE_CONFIGURATION');
|
|
1068
1283
|
return Reflect.get(baseConfiguration, 'OBJECT_STORE_SERVICE_ROOT') ?? Reflect.get(baseConfiguration, 'BACKEND_SERVICE_ROOT') ?? '';
|
|
1069
1284
|
}
|
|
1070
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1071
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
1285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ObjectStoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1286
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ObjectStoreService, providedIn: 'root' });
|
|
1072
1287
|
}
|
|
1073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ObjectStoreService, decorators: [{
|
|
1074
1289
|
type: Injectable,
|
|
1075
1290
|
args: [{ providedIn: 'root' }]
|
|
1076
1291
|
}] });
|
|
@@ -1139,8 +1354,8 @@ class ArtifactSelectorComponent {
|
|
|
1139
1354
|
};
|
|
1140
1355
|
return mimeTypeByExtension[extension] ?? 'application/octet-stream';
|
|
1141
1356
|
}
|
|
1142
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1143
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1357
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1358
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ArtifactSelectorComponent, isStandalone: true, selector: "app-artifact-selector", outputs: { artifactUploaded: "artifactUploaded" }, ngImport: i0, template: `
|
|
1144
1359
|
<div class="artifact-selector">
|
|
1145
1360
|
@if (!isSelectorVisible) {
|
|
1146
1361
|
<button type="button" (click)="showSelector()">Upload file</button>
|
|
@@ -1172,7 +1387,7 @@ class ArtifactSelectorComponent {
|
|
|
1172
1387
|
</div>
|
|
1173
1388
|
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1174
1389
|
}
|
|
1175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactSelectorComponent, decorators: [{
|
|
1176
1391
|
type: Component,
|
|
1177
1392
|
args: [{ selector: 'app-artifact-selector', standalone: true, imports: [FormsModule], template: `
|
|
1178
1393
|
<div class="artifact-selector">
|
|
@@ -1215,8 +1430,8 @@ class DeleteArtifactConfirmationDialog {
|
|
|
1215
1430
|
t(key, params) {
|
|
1216
1431
|
return this.translocoService.translate(key, params);
|
|
1217
1432
|
}
|
|
1218
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1219
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
1433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DeleteArtifactConfirmationDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1434
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: DeleteArtifactConfirmationDialog, isStandalone: true, selector: "app-delete-artifact-confirmation-dialog", providers: [provideTranslocoScope('base-entity')], ngImport: i0, template: `
|
|
1220
1435
|
<h2 mat-dialog-title>{{ t(data.titleKey) }}</h2>
|
|
1221
1436
|
<mat-dialog-content>{{ t(data.contentKey, data.contentParams) }}</mat-dialog-content>
|
|
1222
1437
|
<mat-dialog-actions align="end">
|
|
@@ -1225,7 +1440,7 @@ class DeleteArtifactConfirmationDialog {
|
|
|
1225
1440
|
</mat-dialog-actions>
|
|
1226
1441
|
`, isInline: true, dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { 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"] }] });
|
|
1227
1442
|
}
|
|
1228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DeleteArtifactConfirmationDialog, decorators: [{
|
|
1229
1444
|
type: Component,
|
|
1230
1445
|
args: [{
|
|
1231
1446
|
selector: 'app-delete-artifact-confirmation-dialog',
|
|
@@ -1297,8 +1512,8 @@ class ArtifactComponent extends BaseFormControlComponent {
|
|
|
1297
1512
|
control?.markAsDirty();
|
|
1298
1513
|
control?.markAsTouched();
|
|
1299
1514
|
}
|
|
1300
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1301
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1515
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ArtifactComponent, isStandalone: true, selector: "app-artifact", usesInheritance: true, ngImport: i0, template: `
|
|
1302
1517
|
@if (config().visible) {
|
|
1303
1518
|
@if (config().isHeading) {
|
|
1304
1519
|
<h3 [id]="config().attrName">{{ value() }}</h3>
|
|
@@ -1325,9 +1540,9 @@ class ArtifactComponent extends BaseFormControlComponent {
|
|
|
1325
1540
|
</div>
|
|
1326
1541
|
}
|
|
1327
1542
|
}
|
|
1328
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ArtifactSelectorComponent, selector: "app-artifact-selector", outputs: ["artifactUploaded"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1543
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ArtifactSelectorComponent, selector: "app-artifact-selector", outputs: ["artifactUploaded"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1329
1544
|
}
|
|
1330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ArtifactComponent, decorators: [{
|
|
1331
1546
|
type: Component,
|
|
1332
1547
|
args: [{ selector: 'app-artifact', standalone: true, imports: [FormsModule, ReactiveFormsModule, NgClass, NgStyle, ArtifactSelectorComponent, MatIconButton, MatIcon], template: `
|
|
1333
1548
|
@if (config().visible) {
|
|
@@ -1356,25 +1571,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1356
1571
|
</div>
|
|
1357
1572
|
}
|
|
1358
1573
|
}
|
|
1359
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"] }]
|
|
1574
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"] }]
|
|
1360
1575
|
}] });
|
|
1361
1576
|
|
|
1362
1577
|
class LabelComponent extends BaseFormControlComponent {
|
|
1363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1578
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1579
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelComponent, isStandalone: true, selector: "base-label", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n @if (config().isHeading) {\n <h3 [id]=\"config().attrName\">{{ value() }}</h3>\n } @else {\n <p [id]=\"config().attrName\" [ngStyle]=\"config().style\">{{ value() }}</p>\n }\n}\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1365
1580
|
}
|
|
1366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1581
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelComponent, decorators: [{
|
|
1367
1582
|
type: Component,
|
|
1368
|
-
args: [{ selector: 'base-label', standalone: true, imports: [
|
|
1583
|
+
args: [{ selector: 'base-label', standalone: true, imports: [NgStyle], template: "@if (config().visible) {\n @if (config().isHeading) {\n <h3 [id]=\"config().attrName\">{{ value() }}</h3>\n } @else {\n <p [id]=\"config().attrName\" [ngStyle]=\"config().style\">{{ value() }}</p>\n }\n}\n" }]
|
|
1369
1584
|
}] });
|
|
1370
1585
|
|
|
1371
1586
|
class DatepickerComponent extends BaseFormControlComponent {
|
|
1372
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1373
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1587
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1588
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DatepickerComponent, isStandalone: true, selector: "base-datepicker", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" [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}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.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: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.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"] }] });
|
|
1374
1589
|
}
|
|
1375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
1376
1591
|
type: Component,
|
|
1377
|
-
args: [{ selector: 'base-datepicker', standalone: true, imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule], template: "
|
|
1592
|
+
args: [{ selector: 'base-datepicker', standalone: true, imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule], template: "@if (config().visible) {\n <div class=\"row\" style=\"margin-bottom: 10px\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" [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}\n" }]
|
|
1378
1593
|
}] });
|
|
1379
1594
|
|
|
1380
1595
|
var NavigatorCommand;
|
|
@@ -1430,7 +1645,9 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1430
1645
|
}
|
|
1431
1646
|
const attrName = this.linkedEntityDescriptor()?.componentIdentification() ?? '';
|
|
1432
1647
|
const componentName = attrName ? relatedEntity[attrName] : undefined;
|
|
1433
|
-
|
|
1648
|
+
if (componentName == null || typeof componentName === 'object')
|
|
1649
|
+
return relatedEntity.id;
|
|
1650
|
+
return String(componentName);
|
|
1434
1651
|
}
|
|
1435
1652
|
addSelectedComponentFromNavigatorResponse() {
|
|
1436
1653
|
if (this.config().disabled) {
|
|
@@ -1479,8 +1696,8 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1479
1696
|
}
|
|
1480
1697
|
return undefined;
|
|
1481
1698
|
}
|
|
1482
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1483
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1699
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ForeignKeyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1700
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ForeignKeyComponent, isStandalone: true, selector: "base-foreign-key", usesInheritance: true, ngImport: i0, template: `
|
|
1484
1701
|
@if (config().visible) {
|
|
1485
1702
|
<div class="row" [formGroup]="formGroup" (focusin)="hasFocus.set(true)" (focusout)="onFocusOut($event)">
|
|
1486
1703
|
<div class="foreign-key-control">
|
|
@@ -1507,7 +1724,7 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1507
1724
|
}
|
|
1508
1725
|
`, isInline: true, styles: [".foreign-key-control{display:inline-flex;flex-direction:column;align-items:stretch}.foreign-key-field{width:100%}.foreign-key-select-row{display:flex;min-height:28px;margin-top:-18px;padding:0 12px 0 16px;justify-content:flex-start}.foreign-key-select-button{height:28px;min-width:max-content;padding:0 8px;line-height:28px;white-space:nowrap}.foreign-key-select-button mat-icon{width:18px;height:18px;margin-right:4px;font-size:18px;line-height:18px}:host .foreign-key-field .mdc-notched-outline,:host .foreign-key-field .mdc-notched-outline *{pointer-events:none}\n"], dependencies: [{ 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: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { 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: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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"] }] });
|
|
1509
1726
|
}
|
|
1510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ForeignKeyComponent, decorators: [{
|
|
1511
1728
|
type: Component,
|
|
1512
1729
|
args: [{ selector: 'base-foreign-key', standalone: true, template: `
|
|
1513
1730
|
@if (config().visible) {
|
|
@@ -1538,48 +1755,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1538
1755
|
}] });
|
|
1539
1756
|
|
|
1540
1757
|
class TextboxComponent extends BaseFormControlComponent {
|
|
1541
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1542
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1758
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1759
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextboxComponent, isStandalone: true, selector: "base-textbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" />\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}mat-form-field{width:100%}\n"], dependencies: [{ 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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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"] }] });
|
|
1543
1760
|
}
|
|
1544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextboxComponent, decorators: [{
|
|
1545
1762
|
type: Component,
|
|
1546
|
-
args: [{ selector: 'base-textbox', standalone: true, imports: [
|
|
1763
|
+
args: [{ selector: 'base-textbox', standalone: true, imports: [MatFormField, MatInput, MatLabel, FormsModule, ReactiveFormsModule], template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field>\n <mat-label [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <input matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" />\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}mat-form-field{width:100%}\n"] }]
|
|
1547
1764
|
}] });
|
|
1548
1765
|
|
|
1549
1766
|
class DropdownComponent extends BaseFormControlComponent {
|
|
1550
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1551
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1767
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1768
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DropdownComponent, isStandalone: true, selector: "base-dropdown", usesInheritance: true, ngImport: i0, template: "@if (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().getSelectables(); track option.value) {\n <mat-option [value]=\"option.value\">{{ option.value }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n}\n", dependencies: [{ 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$2.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$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
|
|
1552
1769
|
}
|
|
1553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1554
1771
|
type: Component,
|
|
1555
|
-
args: [{ selector: 'base-dropdown', standalone: true, imports: [
|
|
1772
|
+
args: [{ selector: 'base-dropdown', standalone: true, imports: [ReactiveFormsModule, MatLabel, MatFormField, MatSelectModule], template: "@if (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().getSelectables(); track option.value) {\n <mat-option [value]=\"option.value\">{{ option.value }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n}\n" }]
|
|
1556
1773
|
}] });
|
|
1557
1774
|
|
|
1558
1775
|
class CheckboxComponent extends BaseFormControlComponent {
|
|
1559
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1560
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1776
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1777
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CheckboxComponent, isStandalone: true, selector: "base-checkbox", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{ config().attrName }}\">{{ config().label }}</mat-checkbox>\n </div>\n}\n", styles: ["mat-checkbox{margin-bottom:12px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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"] }] });
|
|
1561
1778
|
}
|
|
1562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
1563
1780
|
type: Component,
|
|
1564
|
-
args: [{ selector: 'base-checkbox', standalone: true, imports: [NgClass,
|
|
1781
|
+
args: [{ selector: 'base-checkbox', standalone: true, imports: [NgClass, MatCheckbox, FormsModule, ReactiveFormsModule], template: "@if (config().visible) {\n <div [formGroup]=\"formGroup\" class=\"row\">\n <mat-checkbox [ngClass]=\"config().labelClass\" formControlName=\"{{ config().attrName }}\">{{ config().label }}</mat-checkbox>\n </div>\n}\n", styles: ["mat-checkbox{margin-bottom:12px}\n"] }]
|
|
1565
1782
|
}] });
|
|
1566
1783
|
|
|
1567
1784
|
class RadioComponent extends BaseFormControlComponent {
|
|
1568
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1569
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1785
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1786
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: RadioComponent, isStandalone: true, selector: "base-radio", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n @if (config().label) {\n <label [for]=\"config().attrName\">{{ config().label }}</label>\n }\n @for (radio of config().getSelectables(); track radio.key; let i = $index) {\n <div [ngClass]=\"config().styleClass ? config().styleClass : ''\">\n <input type=\"radio\" class=\"form-check-input\" [name]=\"config().attrName\" [id]=\"config().attrName + i\" [value]=\"radio.value\" [checked]=\"radio.key === value()\" [disabled]=\"config().disabled\" />\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{ radio.value }}</label>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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"] }] });
|
|
1570
1787
|
}
|
|
1571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioComponent, decorators: [{
|
|
1572
1789
|
type: Component,
|
|
1573
|
-
args: [{ selector: 'base-radio', standalone: true, imports: [
|
|
1790
|
+
args: [{ selector: 'base-radio', standalone: true, imports: [NgClass, ReactiveFormsModule], template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n @if (config().label) {\n <label [for]=\"config().attrName\">{{ config().label }}</label>\n }\n @for (radio of config().getSelectables(); track radio.key; let i = $index) {\n <div [ngClass]=\"config().styleClass ? config().styleClass : ''\">\n <input type=\"radio\" class=\"form-check-input\" [name]=\"config().attrName\" [id]=\"config().attrName + i\" [value]=\"radio.value\" [checked]=\"radio.key === value()\" [disabled]=\"config().disabled\" />\n <label [for]=\"config().attrName\" [ngClass]=\"config().labelClass ? config().labelClass : ''\">{{ radio.value }}</label>\n </div>\n }\n </div>\n}\n" }]
|
|
1574
1791
|
}] });
|
|
1575
1792
|
|
|
1576
1793
|
class TextareaComponent extends BaseFormControlComponent {
|
|
1577
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1578
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1794
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1795
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TextareaComponent, isStandalone: true, selector: "base-textarea", usesInheritance: true, ngImport: i0, template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\" [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <textarea matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}.full-width{width:100%}\n"], dependencies: [{ 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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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"] }] });
|
|
1579
1796
|
}
|
|
1580
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1581
1798
|
type: Component,
|
|
1582
|
-
args: [{ selector: 'base-textarea', standalone: true, imports: [
|
|
1799
|
+
args: [{ selector: 'base-textarea', standalone: true, imports: [NgClass, MatFormField, MatInput, MatLabel, ReactiveFormsModule], template: "@if (config().visible) {\n <div class=\"row\" [formGroup]=\"formGroup\">\n <mat-form-field [ngClass]=\"config().styleClass\">\n <mat-label [ngClass]=\"config().labelClass\" [attr.for]=\"config().attrName\">{{ config().label }}</mat-label>\n <textarea matInput [id]=\"config().attrName\" formControlName=\"{{ config().attrName }}\" placeholder=\"Ex. It makes me feel...\"></textarea>\n </mat-form-field>\n </div>\n}\n", styles: [":host{display:block}.full-width{width:100%}\n"] }]
|
|
1583
1800
|
}] });
|
|
1584
1801
|
|
|
1585
1802
|
class FlexBoxHostDirective {
|
|
@@ -1587,10 +1804,10 @@ class FlexBoxHostDirective {
|
|
|
1587
1804
|
constructor(viewContainerRef) {
|
|
1588
1805
|
this.viewContainerRef = viewContainerRef;
|
|
1589
1806
|
}
|
|
1590
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1591
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
1807
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FlexBoxHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1808
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: FlexBoxHostDirective, isStandalone: true, selector: "[flexBoxHost]", ngImport: i0 });
|
|
1592
1809
|
}
|
|
1593
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FlexBoxHostDirective, decorators: [{
|
|
1594
1811
|
type: Directive,
|
|
1595
1812
|
args: [{
|
|
1596
1813
|
standalone: true,
|
|
@@ -1615,10 +1832,10 @@ class FlexBoxComponent extends BaseFormControlComponent {
|
|
|
1615
1832
|
throw new Error('Unknown flex direction');
|
|
1616
1833
|
}
|
|
1617
1834
|
}
|
|
1618
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1619
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
1835
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FlexBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1836
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.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"] }] });
|
|
1620
1837
|
}
|
|
1621
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FlexBoxComponent, decorators: [{
|
|
1622
1839
|
type: Component,
|
|
1623
1840
|
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"] }]
|
|
1624
1841
|
}], propDecorators: { flexBoxHost: [{
|
|
@@ -1662,9 +1879,9 @@ class TagsComponent extends BaseFormControlComponent {
|
|
|
1662
1879
|
control?.markAsDirty();
|
|
1663
1880
|
control?.markAsTouched();
|
|
1664
1881
|
}
|
|
1665
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1666
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1667
|
-
|
|
1882
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TagsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1883
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: TagsComponent, isStandalone: true, selector: "base-tags", usesInheritance: true, ngImport: i0, template: `
|
|
1884
|
+
@if (config().visible) {
|
|
1668
1885
|
<div class="row" [formGroup]="formGroup">
|
|
1669
1886
|
<mat-form-field>
|
|
1670
1887
|
<mat-label>{{ config().label }}</mat-label>
|
|
@@ -1681,16 +1898,16 @@ class TagsComponent extends BaseFormControlComponent {
|
|
|
1681
1898
|
</mat-chip-grid>
|
|
1682
1899
|
</mat-form-field>
|
|
1683
1900
|
</div>
|
|
1684
|
-
|
|
1685
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
1901
|
+
}
|
|
1902
|
+
`, isInline: true, dependencies: [{ 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"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "component", type: MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "directive", type: MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1686
1903
|
}
|
|
1687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1904
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TagsComponent, decorators: [{
|
|
1688
1905
|
type: Component,
|
|
1689
1906
|
args: [{
|
|
1690
1907
|
selector: 'base-tags',
|
|
1691
1908
|
standalone: true,
|
|
1692
1909
|
template: `
|
|
1693
|
-
|
|
1910
|
+
@if (config().visible) {
|
|
1694
1911
|
<div class="row" [formGroup]="formGroup">
|
|
1695
1912
|
<mat-form-field>
|
|
1696
1913
|
<mat-label>{{ config().label }}</mat-label>
|
|
@@ -1707,9 +1924,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1707
1924
|
</mat-chip-grid>
|
|
1708
1925
|
</mat-form-field>
|
|
1709
1926
|
</div>
|
|
1710
|
-
|
|
1927
|
+
}
|
|
1711
1928
|
`,
|
|
1712
|
-
imports: [
|
|
1929
|
+
imports: [ReactiveFormsModule, MatFormField, MatLabel, MatChipGrid, MatChipRow, MatChipInput, MatChipRemove, MatIcon],
|
|
1713
1930
|
}]
|
|
1714
1931
|
}] });
|
|
1715
1932
|
|
|
@@ -1731,7 +1948,9 @@ class EntityComponentRefComponent {
|
|
|
1731
1948
|
const attrName = this.componentNameAttr().attrName;
|
|
1732
1949
|
const component = this.component();
|
|
1733
1950
|
const componentName = attrName ? component[attrName] : undefined;
|
|
1734
|
-
|
|
1951
|
+
if (componentName == null || typeof componentName === 'object')
|
|
1952
|
+
return component.id;
|
|
1953
|
+
return String(componentName);
|
|
1735
1954
|
}
|
|
1736
1955
|
navigateToRelated(event) {
|
|
1737
1956
|
event.preventDefault();
|
|
@@ -1754,17 +1973,17 @@ class EntityComponentRefComponent {
|
|
|
1754
1973
|
control?.markAsDirty();
|
|
1755
1974
|
control?.markAsTouched();
|
|
1756
1975
|
}
|
|
1757
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1758
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1976
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentRefComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1977
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EntityComponentRefComponent, isStandalone: true, selector: "app-entity-component-ref", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, componentNameAttr: { classPropertyName: "componentNameAttr", publicName: "componentNameAttr", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, linkedEntityType: { classPropertyName: "linkedEntityType", publicName: "linkedEntityType", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
1759
1978
|
<a href="" (click)="navigateToRelated($event)">{{ componentName() }}</a>
|
|
1760
1979
|
@if (!disabled()) {
|
|
1761
1980
|
<button type="button" mat-icon-button class="base-entity-form-delete-button" aria-label="Delete component reference" (click)="removeComponent()">
|
|
1762
1981
|
<mat-icon>cancel</mat-icon>
|
|
1763
1982
|
</button>
|
|
1764
1983
|
}
|
|
1765
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1984
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1766
1985
|
}
|
|
1767
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentRefComponent, decorators: [{
|
|
1768
1987
|
type: Component,
|
|
1769
1988
|
args: [{ selector: 'app-entity-component-ref', standalone: true, imports: [MatIconButton, MatIcon], template: `
|
|
1770
1989
|
<a href="" (click)="navigateToRelated($event)">{{ componentName() }}</a>
|
|
@@ -1773,7 +1992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1773
1992
|
<mat-icon>cancel</mat-icon>
|
|
1774
1993
|
</button>
|
|
1775
1994
|
}
|
|
1776
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"] }]
|
|
1995
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"] }]
|
|
1777
1996
|
}], propDecorators: { entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: true }] }], component: [{ type: i0.Input, args: [{ isSignal: true, alias: "component", required: true }] }], componentNameAttr: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentNameAttr", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], linkedEntityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkedEntityType", required: true }] }] } });
|
|
1778
1997
|
|
|
1779
1998
|
class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
@@ -1788,11 +2007,20 @@ class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
|
1788
2007
|
}
|
|
1789
2008
|
components() {
|
|
1790
2009
|
const value = this.formGroup.get(this.config().attrName)?.value ?? this.value();
|
|
1791
|
-
if (!Array.isArray(value))
|
|
2010
|
+
if (!Array.isArray(value))
|
|
1792
2011
|
return [];
|
|
1793
|
-
|
|
1794
|
-
value.
|
|
1795
|
-
|
|
2012
|
+
const idField = this.config().referenceIdField ?? 'id';
|
|
2013
|
+
const normalized = value.map((item) => {
|
|
2014
|
+
if (typeof item === 'string' || typeof item === 'number') {
|
|
2015
|
+
return { id: String(item) };
|
|
2016
|
+
}
|
|
2017
|
+
if (idField !== 'id' && item && typeof item === 'object' && !('id' in item)) {
|
|
2018
|
+
return { ...item, id: String(item[idField] ?? '') };
|
|
2019
|
+
}
|
|
2020
|
+
return item;
|
|
2021
|
+
});
|
|
2022
|
+
normalized.forEach((component) => assertPersistedEntity(component));
|
|
2023
|
+
return normalized;
|
|
1796
2024
|
}
|
|
1797
2025
|
addComponentTitle() {
|
|
1798
2026
|
return 'Add ' + this.linkedEntityName();
|
|
@@ -1854,8 +2082,8 @@ class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
|
1854
2082
|
invalidControls: controls.filter((control) => control.invalid),
|
|
1855
2083
|
};
|
|
1856
2084
|
}
|
|
1857
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1858
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
2085
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentsListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2086
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EntityComponentsListComponent, isStandalone: true, selector: "app-component-list", usesInheritance: true, ngImport: i0, template: `
|
|
1859
2087
|
@if (config().visible) {
|
|
1860
2088
|
<div class="row">
|
|
1861
2089
|
<fieldset class="base-entity-form-field" [ngClass]="config().styleClass" [ngStyle]="config().style">
|
|
@@ -1883,9 +2111,9 @@ class EntityComponentsListComponent extends BaseFormControlComponent {
|
|
|
1883
2111
|
</fieldset>
|
|
1884
2112
|
</div>
|
|
1885
2113
|
}
|
|
1886
|
-
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EntityComponentRefComponent, selector: "app-entity-component-ref", inputs: ["entity", "component", "componentNameAttr", "disabled", "formGroup", "linkedEntityType"] }, { 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: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2114
|
+
`, isInline: true, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EntityComponentRefComponent, selector: "app-entity-component-ref", inputs: ["entity", "component", "componentNameAttr", "disabled", "formGroup", "linkedEntityType"] }, { 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: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1887
2115
|
}
|
|
1888
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EntityComponentsListComponent, decorators: [{
|
|
1889
2117
|
type: Component,
|
|
1890
2118
|
args: [{ selector: 'app-component-list', standalone: true, imports: [NgClass, NgStyle, EntityComponentRefComponent, MatButton, MatIcon], template: `
|
|
1891
2119
|
@if (config().visible) {
|
|
@@ -1915,7 +2143,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1915
2143
|
</fieldset>
|
|
1916
2144
|
</div>
|
|
1917
2145
|
}
|
|
1918
|
-
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}\n"] }]
|
|
2146
|
+
`, styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"] }]
|
|
1919
2147
|
}] });
|
|
1920
2148
|
|
|
1921
2149
|
class LookupComponent extends BaseFormControlComponent {
|
|
@@ -1964,7 +2192,8 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
1964
2192
|
});
|
|
1965
2193
|
}
|
|
1966
2194
|
selectLookupItem(selectedValue) {
|
|
1967
|
-
|
|
2195
|
+
const key = selectedValue == null || typeof selectedValue === 'object' ? '' : String(selectedValue);
|
|
2196
|
+
this.setLookupKey(key);
|
|
1968
2197
|
this.restoreSelectedValue();
|
|
1969
2198
|
}
|
|
1970
2199
|
restoreSelectedValue() {
|
|
@@ -2024,9 +2253,9 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
2024
2253
|
}
|
|
2025
2254
|
lookupStore.load({});
|
|
2026
2255
|
}
|
|
2027
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2028
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
2029
|
-
|
|
2256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LookupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2257
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LookupComponent, isStandalone: true, selector: "lookup-control", usesInheritance: true, ngImport: i0, template: `
|
|
2258
|
+
@if (config().visible) {
|
|
2030
2259
|
<div class="row" [formGroup]="formGroup">
|
|
2031
2260
|
<mat-form-field>
|
|
2032
2261
|
<mat-label>{{ config().label }}</mat-label>
|
|
@@ -2047,16 +2276,16 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
2047
2276
|
</mat-form-field>
|
|
2048
2277
|
<input type="hidden" [formControlName]="config().attrName" />
|
|
2049
2278
|
</div>
|
|
2050
|
-
|
|
2051
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
2279
|
+
}
|
|
2280
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: "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: MatAutocompleteModule }, { kind: "component", type: i2$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] });
|
|
2052
2281
|
}
|
|
2053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LookupComponent, decorators: [{
|
|
2054
2283
|
type: Component,
|
|
2055
2284
|
args: [{
|
|
2056
2285
|
selector: 'lookup-control',
|
|
2057
2286
|
standalone: true,
|
|
2058
2287
|
template: `
|
|
2059
|
-
|
|
2288
|
+
@if (config().visible) {
|
|
2060
2289
|
<div class="row" [formGroup]="formGroup">
|
|
2061
2290
|
<mat-form-field>
|
|
2062
2291
|
<mat-label>{{ config().label }}</mat-label>
|
|
@@ -2077,9 +2306,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2077
2306
|
</mat-form-field>
|
|
2078
2307
|
<input type="hidden" [formControlName]="config().attrName" />
|
|
2079
2308
|
</div>
|
|
2080
|
-
|
|
2309
|
+
}
|
|
2081
2310
|
`,
|
|
2082
|
-
imports: [
|
|
2311
|
+
imports: [ReactiveFormsModule, MatLabel, MatFormField, MatInput, MatAutocompleteModule, MatIconButton, MatIcon, MatSuffix],
|
|
2083
2312
|
}]
|
|
2084
2313
|
}], ctorParameters: () => [] });
|
|
2085
2314
|
|
|
@@ -2142,14 +2371,16 @@ class BaseEntityFormBuilder {
|
|
|
2142
2371
|
throw new Error('Undefined form control type');
|
|
2143
2372
|
return componentType;
|
|
2144
2373
|
}
|
|
2145
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2146
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
2374
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2375
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormBuilder, providedIn: 'root' });
|
|
2147
2376
|
}
|
|
2148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormBuilder, decorators: [{
|
|
2149
2378
|
type: Injectable,
|
|
2150
2379
|
args: [{ providedIn: 'root' }]
|
|
2151
2380
|
}] });
|
|
2152
2381
|
|
|
2382
|
+
const RULE_ENGINE = new InjectionToken('RULE_ENGINE');
|
|
2383
|
+
|
|
2153
2384
|
class BaseEntityFormComponent {
|
|
2154
2385
|
baseEntityForm;
|
|
2155
2386
|
entityDescriptor = inject(ROUTER_OUTLET_DATA);
|
|
@@ -2164,10 +2395,20 @@ class BaseEntityFormComponent {
|
|
|
2164
2395
|
store = computed(() => this.entityDescriptor().store, /* @ts-ignore */
|
|
2165
2396
|
...(ngDevMode ? [{ debugName: "store" }] : /* istanbul ignore next */ []));
|
|
2166
2397
|
componentHost;
|
|
2398
|
+
violations = signal([], /* @ts-ignore */
|
|
2399
|
+
...(ngDevMode ? [{ debugName: "violations" }] : /* istanbul ignore next */ []));
|
|
2400
|
+
hasErrorViolations = computed(() => this.violations().some((v) => v.severity === 'ERROR'), /* @ts-ignore */
|
|
2401
|
+
...(ngDevMode ? [{ debugName: "hasErrorViolations" }] : /* istanbul ignore next */ []));
|
|
2167
2402
|
entityFormBuilder = inject((BaseEntityFormBuilder));
|
|
2168
2403
|
formBuilder = inject(FormBuilder);
|
|
2169
2404
|
formNavigator = inject(BaseFormNavigatorSingletonStore);
|
|
2170
2405
|
logger = inject(NGXLogger);
|
|
2406
|
+
ruleEngine = inject(RULE_ENGINE, { optional: true });
|
|
2407
|
+
violationsStore = inject(RuleViolationsSingletonStore);
|
|
2408
|
+
rules = [];
|
|
2409
|
+
fieldsWithRuleErrors = new Set();
|
|
2410
|
+
ruleLoad$ = new Subject();
|
|
2411
|
+
ruleSubscription;
|
|
2171
2412
|
constructor() {
|
|
2172
2413
|
this.registerEffects();
|
|
2173
2414
|
}
|
|
@@ -2177,6 +2418,13 @@ class BaseEntityFormComponent {
|
|
|
2177
2418
|
this.formNavigator.determineActiveRouteSegment();
|
|
2178
2419
|
this.baseEntityForm = this.formBuilder.group({});
|
|
2179
2420
|
this.logger.info('BaseEntityFormComponent initialized with: ', { entityDescriptor: this.entityDescriptor() });
|
|
2421
|
+
this.loadRules();
|
|
2422
|
+
}
|
|
2423
|
+
ngOnDestroy() {
|
|
2424
|
+
this.ruleSubscription?.unsubscribe();
|
|
2425
|
+
this.ruleLoad$.complete();
|
|
2426
|
+
this.clearFieldRuleErrors();
|
|
2427
|
+
this.violationsStore.clearViolations();
|
|
2180
2428
|
}
|
|
2181
2429
|
// endregion
|
|
2182
2430
|
// region event handlers
|
|
@@ -2188,8 +2436,14 @@ class BaseEntityFormComponent {
|
|
|
2188
2436
|
await this.store().delete(this.entityId());
|
|
2189
2437
|
await this.formNavigator.navigateBack();
|
|
2190
2438
|
}
|
|
2439
|
+
onFieldBlur() {
|
|
2440
|
+
this.evaluateRules();
|
|
2441
|
+
}
|
|
2191
2442
|
async onSubmit() {
|
|
2192
2443
|
const objectToSave = { ...this.entity(), ...this.baseEntityForm.value };
|
|
2444
|
+
this.evaluateRules(objectToSave);
|
|
2445
|
+
if (this.hasErrorViolations())
|
|
2446
|
+
return;
|
|
2193
2447
|
this.store().setCurrentEntity(undefined);
|
|
2194
2448
|
if (this.isNewObject()) {
|
|
2195
2449
|
await this.store().add(objectToSave);
|
|
@@ -2201,6 +2455,61 @@ class BaseEntityFormComponent {
|
|
|
2201
2455
|
}
|
|
2202
2456
|
// endregion
|
|
2203
2457
|
// region protected, private helper methods
|
|
2458
|
+
evaluateRules(candidate) {
|
|
2459
|
+
if (!this.ruleEngine || this.rules.length === 0)
|
|
2460
|
+
return;
|
|
2461
|
+
const target = candidate ?? { ...this.entity(), ...this.baseEntityForm.value };
|
|
2462
|
+
const results = this.rules.map((rule) => this.ruleEngine.evaluate(target, rule));
|
|
2463
|
+
const failing = results.filter((r) => !r.passed);
|
|
2464
|
+
this.violations.set(failing);
|
|
2465
|
+
this.violationsStore.setViolations(this.entityDescriptor().entityName, failing);
|
|
2466
|
+
this.applyFieldRuleErrors(failing);
|
|
2467
|
+
}
|
|
2468
|
+
applyFieldRuleErrors(violations) {
|
|
2469
|
+
this.clearFieldRuleErrors();
|
|
2470
|
+
const perField = new Map();
|
|
2471
|
+
for (const violation of violations) {
|
|
2472
|
+
for (const field of violation.fields ?? []) {
|
|
2473
|
+
const list = perField.get(field) ?? [];
|
|
2474
|
+
list.push(violation);
|
|
2475
|
+
perField.set(field, list);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
for (const [field, list] of perField) {
|
|
2479
|
+
const control = this.baseEntityForm.get(field);
|
|
2480
|
+
if (!control)
|
|
2481
|
+
continue;
|
|
2482
|
+
const message = list.map((v) => v.message ?? v.error ?? v.ruleId).join('\n');
|
|
2483
|
+
const severity = list.some((v) => v.severity === 'ERROR') ? 'ERROR' : list[0].severity;
|
|
2484
|
+
const existing = control.errors ?? {};
|
|
2485
|
+
control.setErrors({ ...existing, ruleViolation: { message, severity } });
|
|
2486
|
+
control.markAsTouched();
|
|
2487
|
+
this.fieldsWithRuleErrors.add(field);
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
clearFieldRuleErrors() {
|
|
2491
|
+
for (const field of this.fieldsWithRuleErrors) {
|
|
2492
|
+
const control = this.baseEntityForm.get(field);
|
|
2493
|
+
if (!control)
|
|
2494
|
+
continue;
|
|
2495
|
+
const errors = { ...(control.errors ?? {}) };
|
|
2496
|
+
delete errors['ruleViolation'];
|
|
2497
|
+
control.setErrors(Object.keys(errors).length ? errors : null);
|
|
2498
|
+
}
|
|
2499
|
+
this.fieldsWithRuleErrors.clear();
|
|
2500
|
+
}
|
|
2501
|
+
loadRules() {
|
|
2502
|
+
if (!this.ruleEngine)
|
|
2503
|
+
return;
|
|
2504
|
+
const context = this.entityDescriptor().entityName;
|
|
2505
|
+
this.ruleSubscription = this.ruleEngine.loadRulesFor(context).subscribe({
|
|
2506
|
+
next: (rules) => {
|
|
2507
|
+
this.rules = rules;
|
|
2508
|
+
this.logger.info(`BaseEntityFormComponent loaded ${rules.length} rule(s) for context "${context}"`);
|
|
2509
|
+
},
|
|
2510
|
+
error: (err) => this.logger.warn(`BaseEntityFormComponent failed to load rules for "${context}"`, err),
|
|
2511
|
+
});
|
|
2512
|
+
}
|
|
2204
2513
|
registerEffects() {
|
|
2205
2514
|
effect(() => {
|
|
2206
2515
|
if (this.entityId() && this.entityDescriptor() && this.entity())
|
|
@@ -2214,12 +2523,12 @@ class BaseEntityFormComponent {
|
|
|
2214
2523
|
this.store().setCurrentEntity(this.entity().id);
|
|
2215
2524
|
});
|
|
2216
2525
|
}
|
|
2217
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2218
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
2526
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2527
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.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()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"], dependencies: [{ kind: "directive", type: BaseFormHostDirective, selector: "[baseFormHost]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2219
2528
|
}
|
|
2220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFormComponent, decorators: [{
|
|
2221
2530
|
type: Component,
|
|
2222
|
-
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\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n" }]
|
|
2531
|
+
args: [{ selector: 'base-form', standalone: true, imports: [BaseFormHostDirective, NgTemplateOutlet, ReactiveFormsModule, MatCard, MatCardContent, MatCardActions, MatButton, MatIcon], 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()\" (focusout)=\"onFieldBlur()\">\n <ng-template baseFormHost></ng-template>\n </form>\n @if (violations().length > 0) {\n <ul class=\"rule-violations\" data-testid=\"rule-violations\">\n @for (violation of violations(); track violation.ruleId) {\n <li [class]=\"'rule-violation severity-' + violation.severity.toLowerCase()\">\n <mat-icon>{{ violation.severity === 'ERROR' ? 'error' : violation.severity === 'WARNING' ? 'warning' : 'info' }}</mat-icon>\n <span>{{ violation.message ?? violation.error ?? violation.ruleId }}</span>\n </li>\n }\n </ul>\n }\n </mat-card-content>\n <mat-card-actions>\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" mat-raised-button color=\"secondary\" (click)=\"onCancel()\">Cancel</button>\n <button id=\"delete\" [attr.data-testid]=\"entityDescriptor().createTestId('delete')\" mat-raised-button color=\"primary\" type=\"button\" [disabled]=\"isNewObject() || isAbstract()\" (click)=\"onDelete()\">Delete</button>\n @if (entityDescriptor().extraFormActionsTemplate?.(); as extraTpl) {\n <ng-container [ngTemplateOutlet]=\"extraTpl\"></ng-container>\n }\n <button id=\"submit\" [attr.data-testid]=\"entityDescriptor().createTestId('save')\" mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"baseEntityForm.invalid || !baseEntityForm.dirty || isAbstract() || hasErrorViolations()\" (click)=\"onSubmit()\">Save</button>\n </mat-card-actions>\n</mat-card>\n", styles: [":host{display:block}.base-entity-form-field{box-sizing:border-box;min-width:0;margin:0 0 16px;padding:0 12px 8px;border:var(--mat-form-field-outlined-outline-width, 1px) solid var(--mat-form-field-outlined-outline-color, rgba(0, 0, 0, .38));border-radius:var(--mat-form-field-outlined-container-shape, 4px);color:var(--mat-form-field-outlined-input-text-color, rgba(0, 0, 0, .87));font-family:var(--mat-form-field-container-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-container-text-size, 16px);font-weight:var(--mat-form-field-container-text-weight, 400);line-height:var(--mat-form-field-container-text-line-height, 24px)}.base-entity-form-field:hover{border-color:var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, .87))}.base-entity-form-field legend{padding:0 4px;color:var(--mat-form-field-outlined-label-text-color, rgba(0, 0, 0, .54));font-family:var(--mat-form-field-outlined-label-text-font, Roboto, \"Helvetica Neue\", sans-serif);font-size:var(--mat-form-field-outlined-label-text-size, 12px);font-weight:var(--mat-form-field-outlined-label-text-weight, 400);line-height:1}.base-entity-form-list{min-height:24px;margin:4px 0 0;padding-left:20px}.base-entity-form-delete-button{width:24px;height:24px;padding:0;margin-left:4px;line-height:24px;vertical-align:middle}.base-entity-form-delete-button mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violations{list-style:none;margin:12px 0 0;padding:0}.rule-violation{display:flex;align-items:center;gap:8px;padding:6px 8px;border-left:4px solid transparent;margin-bottom:4px;font-size:14px}.rule-violation mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.rule-violation.severity-error{border-left-color:#d32f2f;background-color:#d32f2f14;color:#b71c1c}.rule-violation.severity-warning{border-left-color:#f57c00;background-color:#f57c0014;color:#b26a00}.rule-violation.severity-info{border-left-color:#1976d2;background-color:#1976d214;color:#0d47a1}\n"] }]
|
|
2223
2532
|
}], ctorParameters: () => [], propDecorators: { entityId: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityId", required: true }] }], componentHost: [{
|
|
2224
2533
|
type: ViewChild,
|
|
2225
2534
|
args: [BaseFormHostDirective, { static: true, read: BaseFormHostDirective }]
|
|
@@ -2230,13 +2539,15 @@ class BaseEntityDescriptor {
|
|
|
2230
2539
|
attrDescriptors;
|
|
2231
2540
|
entityName;
|
|
2232
2541
|
entityTitle;
|
|
2542
|
+
extraFormActionsTemplate;
|
|
2233
2543
|
parentEntity;
|
|
2234
2544
|
isAbstract;
|
|
2235
|
-
constructor({ store, attrDescriptors, entityName, entityTitle, isAbstract, parentEntity }) {
|
|
2545
|
+
constructor({ store, attrDescriptors, entityName, entityTitle, extraFormActionsTemplate, isAbstract, parentEntity }) {
|
|
2236
2546
|
this.store = store;
|
|
2237
2547
|
this.attrDescriptors = attrDescriptors;
|
|
2238
2548
|
this.entityName = entityName;
|
|
2239
2549
|
this.entityTitle = entityTitle ?? '';
|
|
2550
|
+
this.extraFormActionsTemplate = extraFormActionsTemplate;
|
|
2240
2551
|
this.isAbstract = isAbstract ?? false;
|
|
2241
2552
|
this.parentEntity = parentEntity;
|
|
2242
2553
|
}
|
|
@@ -2405,10 +2716,10 @@ class BaseEntityListComponent {
|
|
|
2405
2716
|
canSelectEntity() {
|
|
2406
2717
|
return this.selection.selected.length === 1;
|
|
2407
2718
|
}
|
|
2408
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2409
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
2719
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2720
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.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<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <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 </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\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 if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\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: 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"] }, { 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: "pipe", type: SlicePipe, name: "slice" }] });
|
|
2410
2721
|
}
|
|
2411
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2722
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityListComponent, decorators: [{
|
|
2412
2723
|
type: Component,
|
|
2413
2724
|
args: [{ selector: 'base-list', standalone: true, imports: [
|
|
2414
2725
|
MatTable,
|
|
@@ -2428,7 +2739,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2428
2739
|
MatCheckbox,
|
|
2429
2740
|
SlicePipe,
|
|
2430
2741
|
MatButton,
|
|
2431
|
-
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <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 </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" *matCellDef=\"let element\">\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 if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:
|
|
2742
|
+
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <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 </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" (keydown.enter)=\"onRowClick(element)\" tabindex=\"0\" role=\"button\" *matCellDef=\"let element\">\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 if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined && element[colDescriptor.attrName] !== null ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <div class=\"base-entity-list-footer\">\n @if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n }\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.base-entity-list-actions{display:flex;gap:8px;padding-left:16px}\n"] }]
|
|
2432
2743
|
}], ctorParameters: () => [], propDecorators: { sort: [{
|
|
2433
2744
|
type: ViewChild,
|
|
2434
2745
|
args: [MatSort]
|
|
@@ -2437,12 +2748,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2437
2748
|
args: [MatPaginator]
|
|
2438
2749
|
}] } });
|
|
2439
2750
|
|
|
2440
|
-
var OrderByDirection;
|
|
2441
|
-
(function (OrderByDirection) {
|
|
2442
|
-
OrderByDirection["ASC"] = "asc";
|
|
2443
|
-
OrderByDirection["DESC"] = "desc";
|
|
2444
|
-
})(OrderByDirection || (OrderByDirection = {}));
|
|
2445
|
-
|
|
2446
2751
|
const BASE_ENTITY_MAPPER = new InjectionToken('BASE_ENTITY_MAPPER');
|
|
2447
2752
|
class SimpleEntityMapper {
|
|
2448
2753
|
entityType;
|
|
@@ -2518,9 +2823,9 @@ let BaseEntityFirestoreService = class BaseEntityFirestoreService {
|
|
|
2518
2823
|
let orderBys = [];
|
|
2519
2824
|
if (queryCondition.orderBys?.length) {
|
|
2520
2825
|
orderBys = queryCondition.orderBys.map((orderByCondition) => {
|
|
2521
|
-
const name = Object.keys(OrderByDirection).
|
|
2522
|
-
const direction = Object.values(OrderByDirection).
|
|
2523
|
-
return orderBy(orderByCondition.property, direction
|
|
2826
|
+
const name = Object.keys(OrderByDirection).find((key) => key === orderByCondition.direction);
|
|
2827
|
+
const direction = Object.values(OrderByDirection).find((value) => value === name);
|
|
2828
|
+
return orderBy(orderByCondition.property, direction);
|
|
2524
2829
|
});
|
|
2525
2830
|
}
|
|
2526
2831
|
let wheres = [];
|
|
@@ -2560,7 +2865,7 @@ let BaseEntityFirestoreService = class BaseEntityFirestoreService {
|
|
|
2560
2865
|
throw new Error('Entity cant be undefined');
|
|
2561
2866
|
const docRef = doc(this.firestore, this.collectionName, entity.id);
|
|
2562
2867
|
await updateDoc(docRef, this.mapEntity(entity));
|
|
2563
|
-
return
|
|
2868
|
+
return entity;
|
|
2564
2869
|
}
|
|
2565
2870
|
};
|
|
2566
2871
|
BaseEntityFirestoreService = __decorate([
|
|
@@ -2639,7 +2944,7 @@ const findByQuery = (store, repository) => {
|
|
|
2639
2944
|
// distinctUntilChanged(),
|
|
2640
2945
|
switchMap((parameters) => repository.findByQuery(parameters).pipe(tapResponse({
|
|
2641
2946
|
next: (response) => {
|
|
2642
|
-
if (Object.
|
|
2947
|
+
if (Object.hasOwn(response, 'content')) {
|
|
2643
2948
|
const baseEntityResponse = response;
|
|
2644
2949
|
patchState(store, {
|
|
2645
2950
|
entities: baseEntityResponse.content,
|
|
@@ -2677,7 +2982,7 @@ function BaseEntityStore(entityType, getRepository) {
|
|
|
2677
2982
|
isLoading: false,
|
|
2678
2983
|
error: undefined,
|
|
2679
2984
|
selectedEntities: [],
|
|
2680
|
-
}),
|
|
2985
|
+
}), withMethods((store, repository = getRepository()) => ({
|
|
2681
2986
|
clearCurrentEntity: () => patchState(store, { currentEntity: undefined }),
|
|
2682
2987
|
createEntity: () => new entityType(),
|
|
2683
2988
|
add: addEntity(store, repository),
|
|
@@ -2732,14 +3037,14 @@ const INITIAL_TABS_STATE = {
|
|
|
2732
3037
|
currentTab: undefined,
|
|
2733
3038
|
};
|
|
2734
3039
|
function BaseEntityTabsStore() {
|
|
2735
|
-
return signalStoreFeature(withState(INITIAL_TABS_STATE),
|
|
3040
|
+
return signalStoreFeature(withState(INITIAL_TABS_STATE), withMethods((store) => {
|
|
2736
3041
|
function reset() {
|
|
2737
3042
|
const activeTabs = [];
|
|
2738
3043
|
patchState(store, { activeTabs, currentTab: undefined });
|
|
2739
3044
|
}
|
|
2740
3045
|
function tabIsActive(tabName) {
|
|
2741
3046
|
let activeTabs;
|
|
2742
|
-
if (store.activeTabs().
|
|
3047
|
+
if (!store.activeTabs().includes(tabName)) {
|
|
2743
3048
|
activeTabs = store.activeTabs().concat([tabName]);
|
|
2744
3049
|
}
|
|
2745
3050
|
else {
|
|
@@ -2766,16 +3071,20 @@ class BaseEntityFacade {
|
|
|
2766
3071
|
_storeInstance;
|
|
2767
3072
|
_descriptor;
|
|
2768
3073
|
get mapper() {
|
|
2769
|
-
|
|
3074
|
+
this._mapper ??= this.createMapper();
|
|
3075
|
+
return this._mapper;
|
|
2770
3076
|
}
|
|
2771
3077
|
get service() {
|
|
2772
|
-
|
|
3078
|
+
this._service ??= this.createService(this.mapper);
|
|
3079
|
+
return this._service;
|
|
2773
3080
|
}
|
|
2774
3081
|
get storeClass() {
|
|
2775
|
-
|
|
3082
|
+
this._storeClass ??= this.createStoreClass();
|
|
3083
|
+
return this._storeClass;
|
|
2776
3084
|
}
|
|
2777
3085
|
get store() {
|
|
2778
|
-
|
|
3086
|
+
this._storeInstance ??= runInInjectionContext(this.injector, () => inject(this.storeClass));
|
|
3087
|
+
return this._storeInstance;
|
|
2779
3088
|
}
|
|
2780
3089
|
get descriptor() {
|
|
2781
3090
|
if (!this._descriptor) {
|
|
@@ -2812,17 +3121,25 @@ class BaseEntityFacade {
|
|
|
2812
3121
|
});
|
|
2813
3122
|
}
|
|
2814
3123
|
createStoreClass() {
|
|
2815
|
-
return signalStore({ providedIn: 'root' }, BaseEntityStore(this.entityType, () => this.service), BaseEntityTabsStore(), BaseEntityContainerStore());
|
|
3124
|
+
return signalStore({ providedIn: 'root' }, BaseEntityStore(this.entityType, () => this.service), BaseEntityTabsStore(), BaseEntityContainerStore(), withDevtools(entityNameFromType(this.entityType)));
|
|
2816
3125
|
}
|
|
2817
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2818
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
3126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3127
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFacade });
|
|
2819
3128
|
}
|
|
2820
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
3129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: BaseEntityFacade, decorators: [{
|
|
2821
3130
|
type: Injectable
|
|
2822
3131
|
}] });
|
|
2823
3132
|
|
|
2824
3133
|
const BASE_ENTITY_SERVICE = new InjectionToken('BASE_ENTITY_SERVICE');
|
|
2825
3134
|
|
|
3135
|
+
function provideEntityRouteRegistry() {
|
|
3136
|
+
return provideAppInitializer(() => {
|
|
3137
|
+
const registry = inject(EntityRouteRegistry);
|
|
3138
|
+
registry.scan();
|
|
3139
|
+
registry.observeLazyLoads();
|
|
3140
|
+
});
|
|
3141
|
+
}
|
|
3142
|
+
|
|
2826
3143
|
// Symbol to store entity options on instance
|
|
2827
3144
|
const ENTITY_OPTIONS_KEY = Symbol('entityOptions');
|
|
2828
3145
|
// Metadata key for storing ID properties
|
|
@@ -2911,5 +3228,5 @@ const BASE_ENTITY_ROUTES = [
|
|
|
2911
3228
|
* Generated bundle index. Do not edit.
|
|
2912
3229
|
*/
|
|
2913
3230
|
|
|
2914
|
-
export { ACTIVE_ENTITY_FACADE, AbstractAttrDescriptor, BASE_ENTITY_FACADE_REGISTRY, BASE_ENTITY_ROUTES, BASE_ENTITY_SERVICE, BASE_ENTITY_STORE, BASE_LIST_DESCRIPTORS, BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityDescriptor, BaseEntityDescriptorRegistry, BaseEntityFacade, BaseEntityFirestoreService, BaseEntityFormComponent, BaseEntityListComponent, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseFormNavigatorSingletonStore, BaseFormNavigatorStore, Entity, EntityRegistryComponent, FlexDirection, FlexboxDescriptor, FormControlType, Id, OrderByDirection, RouteSegments, SimpleEntityMapper, getEntityIds, getEntityOptions, getEnumKeyByValue, getEnumValueByKey };
|
|
3231
|
+
export { ACTIVE_ENTITY_FACADE, AbstractAttrDescriptor, BASE_ENTITY_FACADE_REGISTRY, BASE_ENTITY_ROUTES, BASE_ENTITY_SERVICE, BASE_ENTITY_STORE, BASE_LIST_DESCRIPTORS, BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityDescriptor, BaseEntityDescriptorRegistry, BaseEntityFacade, BaseEntityFirestoreService, BaseEntityFormComponent, BaseEntityListComponent, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseFormNavigatorSingletonStore, BaseFormNavigatorStore, ENTITY_NAME_ROUTE_DATA_KEY, Entity, EntityRegistryComponent, EntityRouteRegistry, FlexDirection, FlexboxDescriptor, FormControlType, Id, NavigatorCommand, OrderByDirection, RULE_ENGINE, RouteSegments, RuleViolationsSingletonStore, SimpleEntityMapper, getEntityIds, getEntityOptions, getEnumKeyByValue, getEnumValueByKey, provideEntityRouteRegistry };
|
|
2915
3232
|
//# sourceMappingURL=processpuzzle-base-entity.mjs.map
|