@processpuzzle/base-app 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/fesm2022/processpuzzle-base-app.mjs +2504 -2148
- package/fesm2022/processpuzzle-base-app.mjs.map +1 -1
- package/package.json +4 -4
- package/types/processpuzzle-base-app.d.ts +803 -699
- package/types/processpuzzle-base-app.d.ts.map +1 -1
- package/theme/pp-material-themes.scss +0 -81
|
@@ -1,1731 +1,1636 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const SIDENAV_MODES = ['side', 'over', 'push'];
|
|
43
|
-
/**
|
|
44
|
-
* No `content`: once routes own the content area it *is* the router outlet, so a content region would
|
|
45
|
-
* have no field of its own — `widgets` is header/footer-only and `navItems` sidenav-only. Its sizing
|
|
46
|
-
* lives in {@link LayoutDefinition.contentMaxWidth}.
|
|
47
|
-
*/
|
|
48
|
-
const REGION_TYPES = ['header', 'sidenav', 'footer'];
|
|
49
|
-
/**
|
|
50
|
-
* What a route renders. Uppercase because the contract's enum is — `RegionType` and the theme enums
|
|
51
|
-
* are lowercase, and mixing the two up is a silent miss rather than a type error once a value reaches
|
|
52
|
-
* JSON.
|
|
53
|
-
*/
|
|
54
|
-
const ROUTE_TARGET_KINDS = ['WIDGETS', 'DOCUMENT', 'ENTITY'];
|
|
55
|
-
const ENTITY_MODES = ['LIST', 'DETAILS'];
|
|
1
|
+
import { APPLICATION_CONTEXT, SidenavAutosizeDirective, THEME_COLOR_SCHEMES, THEME_PRESETS, ThemeService, WIDGET_PLACEMENTS, WidgetHostComponent, WidgetInstance, WidgetPlacement, createWidgetPropsAttrDescriptor } from "@processpuzzle/widgets";
|
|
2
|
+
import { BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityDescriptor, BaseEntityFacade, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseUrlSegments, EmbeddedEntityFacade, EntityLabelPipe, EntityScreenResolver, FlexDirection, FlexboxDescriptor, FormControlType, baseEntityRoutes, entityScreenRoute, toSelectables, translateLabel } from "@processpuzzle/base-entity";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Component, ElementRef, Injectable, ViewChild, computed, effect, inject, input, signal, viewChild } from "@angular/core";
|
|
5
|
+
import { firstValueFrom, map } from "rxjs";
|
|
6
|
+
import { patchState, signalStore, signalStoreFeature, type, withMethods } from "@ngrx/signals";
|
|
7
|
+
import { withDevtools } from "@angular-architects/ngrx-toolkit";
|
|
8
|
+
import { LayoutService, httpErrorMessage } from "@processpuzzle/util";
|
|
9
|
+
import { TranslocoPipe, TranslocoService, provideTranslocoScope } from "@jsverse/transloco";
|
|
10
|
+
import { ActivatedRoute, RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router";
|
|
11
|
+
import { MatButton } from "@angular/material/button";
|
|
12
|
+
import { MatTooltip } from "@angular/material/tooltip";
|
|
13
|
+
import { Dialog } from "@angular/cdk/dialog";
|
|
14
|
+
import { OverlayContainer } from "@angular/cdk/overlay";
|
|
15
|
+
import { NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
|
|
16
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
17
|
+
import { MatSidenav, MatSidenavContainer, MatSidenavContent } from "@angular/material/sidenav";
|
|
18
|
+
import { MatListItem, MatListItemIcon, MatListItemTitle, MatNavList } from "@angular/material/list";
|
|
19
|
+
const MATERIAL_THEMES = THEME_PRESETS;
|
|
20
|
+
const COLOR_SCHEMES = THEME_COLOR_SCHEMES;
|
|
21
|
+
const LAYOUT_PRESETS = [
|
|
22
|
+
"sidenav-left",
|
|
23
|
+
"sidenav-right",
|
|
24
|
+
"top-nav"
|
|
25
|
+
];
|
|
26
|
+
const SIDENAV_MODES = [
|
|
27
|
+
"side",
|
|
28
|
+
"over",
|
|
29
|
+
"push"
|
|
30
|
+
];
|
|
31
|
+
const REGION_TYPES = [
|
|
32
|
+
"header",
|
|
33
|
+
"sidenav",
|
|
34
|
+
"footer"
|
|
35
|
+
];
|
|
36
|
+
const ROUTE_TARGET_KINDS = [
|
|
37
|
+
"WIDGETS",
|
|
38
|
+
"DOCUMENT",
|
|
39
|
+
"ENTITY"
|
|
40
|
+
];
|
|
41
|
+
const ENTITY_MODES = ["LIST", "DETAILS"];
|
|
56
42
|
var AppDefinitionStatus;
|
|
57
|
-
(function
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
(function(AppDefinitionStatus) {
|
|
44
|
+
AppDefinitionStatus["DRAFT"] = "DRAFT";
|
|
45
|
+
AppDefinitionStatus["PUBLISHED"] = "PUBLISHED";
|
|
60
46
|
})(AppDefinitionStatus || (AppDefinitionStatus = {}));
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.translocoId = init.translocoId;
|
|
204
|
-
this.description = init.description;
|
|
205
|
-
this.materialTheme = init.materialTheme;
|
|
206
|
-
this.colorScheme = init.colorScheme;
|
|
207
|
-
this.tokenOverrides = init.tokenOverrides;
|
|
208
|
-
this.logoUrl = init.logoUrl;
|
|
209
|
-
this.faviconUrl = init.faviconUrl;
|
|
210
|
-
this.preset = init.preset;
|
|
211
|
-
this.sidenavMode = init.sidenavMode;
|
|
212
|
-
this.sidenavCollapsible = init.sidenavCollapsible ?? true;
|
|
213
|
-
this.sidenavOpenByDefault = init.sidenavOpenByDefault ?? true;
|
|
214
|
-
this.contentMaxWidth = init.contentMaxWidth;
|
|
215
|
-
this.theme = init.theme;
|
|
216
|
-
this.layout = init.layout;
|
|
217
|
-
this.regions = init.regions;
|
|
218
|
-
this.routes = init.routes;
|
|
219
|
-
this.modules = init.modules;
|
|
220
|
-
this.orgKey = init.orgKey;
|
|
221
|
-
this.status = init.status;
|
|
222
|
-
this.version = init.version;
|
|
223
|
-
this.publishedVersion = init.publishedVersion;
|
|
224
|
-
this.createdAt = init.createdAt;
|
|
225
|
-
this.updatedAt = init.updatedAt;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Frontend model of the `ModuleDefinition` schema of `base-app-api.yaml`: a lazily-loadable slice of an
|
|
231
|
-
* application, with its own flat route list and its own transloco scope. An {@link ModuleMount} of an
|
|
232
|
-
* `AppDefinition` names one of these by key and mounts its routes under a base path.
|
|
233
|
-
*
|
|
234
|
-
* **What "lazy" honestly means.** A module lazy-loads *metadata* — this definition, its routes, its
|
|
235
|
-
* translations, and the documents and descriptors they name. It does **not** lazy-load widget code:
|
|
236
|
-
* widget components are bundled at compile time and resolved through the frontend registry, so a
|
|
237
|
-
* metadata module cannot split a bundle on its own. The wins are that `AppDefinition` stops being one
|
|
238
|
-
* aggregate that has to be loaded, locked and published atomically, and that a module is the unit of
|
|
239
|
-
* authoring permission and versioning. Nothing here should be justified on bundle size.
|
|
240
|
-
*
|
|
241
|
-
* Unlike the region / route / mount classes this one is a **routable** entity: it has endpoints of its
|
|
242
|
-
* own, so it comes with a service, a store and a facade rather than travelling inside another payload.
|
|
243
|
-
*/
|
|
244
|
-
class ModuleDefinition {
|
|
245
|
-
/**
|
|
246
|
-
* The contract calls this field `key`; base-entity keys every store, URL and reference on `id`, so
|
|
247
|
-
* {@link ModuleDefinitionMapper} renames it on the way in and out rather than teaching the framework a
|
|
248
|
-
* second identity field. One name for one thing on this side of the mapper — a `key` property beside
|
|
249
|
-
* `id` could only ever disagree with it.
|
|
250
|
-
*
|
|
251
|
-
* Immutable by contract: `ModuleMount.moduleKey` resolves against it, and a rename would silently
|
|
252
|
-
* unmount the module from every app that mounts it.
|
|
253
|
-
*/
|
|
254
|
-
id;
|
|
255
|
-
name;
|
|
256
|
-
translocoId;
|
|
257
|
-
description;
|
|
258
|
-
/**
|
|
259
|
-
* Transloco scope the module's translations load under. Absent means {@link id}, which is the default
|
|
260
|
-
* the contract states; {@link moduleTranslocoScope} is the one place that default is applied.
|
|
261
|
-
*/
|
|
262
|
-
translocoScope;
|
|
263
|
-
/**
|
|
264
|
-
* The module's routes, flat and relative to the base path it is mounted at — the same shape and the
|
|
265
|
-
* same derived nesting as `AppDefinition.routes`, and flattened by the same mapper. A module does not
|
|
266
|
-
* mount modules: this is where composition stops.
|
|
267
|
-
*/
|
|
268
|
-
routes;
|
|
269
|
-
// region server-assigned
|
|
270
|
-
orgKey;
|
|
271
|
-
version;
|
|
272
|
-
createdAt;
|
|
273
|
-
updatedAt;
|
|
274
|
-
// endregion
|
|
275
|
-
constructor(init = {}) {
|
|
276
|
-
this.id = init.id ?? '';
|
|
277
|
-
this.name = init.name ?? '';
|
|
278
|
-
this.translocoId = init.translocoId;
|
|
279
|
-
this.description = init.description;
|
|
280
|
-
this.translocoScope = init.translocoScope;
|
|
281
|
-
this.routes = init.routes;
|
|
282
|
-
this.orgKey = init.orgKey;
|
|
283
|
-
this.version = init.version;
|
|
284
|
-
this.createdAt = init.createdAt;
|
|
285
|
-
this.updatedAt = init.updatedAt;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* The scope a module's translations load under, applying the contract's default. Kept as a function
|
|
290
|
-
* rather than resolved in the mapper, so a definition never carries a `translocoScope` the designer did
|
|
291
|
-
* not author — the field stays empty in the form, and the fallback is a rendering decision.
|
|
292
|
-
*/
|
|
47
|
+
var NavItem = class {
|
|
48
|
+
id;
|
|
49
|
+
label;
|
|
50
|
+
translocoId;
|
|
51
|
+
icon;
|
|
52
|
+
routePath;
|
|
53
|
+
roles;
|
|
54
|
+
children;
|
|
55
|
+
constructor(init = {}) {
|
|
56
|
+
this.id = init.id ?? "";
|
|
57
|
+
this.label = init.label ?? "";
|
|
58
|
+
this.translocoId = init.translocoId;
|
|
59
|
+
this.icon = init.icon;
|
|
60
|
+
this.routePath = init.routePath;
|
|
61
|
+
this.roles = init.roles;
|
|
62
|
+
this.children = init.children;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var RegionDefinition = class {
|
|
66
|
+
type;
|
|
67
|
+
navItems;
|
|
68
|
+
widgets;
|
|
69
|
+
constructor(init = {}) {
|
|
70
|
+
this.type = init.type;
|
|
71
|
+
this.navItems = init.navItems;
|
|
72
|
+
this.widgets = init.widgets;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var RouteDefinition = class {
|
|
76
|
+
path;
|
|
77
|
+
title;
|
|
78
|
+
translocoId;
|
|
79
|
+
icon;
|
|
80
|
+
roles;
|
|
81
|
+
kind;
|
|
82
|
+
widgets;
|
|
83
|
+
documentSlug;
|
|
84
|
+
entityName;
|
|
85
|
+
entityMode;
|
|
86
|
+
rsqlFilter;
|
|
87
|
+
target;
|
|
88
|
+
constructor(init = {}) {
|
|
89
|
+
this.path = init.path ?? "";
|
|
90
|
+
this.title = init.title ?? "";
|
|
91
|
+
this.translocoId = init.translocoId;
|
|
92
|
+
this.icon = init.icon;
|
|
93
|
+
this.roles = init.roles;
|
|
94
|
+
this.kind = init.kind;
|
|
95
|
+
this.widgets = init.widgets ?? [];
|
|
96
|
+
this.documentSlug = init.documentSlug;
|
|
97
|
+
this.entityName = init.entityName;
|
|
98
|
+
this.entityMode = init.entityMode;
|
|
99
|
+
this.rsqlFilter = init.rsqlFilter;
|
|
100
|
+
this.target = init.target;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var ModuleMount = class {
|
|
104
|
+
moduleKey;
|
|
105
|
+
basePath;
|
|
106
|
+
constructor(init = {}) {
|
|
107
|
+
this.moduleKey = init.moduleKey ?? "";
|
|
108
|
+
this.basePath = init.basePath ?? "";
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var AppDefinition = class {
|
|
112
|
+
id;
|
|
113
|
+
name;
|
|
114
|
+
translocoId;
|
|
115
|
+
description;
|
|
116
|
+
materialTheme;
|
|
117
|
+
colorScheme;
|
|
118
|
+
tokenOverrides;
|
|
119
|
+
logoUrl;
|
|
120
|
+
faviconUrl;
|
|
121
|
+
preset;
|
|
122
|
+
sidenavMode;
|
|
123
|
+
sidenavCollapsible;
|
|
124
|
+
sidenavOpenByDefault;
|
|
125
|
+
contentMaxWidth;
|
|
126
|
+
theme;
|
|
127
|
+
layout;
|
|
128
|
+
regions;
|
|
129
|
+
routes;
|
|
130
|
+
modules;
|
|
131
|
+
orgKey;
|
|
132
|
+
status;
|
|
133
|
+
version;
|
|
134
|
+
publishedVersion;
|
|
135
|
+
createdAt;
|
|
136
|
+
updatedAt;
|
|
137
|
+
constructor(init = {}) {
|
|
138
|
+
this.id = init.id ?? "";
|
|
139
|
+
this.name = init.name ?? "";
|
|
140
|
+
this.translocoId = init.translocoId;
|
|
141
|
+
this.description = init.description;
|
|
142
|
+
this.materialTheme = init.materialTheme;
|
|
143
|
+
this.colorScheme = init.colorScheme;
|
|
144
|
+
this.tokenOverrides = init.tokenOverrides;
|
|
145
|
+
this.logoUrl = init.logoUrl;
|
|
146
|
+
this.faviconUrl = init.faviconUrl;
|
|
147
|
+
this.preset = init.preset;
|
|
148
|
+
this.sidenavMode = init.sidenavMode;
|
|
149
|
+
this.sidenavCollapsible = init.sidenavCollapsible ?? true;
|
|
150
|
+
this.sidenavOpenByDefault = init.sidenavOpenByDefault ?? true;
|
|
151
|
+
this.contentMaxWidth = init.contentMaxWidth;
|
|
152
|
+
this.theme = init.theme;
|
|
153
|
+
this.layout = init.layout;
|
|
154
|
+
this.regions = init.regions;
|
|
155
|
+
this.routes = init.routes;
|
|
156
|
+
this.modules = init.modules;
|
|
157
|
+
this.orgKey = init.orgKey;
|
|
158
|
+
this.status = init.status;
|
|
159
|
+
this.version = init.version;
|
|
160
|
+
this.publishedVersion = init.publishedVersion;
|
|
161
|
+
this.createdAt = init.createdAt;
|
|
162
|
+
this.updatedAt = init.updatedAt;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var ModuleDefinition = class {
|
|
166
|
+
id;
|
|
167
|
+
name;
|
|
168
|
+
translocoId;
|
|
169
|
+
description;
|
|
170
|
+
translocoScope;
|
|
171
|
+
routes;
|
|
172
|
+
orgKey;
|
|
173
|
+
version;
|
|
174
|
+
createdAt;
|
|
175
|
+
updatedAt;
|
|
176
|
+
constructor(init = {}) {
|
|
177
|
+
this.id = init.id ?? "";
|
|
178
|
+
this.name = init.name ?? "";
|
|
179
|
+
this.translocoId = init.translocoId;
|
|
180
|
+
this.description = init.description;
|
|
181
|
+
this.translocoScope = init.translocoScope;
|
|
182
|
+
this.routes = init.routes;
|
|
183
|
+
this.orgKey = init.orgKey;
|
|
184
|
+
this.version = init.version;
|
|
185
|
+
this.createdAt = init.createdAt;
|
|
186
|
+
this.updatedAt = init.updatedAt;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
293
189
|
function moduleTranslocoScope(definition) {
|
|
294
|
-
|
|
190
|
+
return definition.translocoScope?.trim() || definition.id;
|
|
295
191
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
* Transloco scope of this library. The translations live in
|
|
299
|
-
* `libs/js-shared/base-app-frontend/src/assets/i18n/base_app/*.json` and are published with the
|
|
300
|
-
* package; a consuming application copies them to `assets/i18n/base_app` (see the testbed's
|
|
301
|
-
* `project.json`). The scope is registered on {@link BASE_APP_ROUTES}, so it loads lazily with the
|
|
302
|
-
* route rather than with the application shell.
|
|
303
|
-
*
|
|
304
|
-
* The alias is spelled out on purpose: transloco camel-cases the default alias, which would turn
|
|
305
|
-
* `base_app` into `baseApp` and silently miss every key below.
|
|
306
|
-
*/
|
|
307
|
-
const BASE_APP_TRANSLOCO_SCOPE = 'base_app';
|
|
308
|
-
/**
|
|
309
|
-
* Scope of the generic framework labels (`base_entity.tabs.*`, `base_entity.toolbar.*`), whose files
|
|
310
|
-
* base-entity owns. It has to be registered next to {@link BASE_APP_TRANSLOCO_SCOPE} wherever the
|
|
311
|
-
* generic screens are hosted: `BaseEntityTabsComponent` translates from it through `TranslocoPipe`,
|
|
312
|
-
* which caches the value it resolved for a key on first render. If only `base_app` were loaded, the
|
|
313
|
-
* tabs would keep the raw key even after the toolbar — which registers this scope for itself —
|
|
314
|
-
* triggers the load.
|
|
315
|
-
*/
|
|
316
|
-
const BASE_ENTITY_TRANSLOCO_SCOPE = 'base_entity';
|
|
317
|
-
/** Key root of the `AppDefinition` entity name (`._self`) and of its attribute labels. */
|
|
192
|
+
const BASE_APP_TRANSLOCO_SCOPE = "base_app";
|
|
193
|
+
const BASE_ENTITY_TRANSLOCO_SCOPE = "base_entity";
|
|
318
194
|
const APP_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_definition`;
|
|
319
|
-
/**
|
|
320
|
-
* Label of the Preview tab. Under this library's own scope rather than `base_entity.tabs.*`: the generic
|
|
321
|
-
* tabs are List and Details, and an application preview is this feature's contribution, not the framework's.
|
|
322
|
-
* Resolved with `{ entity }` like the generic tab labels, so a translation may name the entity if it reads
|
|
323
|
-
* better that way.
|
|
324
|
-
*/
|
|
325
195
|
const APP_PREVIEW_I18N_KEY = `${APP_DEFINITION_I18N_SCOPE}.tabs.preview`;
|
|
326
|
-
/**
|
|
327
|
-
* Key root of the `ModuleDefinition` entity name and attribute labels. A child of this library's scope
|
|
328
|
-
* like the one above, and not to be confused with `ModuleDefinition.translocoScope`, which is a scope an
|
|
329
|
-
* *authored* module's own translations load under — see {@link moduleTranslocoScope}. These keys are the
|
|
330
|
-
* framework's labels for the authoring form; that one is the tenant's content.
|
|
331
|
-
*/
|
|
332
196
|
const MODULE_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.module_definition`;
|
|
333
|
-
/**
|
|
334
|
-
* Key roots of the nested definitions the `AppDefinition` form contains through `EMBEDDED_COMPONENTS`
|
|
335
|
-
* controls. They are children of {@link BASE_APP_TRANSLOCO_SCOPE} rather than scopes of their own,
|
|
336
|
-
* because the whole graph is edited under `BASE_APP_ROUTES` and one scope registration has to cover
|
|
337
|
-
* all of it — the embedded route branches add none.
|
|
338
|
-
*/
|
|
339
197
|
const APP_REGION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_region`;
|
|
340
198
|
const APP_ROUTE_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_route`;
|
|
341
199
|
const APP_MODULE_MOUNT_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_module_mount`;
|
|
342
200
|
const APP_NAV_ITEM_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_nav_item`;
|
|
343
201
|
const APP_WIDGET_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_widget`;
|
|
344
|
-
/** Keys of the `Publish` form action contributed by `AppDefinitionContainerComponent`. */
|
|
345
202
|
const PUBLISH_BUTTON_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.button`;
|
|
346
203
|
const PUBLISH_TOOLTIP_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.tooltip`;
|
|
347
|
-
/**
|
|
348
|
-
* Where this library's transloco bundles come from when the application ships without its assets.
|
|
349
|
-
*
|
|
350
|
-
* Spread into the application's `TRANSLATION_SOURCE_REGISTRY`, the way its facades are spread into
|
|
351
|
-
* `BASE_ENTITY_FACADE_REGISTRY`. The scopes below normally arrive as static files — the build copies
|
|
352
|
-
* them into `assets/i18n/<scope>` and the loader tries the asset first — so this is reached only by a
|
|
353
|
-
* host that skips that copy step. It is declared here rather than in the application because which
|
|
354
|
-
* backend owns a scope is base-app's knowledge, not its caller's.
|
|
355
|
-
*/
|
|
356
204
|
const BASE_APP_TRANSLATION_SOURCE = {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
205
|
+
scopes: ["base_app"],
|
|
206
|
+
serviceRootKey: "APP_SERVICE_ROOT",
|
|
207
|
+
segment: "app"
|
|
360
208
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
const APP_DEFINITION_ENTITY_NAME = 'App Definition';
|
|
370
|
-
/**
|
|
371
|
-
* A second aggregate root beside `App Definition`, not a part of it — hence no `App` prefix, which in
|
|
372
|
-
* every other name here marks something the app document carries. `App Module Mount` is the row inside
|
|
373
|
-
* an app that *names* one of these.
|
|
374
|
-
*/
|
|
375
|
-
const MODULE_DEFINITION_ENTITY_NAME = 'Module Definition';
|
|
376
|
-
const APP_MODULE_MOUNT_ENTITY_NAME = 'App Module Mount';
|
|
377
|
-
const APP_NAV_ITEM_ENTITY_NAME = 'App Nav Item';
|
|
378
|
-
const APP_REGION_ENTITY_NAME = 'App Region';
|
|
379
|
-
const APP_ROUTE_ENTITY_NAME = 'App Route';
|
|
380
|
-
const APP_WIDGET_ENTITY_NAME = 'App Widget';
|
|
381
|
-
|
|
382
|
-
/** `ModuleMount` has no `id` — an app mounts a given module once, so `moduleKey` identifies the row. */
|
|
383
|
-
const APP_MODULE_MOUNT_ID_FIELD = 'moduleKey';
|
|
209
|
+
const APP_DEFINITION_ENTITY_NAME = "App Definition";
|
|
210
|
+
const MODULE_DEFINITION_ENTITY_NAME = "Module Definition";
|
|
211
|
+
const APP_MODULE_MOUNT_ENTITY_NAME = "App Module Mount";
|
|
212
|
+
const APP_NAV_ITEM_ENTITY_NAME = "App Nav Item";
|
|
213
|
+
const APP_REGION_ENTITY_NAME = "App Region";
|
|
214
|
+
const APP_ROUTE_ENTITY_NAME = "App Route";
|
|
215
|
+
const APP_WIDGET_ENTITY_NAME = "App Widget";
|
|
216
|
+
const APP_MODULE_MOUNT_ID_FIELD = "moduleKey";
|
|
384
217
|
function createModuleMountAttrDescriptors() {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const flexBoxContainer = new FlexboxDescriptor([moduleKeyAttr, basePathAttr], FlexDirection.ROW);
|
|
401
|
-
flexBoxContainer.style = { 'column-gap': '10px', width: 'fit-content' };
|
|
402
|
-
return [flexBoxContainer];
|
|
218
|
+
const moduleKeyAttr = new BaseEntityAttrDescriptor("moduleKey", FormControlType.TEXT_BOX, "Module Key", void 0, true);
|
|
219
|
+
moduleKeyAttr.required = true;
|
|
220
|
+
moduleKeyAttr.isHeading = true;
|
|
221
|
+
moduleKeyAttr.placeholder = "Key of a module definition of this organization";
|
|
222
|
+
moduleKeyAttr.pattern = "^[a-z0-9]+(-[a-z0-9]+)*$";
|
|
223
|
+
const basePathAttr = new BaseEntityAttrDescriptor("basePath", FormControlType.TEXT_BOX, "Base Path");
|
|
224
|
+
basePathAttr.required = true;
|
|
225
|
+
basePathAttr.placeholder = "The module routes are mounted under this prefix, e.g. claims";
|
|
226
|
+
basePathAttr.pattern = "^[a-z0-9][a-z0-9\\-/]*$";
|
|
227
|
+
const flexBoxContainer = new FlexboxDescriptor([moduleKeyAttr, basePathAttr], FlexDirection.ROW);
|
|
228
|
+
flexBoxContainer.style = {
|
|
229
|
+
"column-gap": "10px",
|
|
230
|
+
width: "fit-content"
|
|
231
|
+
};
|
|
232
|
+
return [flexBoxContainer];
|
|
403
233
|
}
|
|
404
234
|
function createModuleMountDescriptor() {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* `RegionDefinition` has no `id` — a region is identified by the shell slot it fills, and an app
|
|
416
|
-
* declares each slot at most once. Referencing attributes therefore have to set
|
|
417
|
-
* `referenceIdField = 'type'`; see the `regions` attribute of the `AppDefinition` descriptor.
|
|
418
|
-
*/
|
|
419
|
-
const APP_REGION_ID_FIELD = 'type';
|
|
235
|
+
return new BaseEntityDescriptor({
|
|
236
|
+
entityName: APP_MODULE_MOUNT_ENTITY_NAME,
|
|
237
|
+
attrDescriptors: createModuleMountAttrDescriptors(),
|
|
238
|
+
i18nScope: APP_MODULE_MOUNT_I18N_SCOPE,
|
|
239
|
+
componentParent: APP_DEFINITION_ENTITY_NAME,
|
|
240
|
+
isEmbedded: true
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
const APP_REGION_ID_FIELD = "type";
|
|
420
244
|
function createRegionDefinitionAttrDescriptors() {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
245
|
+
const typeAttr = new BaseEntityAttrDescriptor("type", FormControlType.DROPDOWN, "Type", toSelectables(REGION_TYPES), true);
|
|
246
|
+
typeAttr.required = true;
|
|
247
|
+
typeAttr.isHeading = true;
|
|
248
|
+
const navItemsAttr = new BaseEntityAttrDescriptor("navItems", FormControlType.EMBEDDED_COMPONENTS, "Nav Items");
|
|
249
|
+
navItemsAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;
|
|
250
|
+
navItemsAttr.hideInTable = true;
|
|
251
|
+
const widgetsAttr = new BaseEntityAttrDescriptor("widgets", FormControlType.EMBEDDED_COMPONENTS, "Widgets");
|
|
252
|
+
widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;
|
|
253
|
+
widgetsAttr.hideInTable = true;
|
|
254
|
+
const flexBoxContainer = new FlexboxDescriptor([
|
|
255
|
+
typeAttr,
|
|
256
|
+
navItemsAttr,
|
|
257
|
+
widgetsAttr
|
|
258
|
+
], FlexDirection.COLUMN);
|
|
259
|
+
flexBoxContainer.style = {
|
|
260
|
+
"row-gap": "5px",
|
|
261
|
+
width: "fit-content"
|
|
262
|
+
};
|
|
263
|
+
return [flexBoxContainer];
|
|
437
264
|
}
|
|
438
265
|
function createRegionDefinitionDescriptor() {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* `RouteDefinition` has no `id` — `path` identifies a route, and it is what a `NavItem.routePath`
|
|
450
|
-
* resolves against. Referencing attributes therefore have to set `referenceIdField = 'path'`; see the
|
|
451
|
-
* `routePath` attribute of the `App Nav Item` descriptor.
|
|
452
|
-
*
|
|
453
|
-
* Unlike `App Region`'s `type`, this value may contain `/`, so the authoring URL that addresses one row
|
|
454
|
-
* carries it percent-encoded (`app-route/claims%2Fopen/details`). Angular round-trips that, but a
|
|
455
|
-
* reverse proxy that normalizes `%2F` before the SPA sees it would not — worth an e2e case once
|
|
456
|
-
* multi-segment routes are authored in the testbed.
|
|
457
|
-
*/
|
|
458
|
-
const APP_ROUTE_ID_FIELD = 'path';
|
|
266
|
+
return new BaseEntityDescriptor({
|
|
267
|
+
entityName: APP_REGION_ENTITY_NAME,
|
|
268
|
+
attrDescriptors: createRegionDefinitionAttrDescriptors(),
|
|
269
|
+
i18nScope: APP_REGION_I18N_SCOPE,
|
|
270
|
+
componentParent: APP_DEFINITION_ENTITY_NAME,
|
|
271
|
+
isEmbedded: true
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const APP_ROUTE_ID_FIELD = "path";
|
|
459
275
|
function createRouteDefinitionAttrDescriptors() {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
276
|
+
const pathAttr = new BaseEntityAttrDescriptor("path", FormControlType.TEXT_BOX, "Path", void 0, true);
|
|
277
|
+
pathAttr.required = true;
|
|
278
|
+
pathAttr.placeholder = "Relative to the app root, e.g. claims/open or claims/:id";
|
|
279
|
+
pathAttr.pattern = "^[a-z0-9:][a-z0-9\\-:/]*$";
|
|
280
|
+
const titleAttr = new BaseEntityAttrDescriptor("title", FormControlType.TEXT_BOX, "Title");
|
|
281
|
+
titleAttr.required = true;
|
|
282
|
+
titleAttr.isHeading = true;
|
|
283
|
+
const translocoIdAttr = new BaseEntityAttrDescriptor("translocoId", FormControlType.TEXT_BOX, "Transloco Id");
|
|
284
|
+
translocoIdAttr.placeholder = "Translation key of the route title";
|
|
285
|
+
translocoIdAttr.hideInTable = true;
|
|
286
|
+
const iconAttr = new BaseEntityAttrDescriptor("icon", FormControlType.TEXT_BOX, "Icon");
|
|
287
|
+
iconAttr.placeholder = "Material or FontAwesome icon name";
|
|
288
|
+
iconAttr.hideInTable = true;
|
|
289
|
+
const rolesAttr = new BaseEntityAttrDescriptor("roles", FormControlType.TAGS, "Roles");
|
|
290
|
+
rolesAttr.placeholder = "Empty means any authenticated member of the organization";
|
|
291
|
+
rolesAttr.hideInTable = true;
|
|
292
|
+
const kindAttr = new BaseEntityAttrDescriptor("kind", FormControlType.DROPDOWN, "Renders", toSelectables(ROUTE_TARGET_KINDS));
|
|
293
|
+
kindAttr.required = true;
|
|
294
|
+
const widgetsAttr = new BaseEntityAttrDescriptor("widgets", FormControlType.EMBEDDED_COMPONENTS, "Widgets");
|
|
295
|
+
widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;
|
|
296
|
+
widgetsAttr.hideInTable = true;
|
|
297
|
+
const documentSlugAttr = new BaseEntityAttrDescriptor("documentSlug", FormControlType.TEXT_BOX, "Document Slug");
|
|
298
|
+
documentSlugAttr.placeholder = "DOCUMENT only: slug of the document to render";
|
|
299
|
+
documentSlugAttr.hideInTable = true;
|
|
300
|
+
const entityNameAttr = new BaseEntityAttrDescriptor("entityName", FormControlType.TEXT_BOX, "Entity Name");
|
|
301
|
+
entityNameAttr.placeholder = "ENTITY only: name of the descriptor to generate the screen from";
|
|
302
|
+
entityNameAttr.hideInTable = true;
|
|
303
|
+
const entityModeAttr = new BaseEntityAttrDescriptor("entityMode", FormControlType.DROPDOWN, "Entity Mode", toSelectables(ENTITY_MODES));
|
|
304
|
+
entityModeAttr.hideInTable = true;
|
|
305
|
+
const rsqlFilterAttr = new BaseEntityAttrDescriptor("rsqlFilter", FormControlType.TEXT_BOX, "Rsql Filter");
|
|
306
|
+
rsqlFilterAttr.placeholder = "ENTITY + LIST only: RSQL the list is pre-filtered with";
|
|
307
|
+
rsqlFilterAttr.hideInTable = true;
|
|
308
|
+
const identityRow = new FlexboxDescriptor([
|
|
309
|
+
pathAttr,
|
|
310
|
+
titleAttr,
|
|
311
|
+
translocoIdAttr
|
|
312
|
+
], FlexDirection.ROW);
|
|
313
|
+
identityRow.style = { "column-gap": "10px" };
|
|
314
|
+
const presentationRow = new FlexboxDescriptor([iconAttr, kindAttr], FlexDirection.ROW);
|
|
315
|
+
presentationRow.style = { "column-gap": "10px" };
|
|
316
|
+
const documentRow = new FlexboxDescriptor([documentSlugAttr], FlexDirection.ROW);
|
|
317
|
+
documentRow.style = { "column-gap": "10px" };
|
|
318
|
+
const entityRow = new FlexboxDescriptor([
|
|
319
|
+
entityNameAttr,
|
|
320
|
+
entityModeAttr,
|
|
321
|
+
rsqlFilterAttr
|
|
322
|
+
], FlexDirection.ROW);
|
|
323
|
+
entityRow.style = { "column-gap": "10px" };
|
|
324
|
+
const flexBoxContainer = new FlexboxDescriptor([
|
|
325
|
+
identityRow,
|
|
326
|
+
presentationRow,
|
|
327
|
+
rolesAttr,
|
|
328
|
+
documentRow,
|
|
329
|
+
entityRow,
|
|
330
|
+
widgetsAttr
|
|
331
|
+
], FlexDirection.COLUMN);
|
|
332
|
+
flexBoxContainer.style = {
|
|
333
|
+
"row-gap": "5px",
|
|
334
|
+
width: "fit-content"
|
|
335
|
+
};
|
|
336
|
+
return [flexBoxContainer];
|
|
512
337
|
}
|
|
513
338
|
function createRouteDefinitionDescriptor() {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
componentParent: [APP_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME],
|
|
522
|
-
isEmbedded: true,
|
|
523
|
-
});
|
|
339
|
+
return new BaseEntityDescriptor({
|
|
340
|
+
entityName: APP_ROUTE_ENTITY_NAME,
|
|
341
|
+
attrDescriptors: createRouteDefinitionAttrDescriptors(),
|
|
342
|
+
i18nScope: APP_ROUTE_I18N_SCOPE,
|
|
343
|
+
componentParent: [APP_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME],
|
|
344
|
+
isEmbedded: true
|
|
345
|
+
});
|
|
524
346
|
}
|
|
525
|
-
|
|
526
347
|
const statusSelectables = toSelectables(Object.keys(AppDefinitionStatus));
|
|
527
348
|
function createAppDefinitionAttrDescriptors() {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
349
|
+
const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id");
|
|
350
|
+
idAttr.required = true;
|
|
351
|
+
idAttr.placeholder = "Unique within the organization, e.g. claims-app";
|
|
352
|
+
const nameAttr = new BaseEntityAttrDescriptor("name", FormControlType.TEXT_BOX, "Name", void 0, true);
|
|
353
|
+
nameAttr.required = true;
|
|
354
|
+
nameAttr.isHeading = true;
|
|
355
|
+
const translocoIdAttr = new BaseEntityAttrDescriptor("translocoId", FormControlType.TEXT_BOX, "Transloco Id");
|
|
356
|
+
translocoIdAttr.placeholder = "Translation key of the application name";
|
|
357
|
+
translocoIdAttr.hideInTable = true;
|
|
358
|
+
const descriptionAttr = new BaseEntityAttrDescriptor("description", FormControlType.TEXTAREA, "Description");
|
|
359
|
+
descriptionAttr.styleClass = "full-width";
|
|
360
|
+
descriptionAttr.hideInTable = true;
|
|
361
|
+
const statusAttr = new BaseEntityAttrDescriptor("status", FormControlType.DROPDOWN, "Status", statusSelectables);
|
|
362
|
+
statusAttr.disabled = true;
|
|
363
|
+
const versionAttr = new BaseEntityAttrDescriptor("version", FormControlType.TEXT_BOX, "Version");
|
|
364
|
+
versionAttr.disabled = true;
|
|
365
|
+
const publishedVersionAttr = new BaseEntityAttrDescriptor("publishedVersion", FormControlType.TEXT_BOX, "Published Version");
|
|
366
|
+
publishedVersionAttr.disabled = true;
|
|
367
|
+
const updatedAtAttr = new BaseEntityAttrDescriptor("updatedAt", FormControlType.TEXT_BOX, "Updated At");
|
|
368
|
+
updatedAtAttr.disabled = true;
|
|
369
|
+
const materialThemeAttr = new BaseEntityAttrDescriptor("materialTheme", FormControlType.DROPDOWN, "Material Theme", toSelectables(MATERIAL_THEMES));
|
|
370
|
+
materialThemeAttr.hideInTable = true;
|
|
371
|
+
const colorSchemeAttr = new BaseEntityAttrDescriptor("colorScheme", FormControlType.DROPDOWN, "Color Scheme", toSelectables(COLOR_SCHEMES));
|
|
372
|
+
colorSchemeAttr.hideInTable = true;
|
|
373
|
+
const logoUrlAttr = new BaseEntityAttrDescriptor("logoUrl", FormControlType.TEXT_BOX, "Logo Url");
|
|
374
|
+
logoUrlAttr.placeholder = "Tenant logo shown in the header region";
|
|
375
|
+
logoUrlAttr.hideInTable = true;
|
|
376
|
+
const faviconUrlAttr = new BaseEntityAttrDescriptor("faviconUrl", FormControlType.TEXT_BOX, "Favicon Url");
|
|
377
|
+
faviconUrlAttr.hideInTable = true;
|
|
378
|
+
const tokenOverridesAttr = new BaseEntityAttrDescriptor("tokenOverrides", FormControlType.ADDITIONAL_PROPERTIES, "Token Overrides");
|
|
379
|
+
tokenOverridesAttr.hideInTable = true;
|
|
380
|
+
const presetAttr = new BaseEntityAttrDescriptor("preset", FormControlType.DROPDOWN, "Layout Preset", toSelectables(LAYOUT_PRESETS));
|
|
381
|
+
presetAttr.hideInTable = true;
|
|
382
|
+
const sidenavModeAttr = new BaseEntityAttrDescriptor("sidenavMode", FormControlType.DROPDOWN, "Sidenav Mode", toSelectables(SIDENAV_MODES));
|
|
383
|
+
sidenavModeAttr.hideInTable = true;
|
|
384
|
+
const contentMaxWidthAttr = new BaseEntityAttrDescriptor("contentMaxWidth", FormControlType.TEXT_BOX, "Content Max Width");
|
|
385
|
+
contentMaxWidthAttr.placeholder = "CSS length, e.g. 1280px; empty means full width";
|
|
386
|
+
contentMaxWidthAttr.hideInTable = true;
|
|
387
|
+
const sidenavCollapsibleAttr = new BaseEntityAttrDescriptor("sidenavCollapsible", FormControlType.CHECKBOX, "Sidenav Collapsible");
|
|
388
|
+
sidenavCollapsibleAttr.hideInTable = true;
|
|
389
|
+
const sidenavOpenByDefaultAttr = new BaseEntityAttrDescriptor("sidenavOpenByDefault", FormControlType.CHECKBOX, "Sidenav Open By Default");
|
|
390
|
+
sidenavOpenByDefaultAttr.hideInTable = true;
|
|
391
|
+
const regionsAttr = new BaseEntityAttrDescriptor("regions", FormControlType.EMBEDDED_COMPONENTS, "Regions");
|
|
392
|
+
regionsAttr.linkedEntityType = APP_REGION_ENTITY_NAME;
|
|
393
|
+
regionsAttr.referenceIdField = APP_REGION_ID_FIELD;
|
|
394
|
+
regionsAttr.hideInTable = true;
|
|
395
|
+
const routesAttr = new BaseEntityAttrDescriptor("routes", FormControlType.EMBEDDED_COMPONENTS, "Routes");
|
|
396
|
+
routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;
|
|
397
|
+
routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;
|
|
398
|
+
routesAttr.hideInTable = true;
|
|
399
|
+
const modulesAttr = new BaseEntityAttrDescriptor("modules", FormControlType.EMBEDDED_COMPONENTS, "Modules");
|
|
400
|
+
modulesAttr.linkedEntityType = APP_MODULE_MOUNT_ENTITY_NAME;
|
|
401
|
+
modulesAttr.referenceIdField = APP_MODULE_MOUNT_ID_FIELD;
|
|
402
|
+
modulesAttr.hideInTable = true;
|
|
403
|
+
const identityRow = new FlexboxDescriptor([
|
|
404
|
+
idAttr,
|
|
405
|
+
nameAttr,
|
|
406
|
+
translocoIdAttr
|
|
407
|
+
], FlexDirection.ROW);
|
|
408
|
+
identityRow.style = { "column-gap": "10px" };
|
|
409
|
+
const revisionRow = new FlexboxDescriptor([
|
|
410
|
+
statusAttr,
|
|
411
|
+
versionAttr,
|
|
412
|
+
publishedVersionAttr,
|
|
413
|
+
updatedAtAttr
|
|
414
|
+
], FlexDirection.ROW);
|
|
415
|
+
revisionRow.style = { "column-gap": "10px" };
|
|
416
|
+
const themeRow = new FlexboxDescriptor([materialThemeAttr, colorSchemeAttr], FlexDirection.ROW);
|
|
417
|
+
themeRow.style = { "column-gap": "10px" };
|
|
418
|
+
const brandingRow = new FlexboxDescriptor([logoUrlAttr, faviconUrlAttr], FlexDirection.ROW);
|
|
419
|
+
brandingRow.style = { "column-gap": "10px" };
|
|
420
|
+
const layoutRow = new FlexboxDescriptor([
|
|
421
|
+
presetAttr,
|
|
422
|
+
sidenavModeAttr,
|
|
423
|
+
contentMaxWidthAttr
|
|
424
|
+
], FlexDirection.ROW);
|
|
425
|
+
layoutRow.style = { "column-gap": "10px" };
|
|
426
|
+
const sidenavRow = new FlexboxDescriptor([sidenavCollapsibleAttr, sidenavOpenByDefaultAttr], FlexDirection.ROW);
|
|
427
|
+
sidenavRow.style = { "column-gap": "10px" };
|
|
428
|
+
const graphRow = new FlexboxDescriptor([
|
|
429
|
+
regionsAttr,
|
|
430
|
+
routesAttr,
|
|
431
|
+
modulesAttr
|
|
432
|
+
], FlexDirection.ROW);
|
|
433
|
+
graphRow.style = { "column-gap": "10px" };
|
|
434
|
+
const flexBoxContainer = new FlexboxDescriptor([
|
|
435
|
+
identityRow,
|
|
436
|
+
revisionRow,
|
|
437
|
+
descriptionAttr,
|
|
438
|
+
themeRow,
|
|
439
|
+
brandingRow,
|
|
440
|
+
tokenOverridesAttr,
|
|
441
|
+
layoutRow,
|
|
442
|
+
sidenavRow,
|
|
443
|
+
graphRow
|
|
444
|
+
], FlexDirection.COLUMN);
|
|
445
|
+
flexBoxContainer.style = {
|
|
446
|
+
"row-gap": "5px",
|
|
447
|
+
width: "fit-content"
|
|
448
|
+
};
|
|
449
|
+
return [flexBoxContainer];
|
|
617
450
|
}
|
|
618
451
|
function createAppDefinitionDescriptor() {
|
|
619
|
-
|
|
452
|
+
return new BaseEntityDescriptor({
|
|
453
|
+
entityName: APP_DEFINITION_ENTITY_NAME,
|
|
454
|
+
attrDescriptors: createAppDefinitionAttrDescriptors(),
|
|
455
|
+
i18nScope: APP_DEFINITION_I18N_SCOPE
|
|
456
|
+
});
|
|
620
457
|
}
|
|
621
|
-
|
|
622
458
|
function createNavItemAttrDescriptors() {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
459
|
+
const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id");
|
|
460
|
+
idAttr.required = true;
|
|
461
|
+
const labelAttr = new BaseEntityAttrDescriptor("label", FormControlType.TEXT_BOX, "Label", void 0, true);
|
|
462
|
+
labelAttr.required = true;
|
|
463
|
+
labelAttr.isHeading = true;
|
|
464
|
+
const translocoIdAttr = new BaseEntityAttrDescriptor("translocoId", FormControlType.TEXT_BOX, "Transloco Id");
|
|
465
|
+
translocoIdAttr.placeholder = "Translation key of the label";
|
|
466
|
+
translocoIdAttr.hideInTable = true;
|
|
467
|
+
const iconAttr = new BaseEntityAttrDescriptor("icon", FormControlType.TEXT_BOX, "Icon");
|
|
468
|
+
iconAttr.placeholder = "Material or FontAwesome icon name";
|
|
469
|
+
iconAttr.hideInTable = true;
|
|
470
|
+
const routePathAttr = new BaseEntityAttrDescriptor("routePath", FormControlType.FOREIGN_KEY, "Route");
|
|
471
|
+
routePathAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;
|
|
472
|
+
routePathAttr.referenceIdField = APP_ROUTE_ID_FIELD;
|
|
473
|
+
const rolesAttr = new BaseEntityAttrDescriptor("roles", FormControlType.TAGS, "Roles");
|
|
474
|
+
rolesAttr.placeholder = "Empty means any authenticated member of the organization";
|
|
475
|
+
rolesAttr.hideInTable = true;
|
|
476
|
+
const childrenAttr = new BaseEntityAttrDescriptor("children", FormControlType.EMBEDDED_COMPONENTS, "Children");
|
|
477
|
+
childrenAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;
|
|
478
|
+
childrenAttr.hideInTable = true;
|
|
479
|
+
const identityRow = new FlexboxDescriptor([
|
|
480
|
+
idAttr,
|
|
481
|
+
labelAttr,
|
|
482
|
+
translocoIdAttr
|
|
483
|
+
], FlexDirection.ROW);
|
|
484
|
+
identityRow.style = { "column-gap": "10px" };
|
|
485
|
+
const targetRow = new FlexboxDescriptor([iconAttr, routePathAttr], FlexDirection.ROW);
|
|
486
|
+
targetRow.style = { "column-gap": "10px" };
|
|
487
|
+
const flexBoxContainer = new FlexboxDescriptor([
|
|
488
|
+
identityRow,
|
|
489
|
+
targetRow,
|
|
490
|
+
rolesAttr,
|
|
491
|
+
childrenAttr
|
|
492
|
+
], FlexDirection.COLUMN);
|
|
493
|
+
flexBoxContainer.style = {
|
|
494
|
+
"row-gap": "5px",
|
|
495
|
+
width: "fit-content"
|
|
496
|
+
};
|
|
497
|
+
return [flexBoxContainer];
|
|
654
498
|
}
|
|
655
499
|
function createNavItemDescriptor() {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
});
|
|
500
|
+
return new BaseEntityDescriptor({
|
|
501
|
+
entityName: APP_NAV_ITEM_ENTITY_NAME,
|
|
502
|
+
attrDescriptors: createNavItemAttrDescriptors(),
|
|
503
|
+
i18nScope: APP_NAV_ITEM_I18N_SCOPE,
|
|
504
|
+
componentParent: [APP_REGION_ENTITY_NAME, APP_NAV_ITEM_ENTITY_NAME],
|
|
505
|
+
isEmbedded: true
|
|
506
|
+
});
|
|
664
507
|
}
|
|
665
|
-
|
|
666
508
|
function createWidgetInstanceAttrDescriptors() {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };
|
|
691
|
-
return [flexBoxContainer];
|
|
509
|
+
const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id", void 0, true);
|
|
510
|
+
idAttr.required = true;
|
|
511
|
+
idAttr.isHeading = true;
|
|
512
|
+
idAttr.placeholder = "Unique within the page or region, e.g. widget-claims-grid";
|
|
513
|
+
const typeAttr = new BaseEntityAttrDescriptor("type", FormControlType.TEXT_BOX, "Type");
|
|
514
|
+
typeAttr.required = true;
|
|
515
|
+
typeAttr.placeholder = "Widget registry key, e.g. entity-grid";
|
|
516
|
+
const propsAttr = createWidgetPropsAttrDescriptor("props", "type", "Props");
|
|
517
|
+
propsAttr.hideInTable = true;
|
|
518
|
+
const placementAttr = new BaseEntityAttrDescriptor("placement", FormControlType.DROPDOWN, "Placement", toSelectables(WIDGET_PLACEMENTS));
|
|
519
|
+
placementAttr.hideInTable = true;
|
|
520
|
+
const identityRow = new FlexboxDescriptor([
|
|
521
|
+
idAttr,
|
|
522
|
+
typeAttr,
|
|
523
|
+
placementAttr
|
|
524
|
+
], FlexDirection.ROW);
|
|
525
|
+
identityRow.style = { "column-gap": "10px" };
|
|
526
|
+
const flexBoxContainer = new FlexboxDescriptor([identityRow, propsAttr], FlexDirection.COLUMN);
|
|
527
|
+
flexBoxContainer.style = {
|
|
528
|
+
"row-gap": "5px",
|
|
529
|
+
width: "fit-content"
|
|
530
|
+
};
|
|
531
|
+
return [flexBoxContainer];
|
|
692
532
|
}
|
|
693
533
|
function createWidgetInstanceDescriptor() {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
isEmbedded: true,
|
|
702
|
-
});
|
|
534
|
+
return new BaseEntityDescriptor({
|
|
535
|
+
entityName: APP_WIDGET_ENTITY_NAME,
|
|
536
|
+
attrDescriptors: createWidgetInstanceAttrDescriptors(),
|
|
537
|
+
i18nScope: APP_WIDGET_I18N_SCOPE,
|
|
538
|
+
componentParent: [APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME],
|
|
539
|
+
isEmbedded: true
|
|
540
|
+
});
|
|
703
541
|
}
|
|
704
|
-
|
|
705
542
|
function createModuleDefinitionAttrDescriptors() {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
543
|
+
const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Key");
|
|
544
|
+
idAttr.required = true;
|
|
545
|
+
idAttr.pattern = "^[a-z0-9]+(-[a-z0-9]+)*$";
|
|
546
|
+
idAttr.placeholder = "Unique within the organization, e.g. claims — immutable once mounted";
|
|
547
|
+
const nameAttr = new BaseEntityAttrDescriptor("name", FormControlType.TEXT_BOX, "Name", void 0, true);
|
|
548
|
+
nameAttr.required = true;
|
|
549
|
+
nameAttr.isHeading = true;
|
|
550
|
+
const translocoIdAttr = new BaseEntityAttrDescriptor("translocoId", FormControlType.TEXT_BOX, "Transloco Id");
|
|
551
|
+
translocoIdAttr.placeholder = "Translation key of the module name";
|
|
552
|
+
translocoIdAttr.hideInTable = true;
|
|
553
|
+
const descriptionAttr = new BaseEntityAttrDescriptor("description", FormControlType.TEXTAREA, "Description");
|
|
554
|
+
descriptionAttr.styleClass = "full-width";
|
|
555
|
+
descriptionAttr.hideInTable = true;
|
|
556
|
+
const translocoScopeAttr = new BaseEntityAttrDescriptor("translocoScope", FormControlType.TEXT_BOX, "Transloco Scope");
|
|
557
|
+
translocoScopeAttr.placeholder = "Scope the module's translations load under; empty means the key";
|
|
558
|
+
translocoScopeAttr.hideInTable = true;
|
|
559
|
+
const versionAttr = new BaseEntityAttrDescriptor("version", FormControlType.TEXT_BOX, "Version");
|
|
560
|
+
versionAttr.disabled = true;
|
|
561
|
+
const updatedAtAttr = new BaseEntityAttrDescriptor("updatedAt", FormControlType.TEXT_BOX, "Updated At");
|
|
562
|
+
updatedAtAttr.disabled = true;
|
|
563
|
+
const routesAttr = new BaseEntityAttrDescriptor("routes", FormControlType.EMBEDDED_COMPONENTS, "Routes");
|
|
564
|
+
routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;
|
|
565
|
+
routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;
|
|
566
|
+
routesAttr.hideInTable = true;
|
|
567
|
+
const identityRow = new FlexboxDescriptor([
|
|
568
|
+
idAttr,
|
|
569
|
+
nameAttr,
|
|
570
|
+
translocoIdAttr
|
|
571
|
+
], FlexDirection.ROW);
|
|
572
|
+
identityRow.style = { "column-gap": "10px" };
|
|
573
|
+
const revisionRow = new FlexboxDescriptor([
|
|
574
|
+
translocoScopeAttr,
|
|
575
|
+
versionAttr,
|
|
576
|
+
updatedAtAttr
|
|
577
|
+
], FlexDirection.ROW);
|
|
578
|
+
revisionRow.style = { "column-gap": "10px" };
|
|
579
|
+
const flexBoxContainer = new FlexboxDescriptor([
|
|
580
|
+
identityRow,
|
|
581
|
+
revisionRow,
|
|
582
|
+
descriptionAttr,
|
|
583
|
+
routesAttr
|
|
584
|
+
], FlexDirection.COLUMN);
|
|
585
|
+
flexBoxContainer.style = {
|
|
586
|
+
"row-gap": "5px",
|
|
587
|
+
width: "fit-content"
|
|
588
|
+
};
|
|
589
|
+
return [flexBoxContainer];
|
|
747
590
|
}
|
|
748
591
|
function createModuleDefinitionDescriptor() {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
592
|
+
return new BaseEntityDescriptor({
|
|
593
|
+
entityName: MODULE_DEFINITION_ENTITY_NAME,
|
|
594
|
+
attrDescriptors: createModuleDefinitionAttrDescriptors(),
|
|
595
|
+
i18nScope: MODULE_DEFINITION_I18N_SCOPE
|
|
596
|
+
});
|
|
754
597
|
}
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* The `target` flattening both aggregates that own routes need — `AppDefinition.routes` and
|
|
758
|
-
* `ModuleDefinition.routes` carry the same schema, and a route authored in a module has to behave
|
|
759
|
-
* exactly like one authored in an app.
|
|
760
|
-
*
|
|
761
|
-
* Why flatten at all: `EMBEDDED_COMPONENTS` edits a row as the flat JSON it arrived as, and a descriptor
|
|
762
|
-
* addresses one property rather than a path, so nothing in the generated form could reach
|
|
763
|
-
* `target.documentSlug`. The contract already keeps `RouteTarget` flat rather than a `oneOf` for the
|
|
764
|
-
* related reason that the form cannot edit a discriminated union of classes.
|
|
765
|
-
*/
|
|
766
598
|
function flattenRouteTarget(dto) {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
});
|
|
599
|
+
const target = dto.target;
|
|
600
|
+
return new RouteDefinition({
|
|
601
|
+
path: dto.path,
|
|
602
|
+
title: dto.title,
|
|
603
|
+
translocoId: dto.translocoId,
|
|
604
|
+
icon: dto.icon,
|
|
605
|
+
roles: dto.roles,
|
|
606
|
+
kind: target?.kind,
|
|
607
|
+
widgets: target?.widgets,
|
|
608
|
+
documentSlug: target?.documentSlug,
|
|
609
|
+
entityName: target?.entityName,
|
|
610
|
+
entityMode: target?.entityMode,
|
|
611
|
+
rsqlFilter: target?.rsqlFilter,
|
|
612
|
+
target
|
|
613
|
+
});
|
|
783
614
|
}
|
|
784
|
-
/**
|
|
785
|
-
* The inverse. `kind` is non-optional in the contract but undefined on a row the designer has not
|
|
786
|
-
* finished — the dropdown is `required`, so the form rejects that before a save; the cast keeps this
|
|
787
|
-
* mapping from having to invent a default the backend would then have to second-guess.
|
|
788
|
-
*
|
|
789
|
-
* `widgets` is omitted when empty rather than sent as `[]`, so a DOCUMENT or ENTITY route does not
|
|
790
|
-
* persist an empty widget list it has no use for. The rest is merged onto the `target` the fields were
|
|
791
|
-
* lifted out of, which preserves any field a later contract version adds before this mapping learns
|
|
792
|
-
* about it — a PUT is a full replacement, so anything dropped here is dropped for good.
|
|
793
|
-
*/
|
|
794
615
|
function nestRouteTarget(route) {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
616
|
+
const widgets = route.widgets;
|
|
617
|
+
return {
|
|
618
|
+
path: route.path,
|
|
619
|
+
title: route.title,
|
|
620
|
+
translocoId: route.translocoId,
|
|
621
|
+
icon: route.icon,
|
|
622
|
+
roles: route.roles,
|
|
623
|
+
target: {
|
|
624
|
+
...route.target,
|
|
625
|
+
kind: route.kind,
|
|
626
|
+
widgets: widgets?.length ? widgets : void 0,
|
|
627
|
+
documentSlug: route.documentSlug,
|
|
628
|
+
entityName: route.entityName,
|
|
629
|
+
entityMode: route.entityMode,
|
|
630
|
+
rsqlFilter: route.rsqlFilter
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
var AppDefinitionMapper = class AppDefinitionMapper {
|
|
635
|
+
fromDto(dto) {
|
|
636
|
+
const source = dto;
|
|
637
|
+
const theme = source.theme;
|
|
638
|
+
const layout = source.layout;
|
|
639
|
+
return new AppDefinition({
|
|
640
|
+
id: source.id,
|
|
641
|
+
name: source.name,
|
|
642
|
+
translocoId: source.translocoId,
|
|
643
|
+
description: source.description,
|
|
644
|
+
materialTheme: theme?.materialTheme,
|
|
645
|
+
colorScheme: theme?.colorScheme,
|
|
646
|
+
tokenOverrides: theme?.tokenOverrides,
|
|
647
|
+
logoUrl: theme?.logoUrl,
|
|
648
|
+
faviconUrl: theme?.faviconUrl,
|
|
649
|
+
preset: layout?.preset,
|
|
650
|
+
sidenavMode: layout?.sidenavMode,
|
|
651
|
+
sidenavCollapsible: layout?.sidenavCollapsible,
|
|
652
|
+
sidenavOpenByDefault: layout?.sidenavOpenByDefault,
|
|
653
|
+
contentMaxWidth: layout?.contentMaxWidth,
|
|
654
|
+
theme,
|
|
655
|
+
layout,
|
|
656
|
+
regions: source.regions,
|
|
657
|
+
routes: source.routes?.map(flattenRouteTarget),
|
|
658
|
+
modules: source.modules,
|
|
659
|
+
orgKey: source.orgKey,
|
|
660
|
+
status: source.status,
|
|
661
|
+
version: source.version,
|
|
662
|
+
publishedVersion: source.publishedVersion,
|
|
663
|
+
createdAt: source.createdAt,
|
|
664
|
+
updatedAt: source.updatedAt
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
toDto(entity) {
|
|
668
|
+
return {
|
|
669
|
+
id: entity.id,
|
|
670
|
+
name: entity.name,
|
|
671
|
+
translocoId: entity.translocoId,
|
|
672
|
+
description: entity.description,
|
|
673
|
+
theme: this.mergeTheme(entity),
|
|
674
|
+
layout: this.mergeLayout(entity),
|
|
675
|
+
regions: entity.regions,
|
|
676
|
+
routes: entity.routes?.map(nestRouteTarget),
|
|
677
|
+
modules: entity.modules,
|
|
678
|
+
orgKey: entity.orgKey,
|
|
679
|
+
status: entity.status,
|
|
680
|
+
version: entity.version,
|
|
681
|
+
publishedVersion: entity.publishedVersion,
|
|
682
|
+
createdAt: entity.createdAt,
|
|
683
|
+
updatedAt: entity.updatedAt
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
mergeTheme(entity) {
|
|
687
|
+
return {
|
|
688
|
+
...entity.theme,
|
|
689
|
+
materialTheme: entity.materialTheme,
|
|
690
|
+
colorScheme: entity.colorScheme,
|
|
691
|
+
tokenOverrides: entity.tokenOverrides,
|
|
692
|
+
logoUrl: entity.logoUrl,
|
|
693
|
+
faviconUrl: entity.faviconUrl
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
mergeLayout(entity) {
|
|
697
|
+
return {
|
|
698
|
+
...entity.layout,
|
|
699
|
+
preset: entity.preset,
|
|
700
|
+
sidenavMode: entity.sidenavMode,
|
|
701
|
+
sidenavCollapsible: entity.sidenavCollapsible,
|
|
702
|
+
sidenavOpenByDefault: entity.sidenavOpenByDefault,
|
|
703
|
+
contentMaxWidth: entity.contentMaxWidth
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
707
|
+
minVersion: "12.0.0",
|
|
708
|
+
version: "22.1.7",
|
|
709
|
+
ngImport: i0,
|
|
710
|
+
type: AppDefinitionMapper,
|
|
711
|
+
deps: [],
|
|
712
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
713
|
+
});
|
|
714
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
715
|
+
minVersion: "12.0.0",
|
|
716
|
+
version: "22.1.7",
|
|
717
|
+
ngImport: i0,
|
|
718
|
+
type: AppDefinitionMapper,
|
|
719
|
+
providedIn: "root"
|
|
720
|
+
});
|
|
721
|
+
};
|
|
722
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
723
|
+
minVersion: "12.0.0",
|
|
724
|
+
version: "22.1.7",
|
|
725
|
+
ngImport: i0,
|
|
726
|
+
type: AppDefinitionMapper,
|
|
727
|
+
decorators: [{
|
|
728
|
+
type: Injectable,
|
|
729
|
+
args: [{ providedIn: "root" }]
|
|
730
|
+
}]
|
|
731
|
+
});
|
|
732
|
+
var AppDefinitionService = class AppDefinitionService extends BaseEntityRestService {
|
|
733
|
+
entityMapper;
|
|
734
|
+
constructor(entityMapper) {
|
|
735
|
+
super(entityMapper, "APP_SERVICE_ROOT", "app-definitions");
|
|
736
|
+
this.entityMapper = entityMapper;
|
|
737
|
+
}
|
|
738
|
+
publish(id) {
|
|
739
|
+
const pathParams = /* @__PURE__ */ new Map([["id", String(id)]]);
|
|
740
|
+
const fullUrl = this.buildFullUrl(this.resourceUrl + "/%{id}/publish", { pathParams });
|
|
741
|
+
if (!fullUrl) throw new Error("Could not determine the full url");
|
|
742
|
+
return this.httpClient.post(fullUrl, {}, { headers: this.headers }).pipe(map((response) => this.entityMapper.fromDto(response)));
|
|
743
|
+
}
|
|
744
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
745
|
+
minVersion: "12.0.0",
|
|
746
|
+
version: "22.1.7",
|
|
747
|
+
ngImport: i0,
|
|
748
|
+
type: AppDefinitionService,
|
|
749
|
+
deps: [{ token: AppDefinitionMapper }],
|
|
750
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
751
|
+
});
|
|
752
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
753
|
+
minVersion: "12.0.0",
|
|
754
|
+
version: "22.1.7",
|
|
755
|
+
ngImport: i0,
|
|
756
|
+
type: AppDefinitionService,
|
|
757
|
+
providedIn: "root"
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
761
|
+
minVersion: "12.0.0",
|
|
762
|
+
version: "22.1.7",
|
|
763
|
+
ngImport: i0,
|
|
764
|
+
type: AppDefinitionService,
|
|
765
|
+
decorators: [{
|
|
766
|
+
type: Injectable,
|
|
767
|
+
args: [{ providedIn: "root" }]
|
|
768
|
+
}],
|
|
769
|
+
ctorParameters: () => [{ type: AppDefinitionMapper }]
|
|
770
|
+
});
|
|
949
771
|
function AppDefinitionPublishStore() {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
772
|
+
return signalStoreFeature({ state: type() }, withMethods((store, service = inject(AppDefinitionService)) => ({ publish: async (id) => {
|
|
773
|
+
patchState(store, {
|
|
774
|
+
isLoading: true,
|
|
775
|
+
error: void 0
|
|
776
|
+
});
|
|
777
|
+
try {
|
|
778
|
+
const publishedEntity = await firstValueFrom(service.publish(id));
|
|
779
|
+
const entities = [...store.entities()];
|
|
780
|
+
const indexToUpdate = entities.findIndex((entity) => entity.id === id);
|
|
781
|
+
if (indexToUpdate >= 0) entities[indexToUpdate] = publishedEntity;
|
|
782
|
+
patchState(store, {
|
|
783
|
+
entities,
|
|
784
|
+
currentEntity: store.currentEntity()?.id === id ? publishedEntity : store.currentEntity(),
|
|
785
|
+
isLoading: false
|
|
786
|
+
});
|
|
787
|
+
return publishedEntity;
|
|
788
|
+
} catch (error) {
|
|
789
|
+
patchState(store, {
|
|
790
|
+
error: httpErrorMessage(error),
|
|
791
|
+
isLoading: false
|
|
792
|
+
});
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
} })));
|
|
796
|
+
}
|
|
797
|
+
const AppDefinitionStore = signalStore({ providedIn: "root" }, BaseEntityStore(AppDefinition, () => inject(AppDefinitionService)), BaseEntityTabsStore(), BaseEntityContainerStore(), AppDefinitionPublishStore(), withDevtools("AppDefinition"));
|
|
798
|
+
var ModuleDefinitionMapper = class ModuleDefinitionMapper {
|
|
799
|
+
fromDto(dto) {
|
|
800
|
+
const source = dto;
|
|
801
|
+
return new ModuleDefinition({
|
|
802
|
+
id: source.key,
|
|
803
|
+
name: source.name,
|
|
804
|
+
translocoId: source.translocoId,
|
|
805
|
+
description: source.description,
|
|
806
|
+
translocoScope: source.translocoScope,
|
|
807
|
+
routes: source.routes?.map(flattenRouteTarget),
|
|
808
|
+
orgKey: source.orgKey,
|
|
809
|
+
version: source.version,
|
|
810
|
+
createdAt: source.createdAt,
|
|
811
|
+
updatedAt: source.updatedAt
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
toDto(entity) {
|
|
815
|
+
return {
|
|
816
|
+
key: entity.id,
|
|
817
|
+
name: entity.name,
|
|
818
|
+
translocoId: entity.translocoId,
|
|
819
|
+
description: entity.description,
|
|
820
|
+
translocoScope: entity.translocoScope,
|
|
821
|
+
routes: entity.routes?.map(nestRouteTarget),
|
|
822
|
+
orgKey: entity.orgKey,
|
|
823
|
+
version: entity.version,
|
|
824
|
+
createdAt: entity.createdAt,
|
|
825
|
+
updatedAt: entity.updatedAt
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
829
|
+
minVersion: "12.0.0",
|
|
830
|
+
version: "22.1.7",
|
|
831
|
+
ngImport: i0,
|
|
832
|
+
type: ModuleDefinitionMapper,
|
|
833
|
+
deps: [],
|
|
834
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
835
|
+
});
|
|
836
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
837
|
+
minVersion: "12.0.0",
|
|
838
|
+
version: "22.1.7",
|
|
839
|
+
ngImport: i0,
|
|
840
|
+
type: ModuleDefinitionMapper,
|
|
841
|
+
providedIn: "root"
|
|
842
|
+
});
|
|
843
|
+
};
|
|
844
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
845
|
+
minVersion: "12.0.0",
|
|
846
|
+
version: "22.1.7",
|
|
847
|
+
ngImport: i0,
|
|
848
|
+
type: ModuleDefinitionMapper,
|
|
849
|
+
decorators: [{
|
|
850
|
+
type: Injectable,
|
|
851
|
+
args: [{ providedIn: "root" }]
|
|
852
|
+
}]
|
|
853
|
+
});
|
|
854
|
+
var ModuleDefinitionService = class ModuleDefinitionService extends BaseEntityRestService {
|
|
855
|
+
entityMapper;
|
|
856
|
+
constructor(entityMapper) {
|
|
857
|
+
super(entityMapper, "APP_SERVICE_ROOT", "modules");
|
|
858
|
+
this.entityMapper = entityMapper;
|
|
859
|
+
}
|
|
860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
861
|
+
minVersion: "12.0.0",
|
|
862
|
+
version: "22.1.7",
|
|
863
|
+
ngImport: i0,
|
|
864
|
+
type: ModuleDefinitionService,
|
|
865
|
+
deps: [{ token: ModuleDefinitionMapper }],
|
|
866
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
867
|
+
});
|
|
868
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
869
|
+
minVersion: "12.0.0",
|
|
870
|
+
version: "22.1.7",
|
|
871
|
+
ngImport: i0,
|
|
872
|
+
type: ModuleDefinitionService,
|
|
873
|
+
providedIn: "root"
|
|
874
|
+
});
|
|
875
|
+
};
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
877
|
+
minVersion: "12.0.0",
|
|
878
|
+
version: "22.1.7",
|
|
879
|
+
ngImport: i0,
|
|
880
|
+
type: ModuleDefinitionService,
|
|
881
|
+
decorators: [{
|
|
882
|
+
type: Injectable,
|
|
883
|
+
args: [{ providedIn: "root" }]
|
|
884
|
+
}],
|
|
885
|
+
ctorParameters: () => [{ type: ModuleDefinitionMapper }]
|
|
886
|
+
});
|
|
887
|
+
const ModuleDefinitionStore = signalStore({ providedIn: "root" }, BaseEntityStore(ModuleDefinition, () => inject(ModuleDefinitionService)), BaseEntityTabsStore(), BaseEntityContainerStore(), withDevtools("ModuleDefinition"));
|
|
888
|
+
var AppDefinitionFacade = class AppDefinitionFacade extends BaseEntityFacade {
|
|
889
|
+
entityType = AppDefinition;
|
|
890
|
+
mapperRef = inject(AppDefinitionMapper);
|
|
891
|
+
serviceRef = inject(AppDefinitionService);
|
|
892
|
+
createMapper() {
|
|
893
|
+
return this.mapperRef;
|
|
894
|
+
}
|
|
895
|
+
createService() {
|
|
896
|
+
return this.serviceRef;
|
|
897
|
+
}
|
|
898
|
+
createStoreClass() {
|
|
899
|
+
return AppDefinitionStore;
|
|
900
|
+
}
|
|
901
|
+
createDescriptor() {
|
|
902
|
+
return createAppDefinitionDescriptor();
|
|
903
|
+
}
|
|
904
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
905
|
+
minVersion: "12.0.0",
|
|
906
|
+
version: "22.1.7",
|
|
907
|
+
ngImport: i0,
|
|
908
|
+
type: AppDefinitionFacade,
|
|
909
|
+
deps: null,
|
|
910
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
911
|
+
});
|
|
912
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
913
|
+
minVersion: "12.0.0",
|
|
914
|
+
version: "22.1.7",
|
|
915
|
+
ngImport: i0,
|
|
916
|
+
type: AppDefinitionFacade
|
|
917
|
+
});
|
|
918
|
+
};
|
|
919
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
920
|
+
minVersion: "12.0.0",
|
|
921
|
+
version: "22.1.7",
|
|
922
|
+
ngImport: i0,
|
|
923
|
+
type: AppDefinitionFacade,
|
|
924
|
+
decorators: [{ type: Injectable }]
|
|
925
|
+
});
|
|
926
|
+
var ModuleDefinitionFacade = class ModuleDefinitionFacade extends BaseEntityFacade {
|
|
927
|
+
entityType = ModuleDefinition;
|
|
928
|
+
mapperRef = inject(ModuleDefinitionMapper);
|
|
929
|
+
serviceRef = inject(ModuleDefinitionService);
|
|
930
|
+
createMapper() {
|
|
931
|
+
return this.mapperRef;
|
|
932
|
+
}
|
|
933
|
+
createService() {
|
|
934
|
+
return this.serviceRef;
|
|
935
|
+
}
|
|
936
|
+
createStoreClass() {
|
|
937
|
+
return ModuleDefinitionStore;
|
|
938
|
+
}
|
|
939
|
+
createDescriptor() {
|
|
940
|
+
return createModuleDefinitionDescriptor();
|
|
941
|
+
}
|
|
942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
943
|
+
minVersion: "12.0.0",
|
|
944
|
+
version: "22.1.7",
|
|
945
|
+
ngImport: i0,
|
|
946
|
+
type: ModuleDefinitionFacade,
|
|
947
|
+
deps: null,
|
|
948
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
949
|
+
});
|
|
950
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
951
|
+
minVersion: "12.0.0",
|
|
952
|
+
version: "22.1.7",
|
|
953
|
+
ngImport: i0,
|
|
954
|
+
type: ModuleDefinitionFacade
|
|
955
|
+
});
|
|
956
|
+
};
|
|
957
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
958
|
+
minVersion: "12.0.0",
|
|
959
|
+
version: "22.1.7",
|
|
960
|
+
ngImport: i0,
|
|
961
|
+
type: ModuleDefinitionFacade,
|
|
962
|
+
decorators: [{ type: Injectable }]
|
|
963
|
+
});
|
|
964
|
+
var AppModuleMountFacade = class AppModuleMountFacade extends EmbeddedEntityFacade {
|
|
965
|
+
entityType = ModuleMount;
|
|
966
|
+
createDescriptor() {
|
|
967
|
+
return createModuleMountDescriptor();
|
|
968
|
+
}
|
|
969
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
970
|
+
minVersion: "12.0.0",
|
|
971
|
+
version: "22.1.7",
|
|
972
|
+
ngImport: i0,
|
|
973
|
+
type: AppModuleMountFacade,
|
|
974
|
+
deps: null,
|
|
975
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
976
|
+
});
|
|
977
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
978
|
+
minVersion: "12.0.0",
|
|
979
|
+
version: "22.1.7",
|
|
980
|
+
ngImport: i0,
|
|
981
|
+
type: AppModuleMountFacade
|
|
982
|
+
});
|
|
983
|
+
};
|
|
984
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
985
|
+
minVersion: "12.0.0",
|
|
986
|
+
version: "22.1.7",
|
|
987
|
+
ngImport: i0,
|
|
988
|
+
type: AppModuleMountFacade,
|
|
989
|
+
decorators: [{ type: Injectable }]
|
|
990
|
+
});
|
|
991
|
+
var AppNavItemFacade = class AppNavItemFacade extends EmbeddedEntityFacade {
|
|
992
|
+
entityType = NavItem;
|
|
993
|
+
createDescriptor() {
|
|
994
|
+
return createNavItemDescriptor();
|
|
995
|
+
}
|
|
996
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
997
|
+
minVersion: "12.0.0",
|
|
998
|
+
version: "22.1.7",
|
|
999
|
+
ngImport: i0,
|
|
1000
|
+
type: AppNavItemFacade,
|
|
1001
|
+
deps: null,
|
|
1002
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1003
|
+
});
|
|
1004
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1005
|
+
minVersion: "12.0.0",
|
|
1006
|
+
version: "22.1.7",
|
|
1007
|
+
ngImport: i0,
|
|
1008
|
+
type: AppNavItemFacade
|
|
1009
|
+
});
|
|
1010
|
+
};
|
|
1011
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1012
|
+
minVersion: "12.0.0",
|
|
1013
|
+
version: "22.1.7",
|
|
1014
|
+
ngImport: i0,
|
|
1015
|
+
type: AppNavItemFacade,
|
|
1016
|
+
decorators: [{ type: Injectable }]
|
|
1017
|
+
});
|
|
1157
1018
|
async function buildAppRoutes(source, renderRoute) {
|
|
1158
|
-
|
|
1159
|
-
return [...appRoutes, ...(await moduleRoutesOf(source, renderRoute))];
|
|
1019
|
+
return [...await emitLevel(trieOf(source.routes), [], renderRoute), ...await moduleRoutesOf(source, renderRoute)];
|
|
1160
1020
|
}
|
|
1161
1021
|
async function moduleRoutesOf(source, renderRoute) {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
}
|
|
1175
|
-
return mounted;
|
|
1022
|
+
const mounted = [];
|
|
1023
|
+
for (const mount of source.modules ?? []) {
|
|
1024
|
+
if (!mount.basePath) continue;
|
|
1025
|
+
const routes = source.moduleRoutes?.[mount.moduleKey];
|
|
1026
|
+
if (routes) {
|
|
1027
|
+
if (routes.length) mounted.push({
|
|
1028
|
+
path: mount.basePath,
|
|
1029
|
+
children: await emitLevel(trieOf(routes), [], renderRoute)
|
|
1030
|
+
});
|
|
1031
|
+
} else if (source.loadModule) mounted.push(lazyMount(mount.moduleKey, mount.basePath, source.loadModule, renderRoute));
|
|
1032
|
+
}
|
|
1033
|
+
return mounted;
|
|
1176
1034
|
}
|
|
1177
|
-
/**
|
|
1178
|
-
* A mount whose module the shell has not got yet: the same component-less parent at the base path, with
|
|
1179
|
-
* its children resolved on first navigation into it instead of now.
|
|
1180
|
-
*
|
|
1181
|
-
* What is deferred is the *metadata* — one `GET /modules/{key}` per module the user actually visits, so an
|
|
1182
|
-
* app that mounts twenty modules does not fetch twenty definitions to show its first screen. It is not a
|
|
1183
|
-
* deferred *bundle*: the widgets a module's routes render come from the widget registry and are part of
|
|
1184
|
-
* the application's own build either way.
|
|
1185
|
-
*
|
|
1186
|
-
* The module's transloco scope is registered here, on a component-less wrapper inside the loaded children,
|
|
1187
|
-
* because that is the first moment its name is known — the default is the module key, but a module may
|
|
1188
|
-
* name its own. The alias is spelled out, as everywhere in this workspace: transloco would otherwise
|
|
1189
|
-
* camel-case it and miss every key below it.
|
|
1190
|
-
*
|
|
1191
|
-
* The framework scopes are re-registered alongside it, for the reason `BASE_APP_ROUTES.authoringScopes()`
|
|
1192
|
-
* gives: a route that declares TRANSLOCO_SCOPE *replaces* the collection it inherits rather than adding to
|
|
1193
|
-
* it, because Angular does not merge `multi` providers across injectors. A module's routes render the same
|
|
1194
|
-
* generic screens as everything else — an ENTITY route reaches `BaseEntityTabsComponent`, which translates
|
|
1195
|
-
* `base_entity.tabs.*` — so naming only the module's scope here would leave every framework label below the
|
|
1196
|
-
* mount unresolved.
|
|
1197
|
-
*/
|
|
1198
1035
|
function lazyMount(moduleKey, basePath, loadModule, renderRoute) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1036
|
+
return {
|
|
1037
|
+
path: basePath,
|
|
1038
|
+
loadChildren: async () => {
|
|
1039
|
+
const definition = await loadModule(moduleKey);
|
|
1040
|
+
const children = await emitLevel(trieOf(definition?.routes), [], renderRoute);
|
|
1041
|
+
if (!definition || !children.length) return [];
|
|
1042
|
+
const scope = moduleTranslocoScope(definition);
|
|
1043
|
+
return [{
|
|
1044
|
+
path: "",
|
|
1045
|
+
providers: [provideTranslocoScope({
|
|
1046
|
+
scope,
|
|
1047
|
+
alias: scope
|
|
1048
|
+
}, {
|
|
1049
|
+
scope: BASE_ENTITY_TRANSLOCO_SCOPE,
|
|
1050
|
+
alias: BASE_ENTITY_TRANSLOCO_SCOPE
|
|
1051
|
+
}, {
|
|
1052
|
+
scope: BASE_APP_TRANSLOCO_SCOPE,
|
|
1053
|
+
alias: BASE_APP_TRANSLOCO_SCOPE
|
|
1054
|
+
})],
|
|
1055
|
+
children
|
|
1056
|
+
}];
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1213
1059
|
}
|
|
1214
|
-
/** The authored paths as a trie, so a route that is a prefix of another can be recognized as its parent. */
|
|
1215
1060
|
function trieOf(routes) {
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1061
|
+
const roots = [];
|
|
1062
|
+
for (const definition of routes ?? []) {
|
|
1063
|
+
const segments = segmentsOf(definition.path);
|
|
1064
|
+
if (!segments.length) continue;
|
|
1065
|
+
let level = roots;
|
|
1066
|
+
let node = {
|
|
1067
|
+
segment: "",
|
|
1068
|
+
children: roots
|
|
1069
|
+
};
|
|
1070
|
+
for (const segment of segments) {
|
|
1071
|
+
const existing = level.find((candidate) => candidate.segment === segment);
|
|
1072
|
+
node = existing ?? {
|
|
1073
|
+
segment,
|
|
1074
|
+
children: []
|
|
1075
|
+
};
|
|
1076
|
+
if (!existing) level.push(node);
|
|
1077
|
+
level = node.children;
|
|
1078
|
+
}
|
|
1079
|
+
node.definition ??= definition;
|
|
1080
|
+
}
|
|
1081
|
+
return roots;
|
|
1235
1082
|
}
|
|
1236
|
-
/**
|
|
1237
|
-
* The routes of one level. An authored node becomes a `Route` whose children are emitted below it; an
|
|
1238
|
-
* unauthored one contributes its segment to the paths of its descendants instead of a route of its own.
|
|
1239
|
-
*/
|
|
1240
1083
|
async function emitLevel(nodes, prefix, renderRoute) {
|
|
1241
|
-
|
|
1242
|
-
return routes.sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path));
|
|
1084
|
+
return (await Promise.all(nodes.map((node) => emitNode(node, prefix, renderRoute)))).flat().sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path));
|
|
1243
1085
|
}
|
|
1244
1086
|
async function emitNode(node, prefix, renderRoute) {
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
const children = [...(rendered.children ?? []), ...authoredChildren];
|
|
1257
|
-
if (children.length)
|
|
1258
|
-
route.children = children;
|
|
1259
|
-
return [route];
|
|
1087
|
+
const path = [...prefix, node.segment];
|
|
1088
|
+
if (!node.definition) return (await Promise.all(node.children.map((child) => emitNode(child, path, renderRoute)))).flat();
|
|
1089
|
+
const authoredChildren = await emitLevel(node.children, [], renderRoute);
|
|
1090
|
+
const rendered = await renderRoute(node.definition);
|
|
1091
|
+
const route = {
|
|
1092
|
+
...rendered,
|
|
1093
|
+
path: path.join("/")
|
|
1094
|
+
};
|
|
1095
|
+
const children = [...rendered.children ?? [], ...authoredChildren];
|
|
1096
|
+
if (children.length) route.children = children;
|
|
1097
|
+
return [route];
|
|
1260
1098
|
}
|
|
1261
1099
|
function segmentsOf(path) {
|
|
1262
|
-
|
|
1100
|
+
return (path ?? "").split("/").filter((segment) => segment.length > 0);
|
|
1263
1101
|
}
|
|
1264
|
-
/**
|
|
1265
|
-
* How many leading segments of a path are static. Sorting by it descending is what keeps a parameterized
|
|
1266
|
-
* route from shadowing its static siblings: `claims/new` scores 2, `claims/:id` scores 1, and Angular
|
|
1267
|
-
* matches in the order given.
|
|
1268
|
-
*/
|
|
1269
1102
|
function staticDepthOf(path) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
@for (row of rows(); track row.id) {
|
|
1306
|
-
@if (row.component; as component) {
|
|
1307
|
-
<ng-container *ngComponentOutlet="component; inputs: row.props"></ng-container>
|
|
1308
|
-
} @else {
|
|
1309
|
-
<span class="pp-widget-list__unregistered" [attr.data-testid]="'unregistered-' + row.id" [title]="explain(row.type)">{{ row.type }}</span>
|
|
1310
|
-
}
|
|
1103
|
+
const segments = segmentsOf(path);
|
|
1104
|
+
const firstParameter = segments.findIndex((segment) => segment.startsWith(":") || segment === "**");
|
|
1105
|
+
return firstParameter === -1 ? segments.length : firstParameter;
|
|
1106
|
+
}
|
|
1107
|
+
function standaloneWidgets(widgets) {
|
|
1108
|
+
return (widgets ?? []).filter((widget) => widget.placement !== WidgetPlacement.REFERENCED);
|
|
1109
|
+
}
|
|
1110
|
+
var WidgetListComponent = class WidgetListComponent {
|
|
1111
|
+
widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
|
|
1112
|
+
rows = computed(() => standaloneWidgets(this.widgets()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
1113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1114
|
+
minVersion: "12.0.0",
|
|
1115
|
+
version: "22.1.7",
|
|
1116
|
+
ngImport: i0,
|
|
1117
|
+
type: WidgetListComponent,
|
|
1118
|
+
deps: [],
|
|
1119
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1120
|
+
});
|
|
1121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1122
|
+
minVersion: "17.0.0",
|
|
1123
|
+
version: "22.1.7",
|
|
1124
|
+
type: WidgetListComponent,
|
|
1125
|
+
isStandalone: true,
|
|
1126
|
+
selector: "pp-widget-list",
|
|
1127
|
+
inputs: { widgets: {
|
|
1128
|
+
classPropertyName: "widgets",
|
|
1129
|
+
publicName: "widgets",
|
|
1130
|
+
isSignal: true,
|
|
1131
|
+
isRequired: false,
|
|
1132
|
+
transformFunction: null
|
|
1133
|
+
} },
|
|
1134
|
+
ngImport: i0,
|
|
1135
|
+
template: `
|
|
1136
|
+
@for (widget of rows(); track widget.id) {
|
|
1137
|
+
<pp-widget-host [widget]="widget" />
|
|
1311
1138
|
}
|
|
1312
|
-
`,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1139
|
+
`,
|
|
1140
|
+
isInline: true,
|
|
1141
|
+
dependencies: [{
|
|
1142
|
+
kind: "component",
|
|
1143
|
+
type: WidgetHostComponent,
|
|
1144
|
+
selector: "pp-widget-host",
|
|
1145
|
+
inputs: ["widget", "bindingResolver"],
|
|
1146
|
+
outputs: ["portEmit"]
|
|
1147
|
+
}]
|
|
1148
|
+
});
|
|
1149
|
+
};
|
|
1150
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1151
|
+
minVersion: "12.0.0",
|
|
1152
|
+
version: "22.1.7",
|
|
1153
|
+
ngImport: i0,
|
|
1154
|
+
type: WidgetListComponent,
|
|
1155
|
+
decorators: [{
|
|
1156
|
+
type: Component,
|
|
1157
|
+
args: [{
|
|
1158
|
+
selector: "pp-widget-list",
|
|
1159
|
+
standalone: true,
|
|
1160
|
+
imports: [WidgetHostComponent],
|
|
1161
|
+
template: `
|
|
1162
|
+
@for (widget of rows(); track widget.id) {
|
|
1163
|
+
<pp-widget-host [widget]="widget" />
|
|
1323
1164
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
class RouteWidgetsComponent {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1165
|
+
`
|
|
1166
|
+
}]
|
|
1167
|
+
}],
|
|
1168
|
+
propDecorators: { widgets: [{
|
|
1169
|
+
type: i0.Input,
|
|
1170
|
+
args: [{
|
|
1171
|
+
isSignal: true,
|
|
1172
|
+
alias: "widgets",
|
|
1173
|
+
required: false
|
|
1174
|
+
}]
|
|
1175
|
+
}] }
|
|
1176
|
+
});
|
|
1177
|
+
var RouteWidgetsComponent = class RouteWidgetsComponent {
|
|
1178
|
+
route = inject(ActivatedRoute);
|
|
1179
|
+
widgets = this.route.snapshot.data["widgets"] ?? [];
|
|
1180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1181
|
+
minVersion: "12.0.0",
|
|
1182
|
+
version: "22.1.7",
|
|
1183
|
+
ngImport: i0,
|
|
1184
|
+
type: RouteWidgetsComponent,
|
|
1185
|
+
deps: [],
|
|
1186
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1187
|
+
});
|
|
1188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1189
|
+
minVersion: "14.0.0",
|
|
1190
|
+
version: "22.1.7",
|
|
1191
|
+
type: RouteWidgetsComponent,
|
|
1192
|
+
isStandalone: true,
|
|
1193
|
+
selector: "pp-route-widgets",
|
|
1194
|
+
ngImport: i0,
|
|
1195
|
+
template: `<pp-widget-list [widgets]="widgets" />`,
|
|
1196
|
+
isInline: true,
|
|
1197
|
+
dependencies: [{
|
|
1198
|
+
kind: "component",
|
|
1199
|
+
type: WidgetListComponent,
|
|
1200
|
+
selector: "pp-widget-list",
|
|
1201
|
+
inputs: ["widgets"]
|
|
1202
|
+
}]
|
|
1203
|
+
});
|
|
1204
|
+
};
|
|
1205
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1206
|
+
minVersion: "12.0.0",
|
|
1207
|
+
version: "22.1.7",
|
|
1208
|
+
ngImport: i0,
|
|
1209
|
+
type: RouteWidgetsComponent,
|
|
1210
|
+
decorators: [{
|
|
1211
|
+
type: Component,
|
|
1212
|
+
args: [{
|
|
1213
|
+
selector: "pp-route-widgets",
|
|
1214
|
+
standalone: true,
|
|
1215
|
+
imports: [WidgetListComponent],
|
|
1216
|
+
template: `<pp-widget-list [widgets]="widgets" />`
|
|
1217
|
+
}]
|
|
1218
|
+
}]
|
|
1219
|
+
});
|
|
1220
|
+
var RouteUnsupportedComponent = class RouteUnsupportedComponent {
|
|
1221
|
+
route = inject(ActivatedRoute);
|
|
1222
|
+
reason = computed(() => this.route.snapshot.data["reason"] ?? "This route is not yet supported.", ...ngDevMode ? [{ debugName: "reason" }] : /* istanbul ignore next */ []);
|
|
1223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1224
|
+
minVersion: "12.0.0",
|
|
1225
|
+
version: "22.1.7",
|
|
1226
|
+
ngImport: i0,
|
|
1227
|
+
type: RouteUnsupportedComponent,
|
|
1228
|
+
deps: [],
|
|
1229
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1230
|
+
});
|
|
1231
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1232
|
+
minVersion: "14.0.0",
|
|
1233
|
+
version: "22.1.7",
|
|
1234
|
+
type: RouteUnsupportedComponent,
|
|
1235
|
+
isStandalone: true,
|
|
1236
|
+
selector: "pp-route-unsupported",
|
|
1237
|
+
ngImport: i0,
|
|
1238
|
+
template: `<p class="pp-route-unsupported">{{ reason() }}</p>`,
|
|
1239
|
+
isInline: true
|
|
1240
|
+
});
|
|
1241
|
+
};
|
|
1242
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1243
|
+
minVersion: "12.0.0",
|
|
1244
|
+
version: "22.1.7",
|
|
1245
|
+
ngImport: i0,
|
|
1246
|
+
type: RouteUnsupportedComponent,
|
|
1247
|
+
decorators: [{
|
|
1248
|
+
type: Component,
|
|
1249
|
+
args: [{
|
|
1250
|
+
selector: "pp-route-unsupported",
|
|
1251
|
+
standalone: true,
|
|
1252
|
+
template: `<p class="pp-route-unsupported">{{ reason() }}</p>`
|
|
1253
|
+
}]
|
|
1254
|
+
}]
|
|
1255
|
+
});
|
|
1387
1256
|
function titleOf(definition) {
|
|
1388
|
-
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
*/
|
|
1257
|
+
return () => translateLabel(inject(TranslocoService), definition.translocoId, definition.title);
|
|
1258
|
+
}
|
|
1259
|
+
var AppRouteRenderer = class AppRouteRenderer {
|
|
1260
|
+
entityScreens = inject(EntityScreenResolver);
|
|
1261
|
+
render = async (definition) => {
|
|
1262
|
+
switch (definition.kind) {
|
|
1263
|
+
case "WIDGETS": return {
|
|
1264
|
+
component: RouteWidgetsComponent,
|
|
1265
|
+
title: titleOf(definition),
|
|
1266
|
+
data: { widgets: definition.widgets }
|
|
1267
|
+
};
|
|
1268
|
+
case "ENTITY": return this.entityRoute(definition);
|
|
1269
|
+
case "DOCUMENT": return {
|
|
1270
|
+
component: RouteUnsupportedComponent,
|
|
1271
|
+
title: titleOf(definition),
|
|
1272
|
+
data: { reason: `DOCUMENT routes are not yet supported (route '${definition.path}')` }
|
|
1273
|
+
};
|
|
1274
|
+
default: return {
|
|
1275
|
+
component: RouteUnsupportedComponent,
|
|
1276
|
+
title: titleOf(definition),
|
|
1277
|
+
data: { reason: `Unknown route kind '${String(definition.kind)}' (route '${definition.path}')` }
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
async entityRoute(definition) {
|
|
1282
|
+
const screens = await this.entityScreens.resolve(definition.entityName);
|
|
1283
|
+
return {
|
|
1284
|
+
...entityScreenRoute({
|
|
1285
|
+
entityName: definition.entityName,
|
|
1286
|
+
screens,
|
|
1287
|
+
hostPath: definition.path,
|
|
1288
|
+
data: {
|
|
1289
|
+
entityMode: definition.entityMode,
|
|
1290
|
+
rsqlFilter: definition.rsqlFilter
|
|
1291
|
+
}
|
|
1292
|
+
}),
|
|
1293
|
+
title: titleOf(definition)
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1297
|
+
minVersion: "12.0.0",
|
|
1298
|
+
version: "22.1.7",
|
|
1299
|
+
ngImport: i0,
|
|
1300
|
+
type: AppRouteRenderer,
|
|
1301
|
+
deps: [],
|
|
1302
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1303
|
+
});
|
|
1304
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1305
|
+
minVersion: "12.0.0",
|
|
1306
|
+
version: "22.1.7",
|
|
1307
|
+
ngImport: i0,
|
|
1308
|
+
type: AppRouteRenderer,
|
|
1309
|
+
providedIn: "root"
|
|
1310
|
+
});
|
|
1311
|
+
};
|
|
1312
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1313
|
+
minVersion: "12.0.0",
|
|
1314
|
+
version: "22.1.7",
|
|
1315
|
+
ngImport: i0,
|
|
1316
|
+
type: AppRouteRenderer,
|
|
1317
|
+
decorators: [{
|
|
1318
|
+
type: Injectable,
|
|
1319
|
+
args: [{ providedIn: "root" }]
|
|
1320
|
+
}]
|
|
1321
|
+
});
|
|
1322
|
+
var AppRegionFacade = class AppRegionFacade extends EmbeddedEntityFacade {
|
|
1323
|
+
entityType = RegionDefinition;
|
|
1324
|
+
createDescriptor() {
|
|
1325
|
+
return createRegionDefinitionDescriptor();
|
|
1326
|
+
}
|
|
1327
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1328
|
+
minVersion: "12.0.0",
|
|
1329
|
+
version: "22.1.7",
|
|
1330
|
+
ngImport: i0,
|
|
1331
|
+
type: AppRegionFacade,
|
|
1332
|
+
deps: null,
|
|
1333
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1334
|
+
});
|
|
1335
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1336
|
+
minVersion: "12.0.0",
|
|
1337
|
+
version: "22.1.7",
|
|
1338
|
+
ngImport: i0,
|
|
1339
|
+
type: AppRegionFacade
|
|
1340
|
+
});
|
|
1341
|
+
};
|
|
1342
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1343
|
+
minVersion: "12.0.0",
|
|
1344
|
+
version: "22.1.7",
|
|
1345
|
+
ngImport: i0,
|
|
1346
|
+
type: AppRegionFacade,
|
|
1347
|
+
decorators: [{ type: Injectable }]
|
|
1348
|
+
});
|
|
1349
|
+
var AppRouteFacade = class AppRouteFacade extends EmbeddedEntityFacade {
|
|
1350
|
+
entityType = RouteDefinition;
|
|
1351
|
+
createDescriptor() {
|
|
1352
|
+
return createRouteDefinitionDescriptor();
|
|
1353
|
+
}
|
|
1354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1355
|
+
minVersion: "12.0.0",
|
|
1356
|
+
version: "22.1.7",
|
|
1357
|
+
ngImport: i0,
|
|
1358
|
+
type: AppRouteFacade,
|
|
1359
|
+
deps: null,
|
|
1360
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1361
|
+
});
|
|
1362
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1363
|
+
minVersion: "12.0.0",
|
|
1364
|
+
version: "22.1.7",
|
|
1365
|
+
ngImport: i0,
|
|
1366
|
+
type: AppRouteFacade
|
|
1367
|
+
});
|
|
1368
|
+
};
|
|
1369
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1370
|
+
minVersion: "12.0.0",
|
|
1371
|
+
version: "22.1.7",
|
|
1372
|
+
ngImport: i0,
|
|
1373
|
+
type: AppRouteFacade,
|
|
1374
|
+
decorators: [{ type: Injectable }]
|
|
1375
|
+
});
|
|
1376
|
+
var AppWidgetFacade = class AppWidgetFacade extends EmbeddedEntityFacade {
|
|
1377
|
+
entityType = WidgetInstance;
|
|
1378
|
+
createDescriptor() {
|
|
1379
|
+
return createWidgetInstanceDescriptor();
|
|
1380
|
+
}
|
|
1381
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1382
|
+
minVersion: "12.0.0",
|
|
1383
|
+
version: "22.1.7",
|
|
1384
|
+
ngImport: i0,
|
|
1385
|
+
type: AppWidgetFacade,
|
|
1386
|
+
deps: null,
|
|
1387
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1388
|
+
});
|
|
1389
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1390
|
+
minVersion: "12.0.0",
|
|
1391
|
+
version: "22.1.7",
|
|
1392
|
+
ngImport: i0,
|
|
1393
|
+
type: AppWidgetFacade
|
|
1394
|
+
});
|
|
1395
|
+
};
|
|
1396
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1397
|
+
minVersion: "12.0.0",
|
|
1398
|
+
version: "22.1.7",
|
|
1399
|
+
ngImport: i0,
|
|
1400
|
+
type: AppWidgetFacade,
|
|
1401
|
+
decorators: [{ type: Injectable }]
|
|
1402
|
+
});
|
|
1403
|
+
const DEFAULT_PRESET = "sidenav-left";
|
|
1404
|
+
const DEFAULT_SIDENAV_MODE = "side";
|
|
1537
1405
|
function layoutOf(definition) {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1406
|
+
const preset = definition?.preset ?? definition?.layout?.preset ?? DEFAULT_PRESET;
|
|
1407
|
+
return {
|
|
1408
|
+
preset,
|
|
1409
|
+
sidenavMode: definition?.sidenavMode ?? definition?.layout?.sidenavMode ?? DEFAULT_SIDENAV_MODE,
|
|
1410
|
+
sidenavPosition: preset === "sidenav-right" ? "end" : "start",
|
|
1411
|
+
hasSidenav: preset !== "top-nav",
|
|
1412
|
+
sidenavOpened: definition?.sidenavOpenByDefault ?? true,
|
|
1413
|
+
sidenavCollapsible: definition?.sidenavCollapsible ?? true,
|
|
1414
|
+
contentMaxWidth: definition?.contentMaxWidth ?? definition?.layout?.contentMaxWidth
|
|
1415
|
+
};
|
|
1548
1416
|
}
|
|
1549
|
-
/**
|
|
1550
|
-
* The `--pp-*` overrides of one definition, as a style object to bind on the shell's host element.
|
|
1551
|
-
*
|
|
1552
|
-
* Custom properties cascade, so setting them on one element re-tints every framework surface below it
|
|
1553
|
-
* — which is what makes a themed preview possible at all without an iframe. `materialTheme` and
|
|
1554
|
-
* `colorScheme` are deliberately **not** handled: those want `:root` and a Material theme class, and
|
|
1555
|
-
* neither scopes to a subtree. They belong to the standalone runtime host, where the shell owns the
|
|
1556
|
-
* document.
|
|
1557
|
-
*
|
|
1558
|
-
* Keys are passed through untouched, including their leading `--`: Angular's `[style]` binding treats
|
|
1559
|
-
* a custom property as a custom property, and the contract calls these overrides of the tokens in
|
|
1560
|
-
* `pp-colors.css`, so anything else would be this function inventing a naming rule.
|
|
1561
|
-
*/
|
|
1562
1417
|
function themeVarsOf(definition) {
|
|
1563
|
-
|
|
1564
|
-
|
|
1418
|
+
return {
|
|
1419
|
+
...definition?.theme?.tokenOverrides,
|
|
1420
|
+
...definition?.tokenOverrides
|
|
1421
|
+
};
|
|
1565
1422
|
}
|
|
1566
|
-
/**
|
|
1567
|
-
* The route paths this definition accounts for: its own routes' paths, plus the base path of every module
|
|
1568
|
-
* it mounts.
|
|
1569
|
-
*
|
|
1570
|
-
* A module's *own* routes are deliberately absent. They live in the module's definition, which the router
|
|
1571
|
-
* fetches only when something navigates into the mount, so they cannot be known here — which is why the
|
|
1572
|
-
* consumer of this list treats a path *below* a known one as accounted for. See `toNavRows`.
|
|
1573
|
-
*/
|
|
1574
1423
|
function knownRoutePathsOf(definition) {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1424
|
+
const declared = (definition?.routes ?? []).map((route) => route.path);
|
|
1425
|
+
const mounted = (definition?.modules ?? []).map((mount) => mount.basePath);
|
|
1426
|
+
return [...declared, ...mounted].filter((path) => !!path);
|
|
1427
|
+
}
|
|
1428
|
+
function themeDefaultsOf(definition) {
|
|
1429
|
+
const preset = definition?.materialTheme ?? definition?.theme?.materialTheme;
|
|
1430
|
+
const scheme = definition?.colorScheme ?? definition?.theme?.colorScheme;
|
|
1431
|
+
return {
|
|
1432
|
+
...preset ? { preset } : {},
|
|
1433
|
+
...scheme ? { scheme } : {}
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
var RegionFooterComponent = class RegionFooterComponent {
|
|
1437
|
+
widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
|
|
1438
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1439
|
+
minVersion: "12.0.0",
|
|
1440
|
+
version: "22.1.7",
|
|
1441
|
+
ngImport: i0,
|
|
1442
|
+
type: RegionFooterComponent,
|
|
1443
|
+
deps: [],
|
|
1444
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1445
|
+
});
|
|
1446
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1447
|
+
minVersion: "17.1.0",
|
|
1448
|
+
version: "22.1.7",
|
|
1449
|
+
type: RegionFooterComponent,
|
|
1450
|
+
isStandalone: true,
|
|
1451
|
+
selector: "pp-region-footer",
|
|
1452
|
+
inputs: { widgets: {
|
|
1453
|
+
classPropertyName: "widgets",
|
|
1454
|
+
publicName: "widgets",
|
|
1455
|
+
isSignal: true,
|
|
1456
|
+
isRequired: false,
|
|
1457
|
+
transformFunction: null
|
|
1458
|
+
} },
|
|
1459
|
+
ngImport: i0,
|
|
1460
|
+
template: `<pp-widget-list [widgets]="widgets()" />`,
|
|
1461
|
+
isInline: true,
|
|
1462
|
+
styles: [":host{align-items:center;background-color:var(--pp-surface-header);color:var(--pp-on-header);display:flex;gap:16px;justify-content:space-between;padding:8px 16px}pp-widget-list{align-items:center;display:flex;gap:8px}\n"],
|
|
1463
|
+
dependencies: [{
|
|
1464
|
+
kind: "component",
|
|
1465
|
+
type: WidgetListComponent,
|
|
1466
|
+
selector: "pp-widget-list",
|
|
1467
|
+
inputs: ["widgets"]
|
|
1468
|
+
}]
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1471
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1472
|
+
minVersion: "12.0.0",
|
|
1473
|
+
version: "22.1.7",
|
|
1474
|
+
ngImport: i0,
|
|
1475
|
+
type: RegionFooterComponent,
|
|
1476
|
+
decorators: [{
|
|
1477
|
+
type: Component,
|
|
1478
|
+
args: [{
|
|
1479
|
+
selector: "pp-region-footer",
|
|
1480
|
+
standalone: true,
|
|
1481
|
+
imports: [WidgetListComponent],
|
|
1482
|
+
template: `<pp-widget-list [widgets]="widgets()" />`,
|
|
1483
|
+
styles: [":host{align-items:center;background-color:var(--pp-surface-header);color:var(--pp-on-header);display:flex;gap:16px;justify-content:space-between;padding:8px 16px}pp-widget-list{align-items:center;display:flex;gap:8px}\n"]
|
|
1484
|
+
}]
|
|
1485
|
+
}],
|
|
1486
|
+
propDecorators: { widgets: [{
|
|
1487
|
+
type: i0.Input,
|
|
1488
|
+
args: [{
|
|
1489
|
+
isSignal: true,
|
|
1490
|
+
alias: "widgets",
|
|
1491
|
+
required: false
|
|
1492
|
+
}]
|
|
1493
|
+
}] }
|
|
1494
|
+
});
|
|
1495
|
+
var RegionHeaderComponent = class RegionHeaderComponent {
|
|
1496
|
+
widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
|
|
1497
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1498
|
+
minVersion: "12.0.0",
|
|
1499
|
+
version: "22.1.7",
|
|
1500
|
+
ngImport: i0,
|
|
1501
|
+
type: RegionHeaderComponent,
|
|
1502
|
+
deps: [],
|
|
1503
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1504
|
+
});
|
|
1505
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1506
|
+
minVersion: "17.1.0",
|
|
1507
|
+
version: "22.1.7",
|
|
1508
|
+
type: RegionHeaderComponent,
|
|
1509
|
+
isStandalone: true,
|
|
1510
|
+
selector: "pp-region-header",
|
|
1511
|
+
inputs: { widgets: {
|
|
1512
|
+
classPropertyName: "widgets",
|
|
1513
|
+
publicName: "widgets",
|
|
1514
|
+
isSignal: true,
|
|
1515
|
+
isRequired: false,
|
|
1516
|
+
transformFunction: null
|
|
1517
|
+
} },
|
|
1518
|
+
ngImport: i0,
|
|
1519
|
+
template: `<pp-widget-list [widgets]="widgets()" />`,
|
|
1520
|
+
isInline: true,
|
|
1521
|
+
styles: [":host{--pp-app-title-color: var(--pp-on-header, inherit);background-color:var(--pp-surface-header);color:var(--pp-on-header);align-items:center;display:flex;flex:1;padding:8px 16px}pp-widget-list{align-items:center;display:flex;flex:1;gap:8px;min-width:0}\n"],
|
|
1522
|
+
dependencies: [{
|
|
1523
|
+
kind: "component",
|
|
1524
|
+
type: WidgetListComponent,
|
|
1525
|
+
selector: "pp-widget-list",
|
|
1526
|
+
inputs: ["widgets"]
|
|
1527
|
+
}]
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1531
|
+
minVersion: "12.0.0",
|
|
1532
|
+
version: "22.1.7",
|
|
1533
|
+
ngImport: i0,
|
|
1534
|
+
type: RegionHeaderComponent,
|
|
1535
|
+
decorators: [{
|
|
1536
|
+
type: Component,
|
|
1537
|
+
args: [{
|
|
1538
|
+
selector: "pp-region-header",
|
|
1539
|
+
standalone: true,
|
|
1540
|
+
imports: [WidgetListComponent],
|
|
1541
|
+
template: `<pp-widget-list [widgets]="widgets()" />`,
|
|
1542
|
+
styles: [":host{--pp-app-title-color: var(--pp-on-header, inherit);background-color:var(--pp-surface-header);color:var(--pp-on-header);align-items:center;display:flex;flex:1;padding:8px 16px}pp-widget-list{align-items:center;display:flex;flex:1;gap:8px;min-width:0}\n"]
|
|
1543
|
+
}]
|
|
1544
|
+
}],
|
|
1545
|
+
propDecorators: { widgets: [{
|
|
1546
|
+
type: i0.Input,
|
|
1547
|
+
args: [{
|
|
1548
|
+
isSignal: true,
|
|
1549
|
+
alias: "widgets",
|
|
1550
|
+
required: false
|
|
1551
|
+
}]
|
|
1552
|
+
}] }
|
|
1553
|
+
});
|
|
1671
1554
|
function toNavRows(items, knownPaths) {
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1555
|
+
return (items ?? []).map((item) => {
|
|
1556
|
+
const routePath = normalize(item.routePath);
|
|
1557
|
+
const resolved = routePath !== void 0 && knownPaths.some((known) => routePath === known || routePath.startsWith(`${known}/`));
|
|
1558
|
+
return {
|
|
1559
|
+
id: item.id,
|
|
1560
|
+
label: item.label,
|
|
1561
|
+
translocoId: item.translocoId,
|
|
1562
|
+
icon: item.icon,
|
|
1563
|
+
...resolved ? { routePath } : {},
|
|
1564
|
+
unresolved: routePath !== void 0 && !resolved,
|
|
1565
|
+
children: toNavRows(item.children, knownPaths)
|
|
1566
|
+
};
|
|
1567
|
+
});
|
|
1685
1568
|
}
|
|
1686
|
-
/**
|
|
1687
|
-
* A route path as it is compared and linked: no surrounding slashes, since `RouteDefinition.path` is
|
|
1688
|
-
* relative with no leading slash by contract and a nav item may still have been authored with one.
|
|
1689
|
-
* Whitespace-only counts as absent — an item mid-authoring is a group node, not a broken link.
|
|
1690
|
-
*/
|
|
1691
1569
|
function normalize(routePath) {
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1570
|
+
const trimmed = routePath?.trim().replace(/^\/+|\/+$/g, "").trim();
|
|
1571
|
+
return trimmed ? trimmed : void 0;
|
|
1572
|
+
}
|
|
1573
|
+
var RegionNavComponent = class RegionNavComponent {
|
|
1574
|
+
navItems = input([], ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
|
|
1575
|
+
orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
1576
|
+
compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
|
|
1577
|
+
knownPaths = input([], ...ngDevMode ? [{ debugName: "knownPaths" }] : /* istanbul ignore next */ []);
|
|
1578
|
+
rows = computed(() => toNavRows(this.navItems(), this.knownPaths()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
1579
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1580
|
+
minVersion: "12.0.0",
|
|
1581
|
+
version: "22.1.7",
|
|
1582
|
+
ngImport: i0,
|
|
1583
|
+
type: RegionNavComponent,
|
|
1584
|
+
deps: [],
|
|
1585
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1586
|
+
});
|
|
1587
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1588
|
+
minVersion: "17.0.0",
|
|
1589
|
+
version: "22.1.7",
|
|
1590
|
+
type: RegionNavComponent,
|
|
1591
|
+
isStandalone: true,
|
|
1592
|
+
selector: "pp-region-nav",
|
|
1593
|
+
inputs: {
|
|
1594
|
+
navItems: {
|
|
1595
|
+
classPropertyName: "navItems",
|
|
1596
|
+
publicName: "navItems",
|
|
1597
|
+
isSignal: true,
|
|
1598
|
+
isRequired: false,
|
|
1599
|
+
transformFunction: null
|
|
1600
|
+
},
|
|
1601
|
+
orientation: {
|
|
1602
|
+
classPropertyName: "orientation",
|
|
1603
|
+
publicName: "orientation",
|
|
1604
|
+
isSignal: true,
|
|
1605
|
+
isRequired: false,
|
|
1606
|
+
transformFunction: null
|
|
1607
|
+
},
|
|
1608
|
+
compact: {
|
|
1609
|
+
classPropertyName: "compact",
|
|
1610
|
+
publicName: "compact",
|
|
1611
|
+
isSignal: true,
|
|
1612
|
+
isRequired: false,
|
|
1613
|
+
transformFunction: null
|
|
1614
|
+
},
|
|
1615
|
+
knownPaths: {
|
|
1616
|
+
classPropertyName: "knownPaths",
|
|
1617
|
+
publicName: "knownPaths",
|
|
1618
|
+
isSignal: true,
|
|
1619
|
+
isRequired: false,
|
|
1620
|
+
transformFunction: null
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
ngImport: i0,
|
|
1624
|
+
template: `
|
|
1625
|
+
@if (compact()) {
|
|
1626
|
+
<nav class="pp-region-nav--compact">
|
|
1627
|
+
<ng-container *ngTemplateOutlet="compactRowList; context: { $implicit: rows() }"></ng-container>
|
|
1628
|
+
</nav>
|
|
1629
|
+
} @else {
|
|
1630
|
+
<mat-nav-list [class.pp-region-nav--horizontal]="orientation() === 'horizontal'">
|
|
1631
|
+
<ng-container *ngTemplateOutlet="rowList; context: { $implicit: rows(), depth: 0 }"></ng-container>
|
|
1632
|
+
</mat-nav-list>
|
|
1633
|
+
}
|
|
1729
1634
|
|
|
1730
1635
|
<!--
|
|
1731
1636
|
Recursive through ngTemplateOutlet: a NavItem nests in itself, so the depth is not knowable here.
|
|
@@ -1773,14 +1678,145 @@ class RegionNavComponent {
|
|
|
1773
1678
|
}
|
|
1774
1679
|
}
|
|
1775
1680
|
</ng-template>
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1681
|
+
<!--
|
|
1682
|
+
The compact rows of a tablet layout: the icon above a short label, so the drawer — which is sized to its
|
|
1683
|
+
content — narrows to a rail. Plain elements rather than list items, whose fixed height and leading-icon
|
|
1684
|
+
slot are exactly the row layout this replaces. Nesting is shown by order alone; a rail has no room for
|
|
1685
|
+
indentation.
|
|
1686
|
+
-->
|
|
1687
|
+
<ng-template #compactRowList let-rows>
|
|
1688
|
+
@for (row of rows; track row.id) {
|
|
1689
|
+
@if (row.routePath; as routePath) {
|
|
1690
|
+
<a class="pp-region-nav__compact-item" [routerLink]="routePath" routerLinkActive="pp-region-nav__item--active" [attr.data-testid]="'nav-' + row.id">
|
|
1691
|
+
@if (row.icon) {
|
|
1692
|
+
<span class="material-symbols-outlined pp-region-nav__compact-icon">{{ row.icon }}</span>
|
|
1693
|
+
}
|
|
1694
|
+
<span class="pp-region-nav__compact-label">{{ row.translocoId | ppLabel: row.label }}</span>
|
|
1695
|
+
</a>
|
|
1696
|
+
} @else {
|
|
1697
|
+
<span
|
|
1698
|
+
class="pp-region-nav__compact-item"
|
|
1699
|
+
[class.pp-region-nav__item--unresolved]="row.unresolved"
|
|
1700
|
+
[title]="row.unresolved ? 'No route of this application matches this navigation entry yet.' : ''"
|
|
1701
|
+
[attr.data-testid]="'nav-' + row.id"
|
|
1702
|
+
>
|
|
1703
|
+
@if (row.icon) {
|
|
1704
|
+
<span class="material-symbols-outlined pp-region-nav__compact-icon">{{ row.icon }}</span>
|
|
1705
|
+
}
|
|
1706
|
+
<span class="pp-region-nav__compact-label">{{ row.translocoId | ppLabel: row.label }}</span>
|
|
1707
|
+
</span>
|
|
1708
|
+
}
|
|
1709
|
+
@if (row.children.length) {
|
|
1710
|
+
<ng-container *ngTemplateOutlet="compactRowList; context: { $implicit: row.children }"></ng-container>
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
</ng-template>
|
|
1714
|
+
`,
|
|
1715
|
+
isInline: true,
|
|
1716
|
+
styles: [":host{display:block}.pp-region-nav--horizontal{display:flex;padding-top:0}.pp-region-nav--horizontal .pp-region-nav__item{width:auto}.pp-region-nav--compact{display:flex;flex-direction:column;gap:4px;padding:8px 4px}.pp-region-nav__compact-item{align-items:center;border-radius:8px;color:inherit;display:flex;flex-direction:column;gap:2px;padding:6px 4px;text-decoration:none}a.pp-region-nav__compact-item:hover,.pp-region-nav__compact-item.pp-region-nav__item--active{background-color:color-mix(in srgb,currentColor 12%,transparent)}.pp-region-nav__compact-label{font:var(--mat-sys-label-small);max-width:80px;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.pp-region-nav__item--unresolved{font-style:italic;opacity:.6}\n"],
|
|
1717
|
+
dependencies: [
|
|
1718
|
+
{
|
|
1719
|
+
kind: "component",
|
|
1720
|
+
type: MatNavList,
|
|
1721
|
+
selector: "mat-nav-list",
|
|
1722
|
+
exportAs: ["matNavList"]
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
kind: "component",
|
|
1726
|
+
type: MatListItem,
|
|
1727
|
+
selector: "mat-list-item, a[mat-list-item], button[mat-list-item]",
|
|
1728
|
+
inputs: ["activated"],
|
|
1729
|
+
exportAs: ["matListItem"]
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
kind: "directive",
|
|
1733
|
+
type: MatListItemIcon,
|
|
1734
|
+
selector: "[matListItemIcon]"
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
kind: "directive",
|
|
1738
|
+
type: MatListItemTitle,
|
|
1739
|
+
selector: "[matListItemTitle]"
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
kind: "directive",
|
|
1743
|
+
type: NgTemplateOutlet,
|
|
1744
|
+
selector: "[ngTemplateOutlet]",
|
|
1745
|
+
inputs: [
|
|
1746
|
+
"ngTemplateOutletContext",
|
|
1747
|
+
"ngTemplateOutlet",
|
|
1748
|
+
"ngTemplateOutletInjector"
|
|
1749
|
+
]
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
kind: "directive",
|
|
1753
|
+
type: RouterLink,
|
|
1754
|
+
selector: "[routerLink]",
|
|
1755
|
+
inputs: [
|
|
1756
|
+
"target",
|
|
1757
|
+
"queryParams",
|
|
1758
|
+
"fragment",
|
|
1759
|
+
"queryParamsHandling",
|
|
1760
|
+
"state",
|
|
1761
|
+
"info",
|
|
1762
|
+
"relativeTo",
|
|
1763
|
+
"preserveFragment",
|
|
1764
|
+
"skipLocationChange",
|
|
1765
|
+
"replaceUrl",
|
|
1766
|
+
"browserUrl",
|
|
1767
|
+
"routerLink"
|
|
1768
|
+
]
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
kind: "directive",
|
|
1772
|
+
type: RouterLinkActive,
|
|
1773
|
+
selector: "[routerLinkActive]",
|
|
1774
|
+
inputs: [
|
|
1775
|
+
"routerLinkActiveOptions",
|
|
1776
|
+
"ariaCurrentWhenActive",
|
|
1777
|
+
"routerLinkActive"
|
|
1778
|
+
],
|
|
1779
|
+
outputs: ["isActiveChange"],
|
|
1780
|
+
exportAs: ["routerLinkActive"]
|
|
1781
|
+
},
|
|
1782
|
+
{
|
|
1783
|
+
kind: "pipe",
|
|
1784
|
+
type: EntityLabelPipe,
|
|
1785
|
+
name: "ppLabel"
|
|
1786
|
+
}
|
|
1787
|
+
]
|
|
1788
|
+
});
|
|
1789
|
+
};
|
|
1790
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1791
|
+
minVersion: "12.0.0",
|
|
1792
|
+
version: "22.1.7",
|
|
1793
|
+
ngImport: i0,
|
|
1794
|
+
type: RegionNavComponent,
|
|
1795
|
+
decorators: [{
|
|
1796
|
+
type: Component,
|
|
1797
|
+
args: [{
|
|
1798
|
+
selector: "pp-region-nav",
|
|
1799
|
+
standalone: true,
|
|
1800
|
+
imports: [
|
|
1801
|
+
MatNavList,
|
|
1802
|
+
MatListItem,
|
|
1803
|
+
MatListItemIcon,
|
|
1804
|
+
MatListItemTitle,
|
|
1805
|
+
NgTemplateOutlet,
|
|
1806
|
+
RouterLink,
|
|
1807
|
+
RouterLinkActive,
|
|
1808
|
+
EntityLabelPipe
|
|
1809
|
+
],
|
|
1810
|
+
template: `
|
|
1811
|
+
@if (compact()) {
|
|
1812
|
+
<nav class="pp-region-nav--compact">
|
|
1813
|
+
<ng-container *ngTemplateOutlet="compactRowList; context: { $implicit: rows() }"></ng-container>
|
|
1814
|
+
</nav>
|
|
1815
|
+
} @else {
|
|
1816
|
+
<mat-nav-list [class.pp-region-nav--horizontal]="orientation() === 'horizontal'">
|
|
1817
|
+
<ng-container *ngTemplateOutlet="rowList; context: { $implicit: rows(), depth: 0 }"></ng-container>
|
|
1818
|
+
</mat-nav-list>
|
|
1819
|
+
}
|
|
1784
1820
|
|
|
1785
1821
|
<!--
|
|
1786
1822
|
Recursive through ngTemplateOutlet: a NavItem nests in itself, so the depth is not knowable here.
|
|
@@ -1828,134 +1864,283 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
1828
1864
|
}
|
|
1829
1865
|
}
|
|
1830
1866
|
</ng-template>
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
class
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
// `knownPaths` comes from the definition rather than the region: whether a nav entry resolves is a
|
|
1859
|
-
// question about the *application's* routes, which only this function can see from here.
|
|
1860
|
-
return { slot: 'sidenav', component: RegionNavComponent, inputs: { navItems: region.navItems ?? [], knownPaths: knownRoutePathsOf(definition) } };
|
|
1861
|
-
default:
|
|
1862
|
-
// A region whose `type` the designer has not chosen yet. `RegionDefinition.type` is
|
|
1863
|
-
// `RegionType | undefined` precisely because a row exists before its dropdown is touched, and
|
|
1864
|
-
// the preview renders it *while* that is happening — so this is the normal path, not an error
|
|
1865
|
-
// one. Omitting it is quieter than a placeholder, and the form already shows the empty row.
|
|
1866
|
-
return undefined;
|
|
1867
|
+
<!--
|
|
1868
|
+
The compact rows of a tablet layout: the icon above a short label, so the drawer — which is sized to its
|
|
1869
|
+
content — narrows to a rail. Plain elements rather than list items, whose fixed height and leading-icon
|
|
1870
|
+
slot are exactly the row layout this replaces. Nesting is shown by order alone; a rail has no room for
|
|
1871
|
+
indentation.
|
|
1872
|
+
-->
|
|
1873
|
+
<ng-template #compactRowList let-rows>
|
|
1874
|
+
@for (row of rows; track row.id) {
|
|
1875
|
+
@if (row.routePath; as routePath) {
|
|
1876
|
+
<a class="pp-region-nav__compact-item" [routerLink]="routePath" routerLinkActive="pp-region-nav__item--active" [attr.data-testid]="'nav-' + row.id">
|
|
1877
|
+
@if (row.icon) {
|
|
1878
|
+
<span class="material-symbols-outlined pp-region-nav__compact-icon">{{ row.icon }}</span>
|
|
1879
|
+
}
|
|
1880
|
+
<span class="pp-region-nav__compact-label">{{ row.translocoId | ppLabel: row.label }}</span>
|
|
1881
|
+
</a>
|
|
1882
|
+
} @else {
|
|
1883
|
+
<span
|
|
1884
|
+
class="pp-region-nav__compact-item"
|
|
1885
|
+
[class.pp-region-nav__item--unresolved]="row.unresolved"
|
|
1886
|
+
[title]="row.unresolved ? 'No route of this application matches this navigation entry yet.' : ''"
|
|
1887
|
+
[attr.data-testid]="'nav-' + row.id"
|
|
1888
|
+
>
|
|
1889
|
+
@if (row.icon) {
|
|
1890
|
+
<span class="material-symbols-outlined pp-region-nav__compact-icon">{{ row.icon }}</span>
|
|
1891
|
+
}
|
|
1892
|
+
<span class="pp-region-nav__compact-label">{{ row.translocoId | ppLabel: row.label }}</span>
|
|
1893
|
+
</span>
|
|
1867
1894
|
}
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1895
|
+
@if (row.children.length) {
|
|
1896
|
+
<ng-container *ngTemplateOutlet="compactRowList; context: { $implicit: row.children }"></ng-container>
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
</ng-template>
|
|
1900
|
+
`,
|
|
1901
|
+
styles: [":host{display:block}.pp-region-nav--horizontal{display:flex;padding-top:0}.pp-region-nav--horizontal .pp-region-nav__item{width:auto}.pp-region-nav--compact{display:flex;flex-direction:column;gap:4px;padding:8px 4px}.pp-region-nav__compact-item{align-items:center;border-radius:8px;color:inherit;display:flex;flex-direction:column;gap:2px;padding:6px 4px;text-decoration:none}a.pp-region-nav__compact-item:hover,.pp-region-nav__compact-item.pp-region-nav__item--active{background-color:color-mix(in srgb,currentColor 12%,transparent)}.pp-region-nav__compact-label{font:var(--mat-sys-label-small);max-width:80px;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.pp-region-nav__item--unresolved{font-style:italic;opacity:.6}\n"]
|
|
1902
|
+
}]
|
|
1903
|
+
}],
|
|
1904
|
+
propDecorators: {
|
|
1905
|
+
navItems: [{
|
|
1906
|
+
type: i0.Input,
|
|
1907
|
+
args: [{
|
|
1908
|
+
isSignal: true,
|
|
1909
|
+
alias: "navItems",
|
|
1910
|
+
required: false
|
|
1911
|
+
}]
|
|
1912
|
+
}],
|
|
1913
|
+
orientation: [{
|
|
1914
|
+
type: i0.Input,
|
|
1915
|
+
args: [{
|
|
1916
|
+
isSignal: true,
|
|
1917
|
+
alias: "orientation",
|
|
1918
|
+
required: false
|
|
1919
|
+
}]
|
|
1920
|
+
}],
|
|
1921
|
+
compact: [{
|
|
1922
|
+
type: i0.Input,
|
|
1923
|
+
args: [{
|
|
1924
|
+
isSignal: true,
|
|
1925
|
+
alias: "compact",
|
|
1926
|
+
required: false
|
|
1927
|
+
}]
|
|
1928
|
+
}],
|
|
1929
|
+
knownPaths: [{
|
|
1930
|
+
type: i0.Input,
|
|
1931
|
+
args: [{
|
|
1932
|
+
isSignal: true,
|
|
1933
|
+
alias: "knownPaths",
|
|
1934
|
+
required: false
|
|
1935
|
+
}]
|
|
1936
|
+
}]
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
var AppRegionRenderer = class AppRegionRenderer {
|
|
1940
|
+
render = (region, definition) => {
|
|
1941
|
+
switch (region.type) {
|
|
1942
|
+
case "header": return {
|
|
1943
|
+
slot: "header",
|
|
1944
|
+
component: RegionHeaderComponent,
|
|
1945
|
+
inputs: { widgets: region.widgets ?? [] }
|
|
1946
|
+
};
|
|
1947
|
+
case "footer": return {
|
|
1948
|
+
slot: "footer",
|
|
1949
|
+
component: RegionFooterComponent,
|
|
1950
|
+
inputs: { widgets: region.widgets ?? [] }
|
|
1951
|
+
};
|
|
1952
|
+
case "sidenav": return {
|
|
1953
|
+
slot: "sidenav",
|
|
1954
|
+
component: RegionNavComponent,
|
|
1955
|
+
inputs: {
|
|
1956
|
+
navItems: region.navItems ?? [],
|
|
1957
|
+
knownPaths: knownRoutePathsOf(definition)
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
default: return;
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1964
|
+
minVersion: "12.0.0",
|
|
1965
|
+
version: "22.1.7",
|
|
1966
|
+
ngImport: i0,
|
|
1967
|
+
type: AppRegionRenderer,
|
|
1968
|
+
deps: [],
|
|
1969
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1970
|
+
});
|
|
1971
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1972
|
+
minVersion: "12.0.0",
|
|
1973
|
+
version: "22.1.7",
|
|
1974
|
+
ngImport: i0,
|
|
1975
|
+
type: AppRegionRenderer,
|
|
1976
|
+
providedIn: "root"
|
|
1977
|
+
});
|
|
1978
|
+
};
|
|
1979
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1980
|
+
minVersion: "12.0.0",
|
|
1981
|
+
version: "22.1.7",
|
|
1982
|
+
ngImport: i0,
|
|
1983
|
+
type: AppRegionRenderer,
|
|
1984
|
+
decorators: [{
|
|
1985
|
+
type: Injectable,
|
|
1986
|
+
args: [{ providedIn: "root" }]
|
|
1987
|
+
}]
|
|
1988
|
+
});
|
|
1989
|
+
var ShellApplicationContext = class ShellApplicationContext {
|
|
1990
|
+
definition = signal(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
|
|
1991
|
+
name = computed(() => this.definition()?.name ?? "", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
1992
|
+
logoUrl = computed(() => this.definition()?.logoUrl ?? this.definition()?.theme?.logoUrl, ...ngDevMode ? [{ debugName: "logoUrl" }] : /* istanbul ignore next */ []);
|
|
1993
|
+
navItems = computed(() => navMenuItemsOf(this.definition()), ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
|
|
1994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1995
|
+
minVersion: "12.0.0",
|
|
1996
|
+
version: "22.1.7",
|
|
1997
|
+
ngImport: i0,
|
|
1998
|
+
type: ShellApplicationContext,
|
|
1999
|
+
deps: [],
|
|
2000
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2001
|
+
});
|
|
2002
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2003
|
+
minVersion: "12.0.0",
|
|
2004
|
+
version: "22.1.7",
|
|
2005
|
+
ngImport: i0,
|
|
2006
|
+
type: ShellApplicationContext
|
|
2007
|
+
});
|
|
2008
|
+
};
|
|
2009
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2010
|
+
minVersion: "12.0.0",
|
|
2011
|
+
version: "22.1.7",
|
|
2012
|
+
ngImport: i0,
|
|
2013
|
+
type: ShellApplicationContext,
|
|
2014
|
+
decorators: [{ type: Injectable }]
|
|
2015
|
+
});
|
|
2016
|
+
function navMenuItemsOf(definition) {
|
|
2017
|
+
const sidenav = definition?.regions?.find((region) => region.type === "sidenav");
|
|
2018
|
+
return toMenuItems(toNavRows(sidenav?.navItems, knownRoutePathsOf(definition)));
|
|
2019
|
+
}
|
|
2020
|
+
function toMenuItems(rows) {
|
|
2021
|
+
return rows.map((row) => ({
|
|
2022
|
+
id: row.id,
|
|
2023
|
+
label: row.label,
|
|
2024
|
+
...row.translocoId ? { translocoId: row.translocoId } : {},
|
|
2025
|
+
...row.icon ? { icon: row.icon } : {},
|
|
2026
|
+
...row.routePath ? { routePath: row.routePath } : {},
|
|
2027
|
+
...row.children.length ? { children: toMenuItems(row.children) } : {}
|
|
2028
|
+
}));
|
|
2029
|
+
}
|
|
2030
|
+
var ShellOverlayContainer = class ShellOverlayContainer extends OverlayContainer {
|
|
2031
|
+
host = inject(ElementRef).nativeElement;
|
|
2032
|
+
_createContainer() {
|
|
2033
|
+
super._createContainer();
|
|
2034
|
+
if (this._containerElement) this.host.appendChild(this._containerElement);
|
|
2035
|
+
}
|
|
2036
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2037
|
+
minVersion: "12.0.0",
|
|
2038
|
+
version: "22.1.7",
|
|
2039
|
+
ngImport: i0,
|
|
2040
|
+
type: ShellOverlayContainer,
|
|
2041
|
+
deps: null,
|
|
2042
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2043
|
+
});
|
|
2044
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2045
|
+
minVersion: "12.0.0",
|
|
2046
|
+
version: "22.1.7",
|
|
2047
|
+
ngImport: i0,
|
|
2048
|
+
type: ShellOverlayContainer
|
|
2049
|
+
});
|
|
2050
|
+
};
|
|
2051
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2052
|
+
minVersion: "12.0.0",
|
|
2053
|
+
version: "22.1.7",
|
|
2054
|
+
ngImport: i0,
|
|
2055
|
+
type: ShellOverlayContainer,
|
|
2056
|
+
decorators: [{ type: Injectable }]
|
|
2057
|
+
});
|
|
2058
|
+
var AppShellComponent = class AppShellComponent {
|
|
2059
|
+
definition = input(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
|
|
2060
|
+
persistTheme = input(true, ...ngDevMode ? [{ debugName: "persistTheme" }] : /* istanbul ignore next */ []);
|
|
2061
|
+
regionRenderer = inject(AppRegionRenderer);
|
|
2062
|
+
theme = inject(ThemeService);
|
|
2063
|
+
applicationContext = inject(ShellApplicationContext);
|
|
2064
|
+
layoutService = inject(LayoutService);
|
|
2065
|
+
layout = computed(() => layoutOf(this.definition()), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
2066
|
+
themeVars = computed(() => themeVarsOf(this.definition()), ...ngDevMode ? [{ debugName: "themeVars" }] : /* istanbul ignore next */ []);
|
|
2067
|
+
themeClass = this.theme.themeClass;
|
|
2068
|
+
applyThemeDefaults = effect(() => {
|
|
2069
|
+
const definition = this.definition();
|
|
2070
|
+
this.theme.setDefaults(themeDefaultsOf(definition));
|
|
2071
|
+
this.theme.persistUnder(this.persistTheme() && definition?.id ? `pp-theme:${definition.id}` : null);
|
|
2072
|
+
this.applicationContext.definition.set(definition);
|
|
2073
|
+
}, ...ngDevMode ? [{ debugName: "applyThemeDefaults" }] : /* istanbul ignore next */ []);
|
|
2074
|
+
regionViews = computed(() => (this.definition()?.regions ?? []).map((region) => this.regionRenderer.render(region, this.definition())).filter((view) => view !== void 0), ...ngDevMode ? [{ debugName: "regionViews" }] : /* istanbul ignore next */ []);
|
|
2075
|
+
headerView = computed(() => this.viewOf("header"), ...ngDevMode ? [{ debugName: "headerView" }] : /* istanbul ignore next */ []);
|
|
2076
|
+
footerView = computed(() => this.viewOf("footer"), ...ngDevMode ? [{ debugName: "footerView" }] : /* istanbul ignore next */ []);
|
|
2077
|
+
sidenavView = computed(() => this.layout().hasSidenav && !this.isSmallScreen() ? this.viewOf("sidenav") : void 0, ...ngDevMode ? [{ debugName: "sidenavView" }] : /* istanbul ignore next */ []);
|
|
2078
|
+
topNavView = computed(() => this.layout().hasSidenav || this.isSmallScreen() ? void 0 : this.viewOf("sidenav"), ...ngDevMode ? [{ debugName: "topNavView" }] : /* istanbul ignore next */ []);
|
|
2079
|
+
isSmallScreen = computed(() => this.layoutService.isSmallDevice(), ...ngDevMode ? [{ debugName: "isSmallScreen" }] : /* istanbul ignore next */ []);
|
|
2080
|
+
sidenavInputs = computed(() => ({
|
|
2081
|
+
...this.navInputsOf(this.sidenavView(), "vertical"),
|
|
2082
|
+
compact: this.layoutService.isMediumDevice()
|
|
2083
|
+
}), ...ngDevMode ? [{ debugName: "sidenavInputs" }] : /* istanbul ignore next */ []);
|
|
2084
|
+
topNavInputs = computed(() => this.navInputsOf(this.topNavView(), "horizontal"), ...ngDevMode ? [{ debugName: "topNavInputs" }] : /* istanbul ignore next */ []);
|
|
2085
|
+
navInputsOf(view, orientation) {
|
|
2086
|
+
return {
|
|
2087
|
+
...view?.inputs,
|
|
2088
|
+
orientation
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
viewOf(slot) {
|
|
2092
|
+
return this.regionViews().find((view) => view.slot === slot);
|
|
2093
|
+
}
|
|
2094
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2095
|
+
minVersion: "12.0.0",
|
|
2096
|
+
version: "22.1.7",
|
|
2097
|
+
ngImport: i0,
|
|
2098
|
+
type: AppShellComponent,
|
|
2099
|
+
deps: [],
|
|
2100
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2101
|
+
});
|
|
2102
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2103
|
+
minVersion: "17.0.0",
|
|
2104
|
+
version: "22.1.7",
|
|
2105
|
+
type: AppShellComponent,
|
|
2106
|
+
isStandalone: true,
|
|
2107
|
+
selector: "pp-app-shell",
|
|
2108
|
+
inputs: {
|
|
2109
|
+
definition: {
|
|
2110
|
+
classPropertyName: "definition",
|
|
2111
|
+
publicName: "definition",
|
|
2112
|
+
isSignal: true,
|
|
2113
|
+
isRequired: false,
|
|
2114
|
+
transformFunction: null
|
|
2115
|
+
},
|
|
2116
|
+
persistTheme: {
|
|
2117
|
+
classPropertyName: "persistTheme",
|
|
2118
|
+
publicName: "persistTheme",
|
|
2119
|
+
isSignal: true,
|
|
2120
|
+
isRequired: false,
|
|
2121
|
+
transformFunction: null
|
|
2122
|
+
}
|
|
2123
|
+
},
|
|
2124
|
+
host: { properties: {
|
|
2125
|
+
"class": "themeClass()",
|
|
2126
|
+
"style": "themeVars()"
|
|
2127
|
+
} },
|
|
2128
|
+
providers: [
|
|
2129
|
+
ThemeService,
|
|
2130
|
+
ShellApplicationContext,
|
|
2131
|
+
{
|
|
2132
|
+
provide: APPLICATION_CONTEXT,
|
|
2133
|
+
useExisting: ShellApplicationContext
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
provide: OverlayContainer,
|
|
2137
|
+
useClass: ShellOverlayContainer
|
|
2138
|
+
},
|
|
2139
|
+
Dialog,
|
|
2140
|
+
MatDialog
|
|
2141
|
+
],
|
|
2142
|
+
ngImport: i0,
|
|
2143
|
+
template: `
|
|
1959
2144
|
@if (headerView() || topNavView()) {
|
|
1960
2145
|
<div class="pp-app-shell__top">
|
|
1961
2146
|
@if (headerView(); as view) {
|
|
@@ -1969,7 +2154,13 @@ class AppShellComponent {
|
|
|
1969
2154
|
|
|
1970
2155
|
<mat-sidenav-container class="pp-app-shell__body">
|
|
1971
2156
|
@if (sidenavView(); as view) {
|
|
1972
|
-
<mat-sidenav
|
|
2157
|
+
<mat-sidenav
|
|
2158
|
+
class="pp-app-shell__sidenav"
|
|
2159
|
+
ppSidenavAutosize
|
|
2160
|
+
[mode]="layout().sidenavMode"
|
|
2161
|
+
[opened]="layout().sidenavOpened && !layoutService.isSidenavHidden()"
|
|
2162
|
+
[position]="layout().sidenavPosition"
|
|
2163
|
+
>
|
|
1973
2164
|
<ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
|
|
1974
2165
|
</mat-sidenav>
|
|
1975
2166
|
}
|
|
@@ -1983,11 +2174,104 @@ class AppShellComponent {
|
|
|
1983
2174
|
@if (footerView(); as view) {
|
|
1984
2175
|
<ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
|
|
1985
2176
|
}
|
|
1986
|
-
`,
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2177
|
+
`,
|
|
2178
|
+
isInline: true,
|
|
2179
|
+
styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"],
|
|
2180
|
+
dependencies: [
|
|
2181
|
+
{
|
|
2182
|
+
kind: "directive",
|
|
2183
|
+
type: NgComponentOutlet,
|
|
2184
|
+
selector: "[ngComponentOutlet]",
|
|
2185
|
+
inputs: [
|
|
2186
|
+
"ngComponentOutlet",
|
|
2187
|
+
"ngComponentOutletInputs",
|
|
2188
|
+
"ngComponentOutletInjector",
|
|
2189
|
+
"ngComponentOutletEnvironmentInjector",
|
|
2190
|
+
"ngComponentOutletContent",
|
|
2191
|
+
"ngComponentOutletNgModule"
|
|
2192
|
+
],
|
|
2193
|
+
exportAs: ["ngComponentOutlet"]
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
kind: "component",
|
|
2197
|
+
type: MatSidenav,
|
|
2198
|
+
selector: "mat-sidenav",
|
|
2199
|
+
inputs: [
|
|
2200
|
+
"fixedInViewport",
|
|
2201
|
+
"fixedTopGap",
|
|
2202
|
+
"fixedBottomGap"
|
|
2203
|
+
],
|
|
2204
|
+
exportAs: ["matSidenav"]
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
kind: "component",
|
|
2208
|
+
type: MatSidenavContainer,
|
|
2209
|
+
selector: "mat-sidenav-container",
|
|
2210
|
+
exportAs: ["matSidenavContainer"]
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
kind: "component",
|
|
2214
|
+
type: MatSidenavContent,
|
|
2215
|
+
selector: "mat-sidenav-content"
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
kind: "directive",
|
|
2219
|
+
type: RouterOutlet,
|
|
2220
|
+
selector: "router-outlet",
|
|
2221
|
+
inputs: ["name", "routerOutletData"],
|
|
2222
|
+
outputs: [
|
|
2223
|
+
"activate",
|
|
2224
|
+
"deactivate",
|
|
2225
|
+
"attach",
|
|
2226
|
+
"detach"
|
|
2227
|
+
],
|
|
2228
|
+
exportAs: ["outlet"]
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
kind: "directive",
|
|
2232
|
+
type: SidenavAutosizeDirective,
|
|
2233
|
+
selector: "mat-sidenav[ppSidenavAutosize]"
|
|
2234
|
+
}
|
|
2235
|
+
]
|
|
2236
|
+
});
|
|
2237
|
+
};
|
|
2238
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2239
|
+
minVersion: "12.0.0",
|
|
2240
|
+
version: "22.1.7",
|
|
2241
|
+
ngImport: i0,
|
|
2242
|
+
type: AppShellComponent,
|
|
2243
|
+
decorators: [{
|
|
2244
|
+
type: Component,
|
|
2245
|
+
args: [{
|
|
2246
|
+
selector: "pp-app-shell",
|
|
2247
|
+
standalone: true,
|
|
2248
|
+
imports: [
|
|
2249
|
+
NgComponentOutlet,
|
|
2250
|
+
MatSidenav,
|
|
2251
|
+
MatSidenavContainer,
|
|
2252
|
+
MatSidenavContent,
|
|
2253
|
+
RouterOutlet,
|
|
2254
|
+
SidenavAutosizeDirective
|
|
2255
|
+
],
|
|
2256
|
+
providers: [
|
|
2257
|
+
ThemeService,
|
|
2258
|
+
ShellApplicationContext,
|
|
2259
|
+
{
|
|
2260
|
+
provide: APPLICATION_CONTEXT,
|
|
2261
|
+
useExisting: ShellApplicationContext
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
provide: OverlayContainer,
|
|
2265
|
+
useClass: ShellOverlayContainer
|
|
2266
|
+
},
|
|
2267
|
+
Dialog,
|
|
2268
|
+
MatDialog
|
|
2269
|
+
],
|
|
2270
|
+
host: {
|
|
2271
|
+
"[class]": "themeClass()",
|
|
2272
|
+
"[style]": "themeVars()"
|
|
2273
|
+
},
|
|
2274
|
+
template: `
|
|
1991
2275
|
@if (headerView() || topNavView()) {
|
|
1992
2276
|
<div class="pp-app-shell__top">
|
|
1993
2277
|
@if (headerView(); as view) {
|
|
@@ -2001,7 +2285,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
2001
2285
|
|
|
2002
2286
|
<mat-sidenav-container class="pp-app-shell__body">
|
|
2003
2287
|
@if (sidenavView(); as view) {
|
|
2004
|
-
<mat-sidenav
|
|
2288
|
+
<mat-sidenav
|
|
2289
|
+
class="pp-app-shell__sidenav"
|
|
2290
|
+
ppSidenavAutosize
|
|
2291
|
+
[mode]="layout().sidenavMode"
|
|
2292
|
+
[opened]="layout().sidenavOpened && !layoutService.isSidenavHidden()"
|
|
2293
|
+
[position]="layout().sidenavPosition"
|
|
2294
|
+
>
|
|
2005
2295
|
<ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
|
|
2006
2296
|
</mat-sidenav>
|
|
2007
2297
|
}
|
|
@@ -2015,389 +2305,455 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
2015
2305
|
@if (footerView(); as view) {
|
|
2016
2306
|
<ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
|
|
2017
2307
|
}
|
|
2018
|
-
`,
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2308
|
+
`,
|
|
2309
|
+
styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"]
|
|
2310
|
+
}]
|
|
2311
|
+
}],
|
|
2312
|
+
propDecorators: {
|
|
2313
|
+
definition: [{
|
|
2314
|
+
type: i0.Input,
|
|
2315
|
+
args: [{
|
|
2316
|
+
isSignal: true,
|
|
2317
|
+
alias: "definition",
|
|
2318
|
+
required: false
|
|
2319
|
+
}]
|
|
2320
|
+
}],
|
|
2321
|
+
persistTheme: [{
|
|
2322
|
+
type: i0.Input,
|
|
2323
|
+
args: [{
|
|
2324
|
+
isSignal: true,
|
|
2325
|
+
alias: "persistTheme",
|
|
2326
|
+
required: false
|
|
2327
|
+
}]
|
|
2328
|
+
}]
|
|
2329
|
+
}
|
|
2330
|
+
});
|
|
2331
|
+
var AppPreviewComponent = class AppPreviewComponent {
|
|
2332
|
+
entityId = input.required(...ngDevMode ? [{ debugName: "entityId" }] : /* istanbul ignore next */ []);
|
|
2333
|
+
store = inject(AppDefinitionStore);
|
|
2334
|
+
app = computed(() => this.store.currentEntity(), ...ngDevMode ? [{ debugName: "app" }] : /* istanbul ignore next */ []);
|
|
2335
|
+
ngOnInit() {
|
|
2336
|
+
this.store.setCurrentEntity(this.entityId());
|
|
2337
|
+
}
|
|
2338
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2339
|
+
minVersion: "12.0.0",
|
|
2340
|
+
version: "22.1.7",
|
|
2341
|
+
ngImport: i0,
|
|
2342
|
+
type: AppPreviewComponent,
|
|
2343
|
+
deps: [],
|
|
2344
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2345
|
+
});
|
|
2346
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2347
|
+
minVersion: "17.1.0",
|
|
2348
|
+
version: "22.1.7",
|
|
2349
|
+
type: AppPreviewComponent,
|
|
2350
|
+
isStandalone: true,
|
|
2351
|
+
selector: "pp-app-preview-tab",
|
|
2352
|
+
inputs: { entityId: {
|
|
2353
|
+
classPropertyName: "entityId",
|
|
2354
|
+
publicName: "entityId",
|
|
2355
|
+
isSignal: true,
|
|
2356
|
+
isRequired: true,
|
|
2357
|
+
transformFunction: null
|
|
2358
|
+
} },
|
|
2359
|
+
ngImport: i0,
|
|
2360
|
+
template: `
|
|
2052
2361
|
<div class="pp-app-preview">
|
|
2053
|
-
<pp-app-shell [definition]="app()" />
|
|
2362
|
+
<pp-app-shell [definition]="app()" [persistTheme]="false" />
|
|
2054
2363
|
</div>
|
|
2055
|
-
`,
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2364
|
+
`,
|
|
2365
|
+
isInline: true,
|
|
2366
|
+
styles: [".pp-app-preview{background-color:var(--pp-surface-base, #ffffff);border-radius:6px;overflow:hidden}.pp-app-preview>pp-app-shell{min-height:65vh}\n"],
|
|
2367
|
+
dependencies: [{
|
|
2368
|
+
kind: "component",
|
|
2369
|
+
type: AppShellComponent,
|
|
2370
|
+
selector: "pp-app-shell",
|
|
2371
|
+
inputs: ["definition", "persistTheme"]
|
|
2372
|
+
}]
|
|
2373
|
+
});
|
|
2374
|
+
};
|
|
2375
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2376
|
+
minVersion: "12.0.0",
|
|
2377
|
+
version: "22.1.7",
|
|
2378
|
+
ngImport: i0,
|
|
2379
|
+
type: AppPreviewComponent,
|
|
2380
|
+
decorators: [{
|
|
2381
|
+
type: Component,
|
|
2382
|
+
args: [{
|
|
2383
|
+
selector: "pp-app-preview-tab",
|
|
2384
|
+
standalone: true,
|
|
2385
|
+
imports: [AppShellComponent],
|
|
2386
|
+
template: `
|
|
2060
2387
|
<div class="pp-app-preview">
|
|
2061
|
-
<pp-app-shell [definition]="app()" />
|
|
2388
|
+
<pp-app-shell [definition]="app()" [persistTheme]="false" />
|
|
2062
2389
|
</div>
|
|
2063
|
-
`,
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
* The authored order decides, falling back to the first route as built. The fallback is not decoration: an
|
|
2136
|
-
* app may declare no routes of its own and mount all of its screens from a module, in which case the
|
|
2137
|
-
* definition offers no path to land on but the built routes do.
|
|
2138
|
-
*/
|
|
2390
|
+
`,
|
|
2391
|
+
styles: [".pp-app-preview{background-color:var(--pp-surface-base, #ffffff);border-radius:6px;overflow:hidden}.pp-app-preview>pp-app-shell{min-height:65vh}\n"]
|
|
2392
|
+
}]
|
|
2393
|
+
}],
|
|
2394
|
+
propDecorators: { entityId: [{
|
|
2395
|
+
type: i0.Input,
|
|
2396
|
+
args: [{
|
|
2397
|
+
isSignal: true,
|
|
2398
|
+
alias: "entityId",
|
|
2399
|
+
required: true
|
|
2400
|
+
}]
|
|
2401
|
+
}] }
|
|
2402
|
+
});
|
|
2403
|
+
var AppShellRoutesFactory = class AppShellRoutesFactory {
|
|
2404
|
+
appStore = inject(AppDefinitionStore);
|
|
2405
|
+
appService = inject(AppDefinitionService);
|
|
2406
|
+
moduleStore = inject(ModuleDefinitionStore);
|
|
2407
|
+
moduleService = inject(ModuleDefinitionService);
|
|
2408
|
+
renderRoute = inject(AppRouteRenderer).render;
|
|
2409
|
+
async childrenOf(appId) {
|
|
2410
|
+
const definition = await this.definitionOf(appId);
|
|
2411
|
+
if (!definition) return [];
|
|
2412
|
+
const built = await buildAppRoutes({
|
|
2413
|
+
routes: definition.routes,
|
|
2414
|
+
modules: definition.modules,
|
|
2415
|
+
loadModule: this.loadModule
|
|
2416
|
+
}, this.renderRoute);
|
|
2417
|
+
return built.length ? [indexRoute(definition, built), ...built] : built;
|
|
2418
|
+
}
|
|
2419
|
+
async definitionOf(appId) {
|
|
2420
|
+
const known = this.appStore.loadById(appId);
|
|
2421
|
+
if (known) return known;
|
|
2422
|
+
return await this.fetch(() => firstValueFrom(this.appService.findById(appId)));
|
|
2423
|
+
}
|
|
2424
|
+
loadModule = async (moduleKey) => {
|
|
2425
|
+
const known = this.moduleStore.loadById(moduleKey);
|
|
2426
|
+
if (known) return known;
|
|
2427
|
+
return await this.fetch(() => firstValueFrom(this.moduleService.findById(moduleKey)));
|
|
2428
|
+
};
|
|
2429
|
+
async fetch(read) {
|
|
2430
|
+
try {
|
|
2431
|
+
return await read() || void 0;
|
|
2432
|
+
} catch {
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2437
|
+
minVersion: "12.0.0",
|
|
2438
|
+
version: "22.1.7",
|
|
2439
|
+
ngImport: i0,
|
|
2440
|
+
type: AppShellRoutesFactory,
|
|
2441
|
+
deps: [],
|
|
2442
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2443
|
+
});
|
|
2444
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2445
|
+
minVersion: "12.0.0",
|
|
2446
|
+
version: "22.1.7",
|
|
2447
|
+
ngImport: i0,
|
|
2448
|
+
type: AppShellRoutesFactory,
|
|
2449
|
+
providedIn: "root"
|
|
2450
|
+
});
|
|
2451
|
+
};
|
|
2452
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2453
|
+
minVersion: "12.0.0",
|
|
2454
|
+
version: "22.1.7",
|
|
2455
|
+
ngImport: i0,
|
|
2456
|
+
type: AppShellRoutesFactory,
|
|
2457
|
+
decorators: [{
|
|
2458
|
+
type: Injectable,
|
|
2459
|
+
args: [{ providedIn: "root" }]
|
|
2460
|
+
}]
|
|
2461
|
+
});
|
|
2139
2462
|
function indexRoute(definition, built) {
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2463
|
+
return {
|
|
2464
|
+
path: "",
|
|
2465
|
+
pathMatch: "full",
|
|
2466
|
+
redirectTo: definition.routes?.find((route) => route.path)?.path ?? built[0].path
|
|
2467
|
+
};
|
|
2143
2468
|
}
|
|
2144
|
-
/**
|
|
2145
|
-
* Registers an application's own routes as the children of the Preview tab's route, so that navigating
|
|
2146
|
-
* inside a previewed application is *real* navigation: real URLs, real back button, real outlet.
|
|
2147
|
-
*
|
|
2148
|
-
* Why a `canMatch` guard rather than `loadChildren`, which is the obvious hook for lazily-known children:
|
|
2149
|
-
* the router caches a `loadChildren` result on the `Route` object as `_loadedRoutes`, and one Route object
|
|
2150
|
-
* serves every `:entityId`. The first app previewed would therefore have its routes replayed for the
|
|
2151
|
-
* second. `children`, by contrast, is read fresh on every recognition and never cached — and `canMatch`
|
|
2152
|
-
* runs, and is awaited, *before* the router reads it. So this is the one hook that can answer "children of
|
|
2153
|
-
* *this* app" and still work on a deep link.
|
|
2154
|
-
*
|
|
2155
|
-
* Always returns `true`. It is not deciding whether the tab may be entered — it is filling in the tab's
|
|
2156
|
-
* children on the way past.
|
|
2157
|
-
*/
|
|
2158
2469
|
const appShellRoutesGuard = (route, _segments, snapshot) => {
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
route.children = children;
|
|
2166
|
-
return true;
|
|
2167
|
-
});
|
|
2470
|
+
const appId = snapshot.paramMap.get(BaseUrlSegments.EntityID);
|
|
2471
|
+
if (!appId) return true;
|
|
2472
|
+
return inject(AppShellRoutesFactory).childrenOf(appId).then((children) => {
|
|
2473
|
+
route.children = children;
|
|
2474
|
+
return true;
|
|
2475
|
+
});
|
|
2168
2476
|
};
|
|
2169
|
-
|
|
2170
|
-
/**
|
|
2171
|
-
* The Preview tab, declared once and consumed twice: `BASE_APP_ROUTES` mounts it as
|
|
2172
|
-
* `app-definition/<id>/preview`, and `AppDefinitionContainerComponent` puts it on the descriptor so the tab bar
|
|
2173
|
-
* renders the link. One constant rather than two literals because the segment is what ties the link to the
|
|
2174
|
-
* route — a mismatch would render a tab that navigates to a URL nothing matches.
|
|
2175
|
-
*
|
|
2176
|
-
* The tab is a *container*: `children` starts empty and {@link appShellRoutesGuard} fills it with the
|
|
2177
|
-
* previewed application's own routes on every navigation, so the shell's `<router-outlet>` renders real
|
|
2178
|
-
* screens at real URLs — `app-definition/demo/preview/orders`. The empty array is load-bearing; a route with
|
|
2179
|
-
* no `children` at all takes the `loadChildren` path instead, which is cached per Route object and so cannot
|
|
2180
|
-
* vary by `:entityId`.
|
|
2181
|
-
*/
|
|
2182
2477
|
const APP_PREVIEW_TAB = {
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2478
|
+
segment: "preview",
|
|
2479
|
+
i18nKey: APP_PREVIEW_I18N_KEY,
|
|
2480
|
+
component: AppPreviewComponent,
|
|
2481
|
+
testIdSuffix: "show-preview",
|
|
2482
|
+
children: [],
|
|
2483
|
+
canMatch: [appShellRoutesGuard]
|
|
2189
2484
|
};
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2485
|
+
var AppDefinitionContainerComponent = class AppDefinitionContainerComponent {
|
|
2486
|
+
containerComponentRef;
|
|
2487
|
+
baseEntityHost;
|
|
2488
|
+
publishActionsTpl = viewChild("publishActionsTpl", ...ngDevMode ? [{ debugName: "publishActionsTpl" }] : /* istanbul ignore next */ []);
|
|
2489
|
+
store = inject(AppDefinitionStore);
|
|
2490
|
+
entityDescriptor;
|
|
2491
|
+
publishButtonKey = PUBLISH_BUTTON_I18N_KEY;
|
|
2492
|
+
publishTooltipKey = PUBLISH_TOOLTIP_I18N_KEY;
|
|
2493
|
+
canPublish = computed(() => !this.store.isLoading() && !!this.store.currentEntity()?.id, ...ngDevMode ? [{ debugName: "canPublish" }] : /* istanbul ignore next */ []);
|
|
2494
|
+
constructor() {
|
|
2495
|
+
this.entityDescriptor = createAppDefinitionDescriptor();
|
|
2496
|
+
this.entityDescriptor.store = this.store;
|
|
2497
|
+
this.entityDescriptor.extraFormActionsTemplate = () => this.publishActionsTpl();
|
|
2498
|
+
this.entityDescriptor.extraTabs = [APP_PREVIEW_TAB];
|
|
2499
|
+
}
|
|
2500
|
+
ngOnDestroy() {
|
|
2501
|
+
if (this.containerComponentRef) this.containerComponentRef.destroy();
|
|
2502
|
+
}
|
|
2503
|
+
async onPublish() {
|
|
2504
|
+
const id = this.store.currentEntity()?.id;
|
|
2505
|
+
if (!id) return;
|
|
2506
|
+
await this.store.publish(id);
|
|
2507
|
+
}
|
|
2508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2509
|
+
minVersion: "12.0.0",
|
|
2510
|
+
version: "22.1.7",
|
|
2511
|
+
ngImport: i0,
|
|
2512
|
+
type: AppDefinitionContainerComponent,
|
|
2513
|
+
deps: [],
|
|
2514
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2515
|
+
});
|
|
2516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2517
|
+
minVersion: "17.2.0",
|
|
2518
|
+
version: "22.1.7",
|
|
2519
|
+
type: AppDefinitionContainerComponent,
|
|
2520
|
+
isStandalone: true,
|
|
2521
|
+
selector: "pp-app-definition-container",
|
|
2522
|
+
viewQueries: [{
|
|
2523
|
+
propertyName: "publishActionsTpl",
|
|
2524
|
+
first: true,
|
|
2525
|
+
predicate: ["publishActionsTpl"],
|
|
2526
|
+
descendants: true,
|
|
2527
|
+
isSignal: true
|
|
2528
|
+
}, {
|
|
2529
|
+
propertyName: "baseEntityHost",
|
|
2530
|
+
first: true,
|
|
2531
|
+
predicate: BaseFormHostDirective,
|
|
2532
|
+
descendants: true,
|
|
2533
|
+
read: BaseFormHostDirective,
|
|
2534
|
+
static: true
|
|
2535
|
+
}],
|
|
2536
|
+
ngImport: i0,
|
|
2537
|
+
template: `
|
|
2222
2538
|
<base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>
|
|
2223
2539
|
<ng-template #publishActionsTpl>
|
|
2224
2540
|
<button id="publish" type="button" mat-raised-button color="accent" [disabled]="!canPublish()" [matTooltip]="publishTooltipKey | transloco" (click)="onPublish()">
|
|
2225
2541
|
{{ publishButtonKey | transloco }}
|
|
2226
2542
|
</button>
|
|
2227
2543
|
</ng-template>
|
|
2228
|
-
`,
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2544
|
+
`,
|
|
2545
|
+
isInline: true,
|
|
2546
|
+
dependencies: [
|
|
2547
|
+
{
|
|
2548
|
+
kind: "component",
|
|
2549
|
+
type: BaseEntityContainerComponent,
|
|
2550
|
+
selector: "base-entity-container",
|
|
2551
|
+
inputs: ["entityDescriptor", "facade"]
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
kind: "component",
|
|
2555
|
+
type: MatButton,
|
|
2556
|
+
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] ",
|
|
2557
|
+
inputs: ["matButton"],
|
|
2558
|
+
exportAs: ["matButton", "matAnchor"]
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
kind: "directive",
|
|
2562
|
+
type: MatTooltip,
|
|
2563
|
+
selector: "[matTooltip]",
|
|
2564
|
+
inputs: [
|
|
2565
|
+
"matTooltipPosition",
|
|
2566
|
+
"matTooltipPositionAtOrigin",
|
|
2567
|
+
"matTooltipDisabled",
|
|
2568
|
+
"matTooltipShowDelay",
|
|
2569
|
+
"matTooltipHideDelay",
|
|
2570
|
+
"matTooltipTouchGestures",
|
|
2571
|
+
"matTooltip",
|
|
2572
|
+
"matTooltipClass"
|
|
2573
|
+
],
|
|
2574
|
+
exportAs: ["matTooltip"]
|
|
2575
|
+
},
|
|
2576
|
+
{
|
|
2577
|
+
kind: "pipe",
|
|
2578
|
+
type: TranslocoPipe,
|
|
2579
|
+
name: "transloco"
|
|
2580
|
+
}
|
|
2581
|
+
]
|
|
2582
|
+
});
|
|
2583
|
+
};
|
|
2584
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2585
|
+
minVersion: "12.0.0",
|
|
2586
|
+
version: "22.1.7",
|
|
2587
|
+
ngImport: i0,
|
|
2588
|
+
type: AppDefinitionContainerComponent,
|
|
2589
|
+
decorators: [{
|
|
2590
|
+
type: Component,
|
|
2591
|
+
args: [{
|
|
2592
|
+
selector: "pp-app-definition-container",
|
|
2593
|
+
standalone: true,
|
|
2594
|
+
imports: [
|
|
2595
|
+
BaseEntityContainerComponent,
|
|
2596
|
+
MatButton,
|
|
2597
|
+
MatTooltip,
|
|
2598
|
+
TranslocoPipe
|
|
2599
|
+
],
|
|
2600
|
+
template: `
|
|
2237
2601
|
<base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>
|
|
2238
2602
|
<ng-template #publishActionsTpl>
|
|
2239
2603
|
<button id="publish" type="button" mat-raised-button color="accent" [disabled]="!canPublish()" [matTooltip]="publishTooltipKey | transloco" (click)="onPublish()">
|
|
2240
2604
|
{{ publishButtonKey | transloco }}
|
|
2241
2605
|
</button>
|
|
2242
2606
|
</ng-template>
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
* control throws on first render rather than showing a list whose rows go nowhere on save — the
|
|
2293
|
-
* registry is how it reaches the child's store and descriptor. Spread rather than provided separately,
|
|
2294
|
-
* because the token holds one value: a second `provide: BASE_ENTITY_FACADE_REGISTRY` would replace the
|
|
2295
|
-
* application's own entities instead of adding to them.
|
|
2296
|
-
*/
|
|
2297
|
-
const BASE_APP_ENTITY_FACADES = {
|
|
2298
|
-
[APP_DEFINITION_ENTITY_NAME]: AppDefinitionFacade,
|
|
2299
|
-
[MODULE_DEFINITION_ENTITY_NAME]: ModuleDefinitionFacade,
|
|
2300
|
-
[APP_REGION_ENTITY_NAME]: AppRegionFacade,
|
|
2301
|
-
[APP_ROUTE_ENTITY_NAME]: AppRouteFacade,
|
|
2302
|
-
[APP_MODULE_MOUNT_ENTITY_NAME]: AppModuleMountFacade,
|
|
2303
|
-
[APP_NAV_ITEM_ENTITY_NAME]: AppNavItemFacade,
|
|
2304
|
-
[APP_WIDGET_ENTITY_NAME]: AppWidgetFacade,
|
|
2607
|
+
`
|
|
2608
|
+
}]
|
|
2609
|
+
}],
|
|
2610
|
+
ctorParameters: () => [],
|
|
2611
|
+
propDecorators: {
|
|
2612
|
+
baseEntityHost: [{
|
|
2613
|
+
type: ViewChild,
|
|
2614
|
+
args: [BaseFormHostDirective, {
|
|
2615
|
+
static: true,
|
|
2616
|
+
read: BaseFormHostDirective
|
|
2617
|
+
}]
|
|
2618
|
+
}],
|
|
2619
|
+
publishActionsTpl: [{
|
|
2620
|
+
type: i0.ViewChild,
|
|
2621
|
+
args: ["publishActionsTpl", { isSignal: true }]
|
|
2622
|
+
}]
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2625
|
+
var ModuleDefinitionContainerComponent = class ModuleDefinitionContainerComponent {
|
|
2626
|
+
store = inject(ModuleDefinitionStore);
|
|
2627
|
+
entityDescriptor;
|
|
2628
|
+
constructor() {
|
|
2629
|
+
this.entityDescriptor = createModuleDefinitionDescriptor();
|
|
2630
|
+
this.entityDescriptor.store = this.store;
|
|
2631
|
+
}
|
|
2632
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2633
|
+
minVersion: "12.0.0",
|
|
2634
|
+
version: "22.1.7",
|
|
2635
|
+
ngImport: i0,
|
|
2636
|
+
type: ModuleDefinitionContainerComponent,
|
|
2637
|
+
deps: [],
|
|
2638
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2639
|
+
});
|
|
2640
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2641
|
+
minVersion: "14.0.0",
|
|
2642
|
+
version: "22.1.7",
|
|
2643
|
+
type: ModuleDefinitionContainerComponent,
|
|
2644
|
+
isStandalone: true,
|
|
2645
|
+
selector: "pp-module-definition-container",
|
|
2646
|
+
ngImport: i0,
|
|
2647
|
+
template: `<base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>`,
|
|
2648
|
+
isInline: true,
|
|
2649
|
+
dependencies: [{
|
|
2650
|
+
kind: "component",
|
|
2651
|
+
type: BaseEntityContainerComponent,
|
|
2652
|
+
selector: "base-entity-container",
|
|
2653
|
+
inputs: ["entityDescriptor", "facade"]
|
|
2654
|
+
}]
|
|
2655
|
+
});
|
|
2305
2656
|
};
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
children: baseEntityRoutes([routeRoute()]),
|
|
2331
|
-
},
|
|
2657
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2658
|
+
minVersion: "12.0.0",
|
|
2659
|
+
version: "22.1.7",
|
|
2660
|
+
ngImport: i0,
|
|
2661
|
+
type: ModuleDefinitionContainerComponent,
|
|
2662
|
+
decorators: [{
|
|
2663
|
+
type: Component,
|
|
2664
|
+
args: [{
|
|
2665
|
+
selector: "pp-module-definition-container",
|
|
2666
|
+
standalone: true,
|
|
2667
|
+
imports: [BaseEntityContainerComponent],
|
|
2668
|
+
template: `<base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>`
|
|
2669
|
+
}]
|
|
2670
|
+
}],
|
|
2671
|
+
ctorParameters: () => []
|
|
2672
|
+
});
|
|
2673
|
+
const BASE_APP_FACADE_PROVIDERS = [
|
|
2674
|
+
AppDefinitionFacade,
|
|
2675
|
+
ModuleDefinitionFacade,
|
|
2676
|
+
AppRegionFacade,
|
|
2677
|
+
AppRouteFacade,
|
|
2678
|
+
AppModuleMountFacade,
|
|
2679
|
+
AppNavItemFacade,
|
|
2680
|
+
AppWidgetFacade
|
|
2332
2681
|
];
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2682
|
+
const BASE_APP_ENTITY_FACADES = {
|
|
2683
|
+
[APP_DEFINITION_ENTITY_NAME]: AppDefinitionFacade,
|
|
2684
|
+
[MODULE_DEFINITION_ENTITY_NAME]: ModuleDefinitionFacade,
|
|
2685
|
+
[APP_REGION_ENTITY_NAME]: AppRegionFacade,
|
|
2686
|
+
[APP_ROUTE_ENTITY_NAME]: AppRouteFacade,
|
|
2687
|
+
[APP_MODULE_MOUNT_ENTITY_NAME]: AppModuleMountFacade,
|
|
2688
|
+
[APP_NAV_ITEM_ENTITY_NAME]: AppNavItemFacade,
|
|
2689
|
+
[APP_WIDGET_ENTITY_NAME]: AppWidgetFacade
|
|
2690
|
+
};
|
|
2691
|
+
const BASE_APP_ROUTES = [{
|
|
2692
|
+
path: "app-definition",
|
|
2693
|
+
title: "ProcessPuzzle Design - Applications",
|
|
2694
|
+
data: {
|
|
2695
|
+
icon: "web",
|
|
2696
|
+
menuTitle: "design.applications",
|
|
2697
|
+
entityName: APP_DEFINITION_ENTITY_NAME
|
|
2698
|
+
},
|
|
2699
|
+
component: AppDefinitionContainerComponent,
|
|
2700
|
+
providers: [authoringScopes()],
|
|
2701
|
+
children: baseEntityRoutes(embeddedDefinitionRoutes(), [APP_PREVIEW_TAB])
|
|
2702
|
+
}, {
|
|
2703
|
+
path: "module-definition",
|
|
2704
|
+
title: "ProcessPuzzle Design - Modules",
|
|
2705
|
+
data: {
|
|
2706
|
+
icon: "extension",
|
|
2707
|
+
menuTitle: "design.modules",
|
|
2708
|
+
entityName: MODULE_DEFINITION_ENTITY_NAME
|
|
2709
|
+
},
|
|
2710
|
+
component: ModuleDefinitionContainerComponent,
|
|
2711
|
+
providers: [authoringScopes()],
|
|
2712
|
+
children: baseEntityRoutes([routeRoute()])
|
|
2713
|
+
}];
|
|
2346
2714
|
function authoringScopes() {
|
|
2347
|
-
|
|
2715
|
+
return provideTranslocoScope({
|
|
2716
|
+
scope: BASE_ENTITY_TRANSLOCO_SCOPE,
|
|
2717
|
+
alias: BASE_ENTITY_TRANSLOCO_SCOPE
|
|
2718
|
+
}, {
|
|
2719
|
+
scope: BASE_APP_TRANSLOCO_SCOPE,
|
|
2720
|
+
alias: BASE_APP_TRANSLOCO_SCOPE
|
|
2721
|
+
});
|
|
2348
2722
|
}
|
|
2349
|
-
/**
|
|
2350
|
-
* The definition graph as route branches: a region, a route and a module mount hang below the
|
|
2351
|
-
* definition's details route, a nav item and a widget below the region's, a widget below the route's,
|
|
2352
|
-
* and a nav item below itself.
|
|
2353
|
-
*
|
|
2354
|
-
* The nesting mirrors the containment of `base-app-api.yaml` exactly, and it has to: an embedded row has
|
|
2355
|
-
* no id of its own to be looked up by, so the URL — `app-definition/claims-app/details/app-region/sidenav/
|
|
2356
|
-
* details/app-nav-item/nav-claims/details` — is what addresses it, and each segment resolves against the
|
|
2357
|
-
* rows of the level above it.
|
|
2358
|
-
*
|
|
2359
|
-
* These are the *authoring* routes and have nothing to do with the routes an `AppDefinition` declares:
|
|
2360
|
-
* `App Route` rows are data here, and it is the run-time shell that turns them into `Routes` of their
|
|
2361
|
-
* own. A module mount is a leaf — the module it names is a separate aggregate with its own endpoints,
|
|
2362
|
-
* so its routes are authored there rather than through this branch.
|
|
2363
|
-
*/
|
|
2364
2723
|
function embeddedDefinitionRoutes() {
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2724
|
+
return [
|
|
2725
|
+
{
|
|
2726
|
+
entityName: APP_REGION_ENTITY_NAME,
|
|
2727
|
+
facade: AppRegionFacade,
|
|
2728
|
+
children: () => [navItemRoute(), widgetRoute()]
|
|
2729
|
+
},
|
|
2730
|
+
routeRoute(),
|
|
2731
|
+
{
|
|
2732
|
+
entityName: APP_MODULE_MOUNT_ENTITY_NAME,
|
|
2733
|
+
facade: AppModuleMountFacade
|
|
2734
|
+
}
|
|
2735
|
+
];
|
|
2370
2736
|
}
|
|
2371
|
-
/**
|
|
2372
|
-
* The `App Route` branch, shared by both aggregates that own routes: an app's `routes` and a module's are
|
|
2373
|
-
* the same rows edited by the same descriptor, so the branch below them has to be the same too. Only the
|
|
2374
|
-
* URL prefix differs — `app-definition/demo/details/app-route/...` against
|
|
2375
|
-
* `module-definition/claims/details/app-route/...`.
|
|
2376
|
-
*/
|
|
2377
2737
|
function routeRoute() {
|
|
2378
|
-
|
|
2738
|
+
return {
|
|
2739
|
+
entityName: APP_ROUTE_ENTITY_NAME,
|
|
2740
|
+
facade: AppRouteFacade,
|
|
2741
|
+
children: () => [widgetRoute()]
|
|
2742
|
+
};
|
|
2379
2743
|
}
|
|
2380
|
-
/** A nav item nests in itself — a group node's children are nav items. Hence the thunk: the structure is
|
|
2381
|
-
* infinite, and `loadChildren` expands one level per navigation. */
|
|
2382
2744
|
function navItemRoute() {
|
|
2383
|
-
|
|
2745
|
+
return {
|
|
2746
|
+
entityName: APP_NAV_ITEM_ENTITY_NAME,
|
|
2747
|
+
facade: AppNavItemFacade,
|
|
2748
|
+
children: () => [navItemRoute()]
|
|
2749
|
+
};
|
|
2384
2750
|
}
|
|
2385
|
-
/**
|
|
2386
|
-
* A widget, unlike a nav item, is a leaf branch: widgets do not nest, so there is no deeper level to
|
|
2387
|
-
* expand. A container widget places its siblings by id through `props.childIds`, and those siblings are
|
|
2388
|
-
* rows of this same list — reachable at this level, not below it.
|
|
2389
|
-
*/
|
|
2390
2751
|
function widgetRoute() {
|
|
2391
|
-
|
|
2752
|
+
return {
|
|
2753
|
+
entityName: APP_WIDGET_ENTITY_NAME,
|
|
2754
|
+
facade: AppWidgetFacade
|
|
2755
|
+
};
|
|
2392
2756
|
}
|
|
2757
|
+
export { APP_DEFINITION_ENTITY_NAME, APP_DEFINITION_I18N_SCOPE, APP_MODULE_MOUNT_ENTITY_NAME, APP_MODULE_MOUNT_I18N_SCOPE, APP_MODULE_MOUNT_ID_FIELD, APP_NAV_ITEM_ENTITY_NAME, APP_NAV_ITEM_I18N_SCOPE, APP_PREVIEW_I18N_KEY, APP_PREVIEW_TAB, APP_REGION_ENTITY_NAME, APP_REGION_I18N_SCOPE, APP_REGION_ID_FIELD, APP_ROUTE_ENTITY_NAME, APP_ROUTE_I18N_SCOPE, APP_ROUTE_ID_FIELD, APP_WIDGET_ENTITY_NAME, APP_WIDGET_I18N_SCOPE, AppDefinition, AppDefinitionContainerComponent, AppDefinitionFacade, AppDefinitionMapper, AppDefinitionService, AppDefinitionStatus, AppDefinitionStore, AppModuleMountFacade, AppNavItemFacade, AppPreviewComponent, AppRegionFacade, AppRegionRenderer, AppRouteFacade, AppRouteRenderer, AppShellComponent, AppShellRoutesFactory, AppWidgetFacade, BASE_APP_ENTITY_FACADES, BASE_APP_FACADE_PROVIDERS, BASE_APP_ROUTES, BASE_APP_TRANSLATION_SOURCE, BASE_APP_TRANSLOCO_SCOPE, COLOR_SCHEMES, ENTITY_MODES, LAYOUT_PRESETS, MATERIAL_THEMES, MODULE_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_I18N_SCOPE, ModuleDefinition, ModuleDefinitionContainerComponent, ModuleDefinitionFacade, ModuleDefinitionMapper, ModuleDefinitionService, ModuleDefinitionStore, ModuleMount, NavItem, REGION_TYPES, ROUTE_TARGET_KINDS, RegionDefinition, RegionFooterComponent, RegionHeaderComponent, RegionNavComponent, RouteDefinition, RouteUnsupportedComponent, RouteWidgetsComponent, SIDENAV_MODES, WIDGET_PLACEMENTS, WidgetInstance, WidgetListComponent, appShellRoutesGuard, buildAppRoutes, createAppDefinitionDescriptor, createModuleDefinitionDescriptor, createModuleMountDescriptor, createNavItemDescriptor, createRegionDefinitionDescriptor, createRouteDefinitionDescriptor, createWidgetInstanceDescriptor, layoutOf, moduleTranslocoScope, themeVarsOf };
|
|
2393
2758
|
|
|
2394
|
-
|
|
2395
|
-
* Public API Surface of @processpuzzle/base-app
|
|
2396
|
-
*/
|
|
2397
|
-
|
|
2398
|
-
/**
|
|
2399
|
-
* Generated bundle index. Do not edit.
|
|
2400
|
-
*/
|
|
2401
|
-
|
|
2402
|
-
export { APP_DEFINITION_ENTITY_NAME, APP_DEFINITION_I18N_SCOPE, APP_MODULE_MOUNT_ENTITY_NAME, APP_MODULE_MOUNT_I18N_SCOPE, APP_MODULE_MOUNT_ID_FIELD, APP_NAV_ITEM_ENTITY_NAME, APP_NAV_ITEM_I18N_SCOPE, APP_PREVIEW_I18N_KEY, APP_PREVIEW_TAB, APP_REGION_ENTITY_NAME, APP_REGION_I18N_SCOPE, APP_REGION_ID_FIELD, APP_ROUTE_ENTITY_NAME, APP_ROUTE_I18N_SCOPE, APP_ROUTE_ID_FIELD, APP_WIDGET_ENTITY_NAME, APP_WIDGET_I18N_SCOPE, AppDefinition, AppDefinitionContainerComponent, AppDefinitionFacade, AppDefinitionMapper, AppDefinitionService, AppDefinitionStatus, AppDefinitionStore, AppModuleMountFacade, AppNavItemFacade, AppPreviewComponent, AppRegionFacade, AppRegionRenderer, AppRouteFacade, AppRouteRenderer, AppShellComponent, AppShellRoutesFactory, AppWidgetFacade, BASE_APP_ENTITY_FACADES, BASE_APP_FACADE_PROVIDERS, BASE_APP_ROUTES, BASE_APP_TRANSLATION_SOURCE, BASE_APP_TRANSLOCO_SCOPE, COLOR_SCHEMES, ENTITY_MODES, LAYOUT_PRESETS, MATERIAL_THEMES, MODULE_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_I18N_SCOPE, ModuleDefinition, ModuleDefinitionContainerComponent, ModuleDefinitionFacade, ModuleDefinitionMapper, ModuleDefinitionService, ModuleDefinitionStore, ModuleMount, NavItem, REGION_TYPES, ROUTE_TARGET_KINDS, RegionDefinition, RegionFooterComponent, RegionHeaderComponent, RegionNavComponent, RouteDefinition, RouteUnsupportedComponent, RouteWidgetsComponent, SIDENAV_MODES, WidgetListComponent, appShellRoutesGuard, buildAppRoutes, createAppDefinitionDescriptor, createModuleDefinitionDescriptor, createModuleMountDescriptor, createNavItemDescriptor, createRegionDefinitionDescriptor, createRouteDefinitionDescriptor, createWidgetInstanceDescriptor, layoutOf, moduleTranslocoScope, themeVarsOf };
|
|
2403
|
-
//# sourceMappingURL=processpuzzle-base-app.mjs.map
|
|
2759
|
+
//# sourceMappingURL=processpuzzle-base-app.mjs.map
|