@cratis/stage.runtime 4.202.1 → 4.203.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/dist/src/App.d.ts +11 -1
- package/dist/src/StageChrome.d.ts +5 -0
- package/dist/src/StageCommandForm.d.ts +2 -0
- package/dist/src/app.css +1 -1
- package/dist/src/blueprint.d.ts +2 -0
- package/dist/src/index.js +808 -735
- package/dist/src/stageNavigation.d.ts +6 -0
- package/package.json +2 -1
package/dist/src/index.js
CHANGED
|
@@ -3,25 +3,30 @@ import { t as e } from "../stageDarkSelector-DjqhPYDU.js";
|
|
|
3
3
|
import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
4
4
|
import { ColorScheme as u, DestinationKind as d, FormGenerationMode as f, FormWidthUnit as p, InteractionTriggerKind as m, LogoKind as h, PackageKind as g, componentIconLibrary as _ } from "@cratis/scene.model";
|
|
5
5
|
import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as ee, runBindings as te, validateBindingExpression as ne } from "@cratis/scene.engine";
|
|
6
|
-
import { CoreSliceDialog as
|
|
7
|
-
import { ApplicationHost as
|
|
6
|
+
import { CoreSliceDialog as T, CoreToolbarItem as E, IconAdapterProvider as re, InteractionScope as D, SceneElementView as ie, SceneNavigationContextInternal as O, SliceCommandFieldsProvider as ae, SliceDialogView as oe, SliceInvokerProvider as se, attachmentFor as ce, coreComponents as le, createBrowserDispatcher as k, createBrowserSceneHistory as ue, createHashSceneHistory as de, createIconAdapterRegistry as A, sliceDialogParameters as fe, useInteractionScope as pe, useOptionalSceneNavigation as me, useSceneNavigation as he, useSceneOutlets as ge, useSceneTheme as _e } from "@cratis/scene.react";
|
|
7
|
+
import { ApplicationHost as ve, ColorScheme as j, ComponentName as M, LayoutThemeProvider as ye, SlotName as N, blueprintPackageCatalog as be, composeApplicationScreen as xe, defaultBlueprintComponents as Se, defaultBlueprintName as Ce, defaultBlueprintThemes as P, effectiveShellOf as we, externalComponent as F, galleryScreenTemplates as Te, layoutModes as Ee, menuThemes as De, navigationElement as Oe, previewComponents as ke, previewProfile as Ae, useLayoutConfig as je } from "@cratis/scene.blueprint.default";
|
|
8
8
|
import "@cratis/components/tokens";
|
|
9
|
+
import "@cratis/components/CommandForm/styles";
|
|
10
|
+
import "@cratis/components/Dropdown/styles";
|
|
11
|
+
import "@cratis/components/Common/styles";
|
|
12
|
+
import "@cratis/components/Display/styles";
|
|
9
13
|
import "@cratis/scene.blueprint.default/styles.css";
|
|
10
|
-
import { ArcContext as
|
|
11
|
-
import { ObservableQueryFor as
|
|
12
|
-
import { resolveCommand as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { Button as
|
|
15
|
-
import { Dialog as
|
|
16
|
-
import { Message as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
14
|
+
import { ArcContext as Me } from "@cratis/arc.react";
|
|
15
|
+
import { ObservableQueryFor as Ne, Paging as Pe, QueryFor as Fe } from "@cratis/arc/queries";
|
|
16
|
+
import { resolveCommand as Ie, resolveExactQuery as Le } from "@cratis/scene.components";
|
|
17
|
+
import { Fragment as Re, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
18
|
+
import { Button as R } from "@cratis/components/Common";
|
|
19
|
+
import { Dialog as ze } from "@cratis/components/Dialogs";
|
|
20
|
+
import { Message as Be } from "@cratis/components/Display";
|
|
21
|
+
import { createPortal as Ve } from "react-dom";
|
|
22
|
+
import { DateOnly as He, Guid as Ue } from "@cratis/fundamentals";
|
|
23
|
+
import { Command as We } from "@cratis/arc/commands";
|
|
24
|
+
import { CommandForm as Ge, asCommandFormField as Ke, withCommandFormFieldBinding as qe } from "@cratis/arc.react/commands";
|
|
25
|
+
import { CalendarField as Je, CheckboxField as Ye, DropdownField as Xe, InputTextField as Ze, NumberField as Qe } from "@cratis/components/CommandForm";
|
|
26
|
+
import { cratisComponents as $e, cratisComponentsPackageManifest as et } from "@cratis/scene.components/runtime";
|
|
27
|
+
import { dynamicIconImports as tt } from "lucide-react/dynamic";
|
|
23
28
|
//#region src/stageSource.ts
|
|
24
|
-
function
|
|
29
|
+
function nt(e) {
|
|
25
30
|
return {
|
|
26
31
|
scene: async () => e.scene,
|
|
27
32
|
routes: async () => e.routes,
|
|
@@ -29,23 +34,23 @@ function rt(e) {
|
|
|
29
34
|
strings: async (t) => e.strings[t] ?? {}
|
|
30
35
|
};
|
|
31
36
|
}
|
|
32
|
-
var
|
|
37
|
+
var rt = {
|
|
33
38
|
scene: "stage/scene",
|
|
34
39
|
routes: "stage/routes",
|
|
35
40
|
locales: "stage/locales",
|
|
36
41
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
37
|
-
},
|
|
38
|
-
function
|
|
39
|
-
return n(
|
|
42
|
+
}, it = t(void 0);
|
|
43
|
+
function at({ source: e, children: t }) {
|
|
44
|
+
return n(it.Provider, { value: e }, t);
|
|
40
45
|
}
|
|
41
|
-
function
|
|
42
|
-
let e = i(
|
|
46
|
+
function ot() {
|
|
47
|
+
let e = i(it);
|
|
43
48
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
44
49
|
return e;
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
let e =
|
|
51
|
+
rt.routes;
|
|
52
|
+
function st() {
|
|
53
|
+
let e = ot(), [t, n] = l({
|
|
49
54
|
routes: void 0,
|
|
50
55
|
ready: !1
|
|
51
56
|
});
|
|
@@ -66,7 +71,7 @@ function ct() {
|
|
|
66
71
|
}
|
|
67
72
|
//#endregion
|
|
68
73
|
//#region src/applyQueryChangeSet.ts
|
|
69
|
-
function
|
|
74
|
+
function ct(e) {
|
|
70
75
|
return typeof e == "object" && e && "id" in e ? e.id : void 0;
|
|
71
76
|
}
|
|
72
77
|
function lt(e) {
|
|
@@ -78,7 +83,7 @@ function ut(e, t) {
|
|
|
78
83
|
return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : lt(e) === lt(t);
|
|
79
84
|
}
|
|
80
85
|
function dt(e, t) {
|
|
81
|
-
if (t.removed.length > 0 ?
|
|
86
|
+
if (t.removed.length > 0 ? ct(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => ut(ct(e), ct(t)))).map((e) => t.replaced.find((t) => ut(ct(t), ct(e))) ?? e), ...t.added];
|
|
82
87
|
let n = new Set(t.removed.map((e) => JSON.stringify(e)));
|
|
83
88
|
return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
|
|
84
89
|
}
|
|
@@ -103,14 +108,14 @@ function ht(e) {
|
|
|
103
108
|
mt = e;
|
|
104
109
|
}
|
|
105
110
|
function gt(e, t) {
|
|
106
|
-
let n =
|
|
107
|
-
return n === "ambiguous" && t && (n =
|
|
111
|
+
let n = Le(e);
|
|
112
|
+
return n === "ambiguous" && t && (n = Le(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), _t(n) ? n : t ? mt?.(t) : void 0;
|
|
108
113
|
}
|
|
109
114
|
function _t(e) {
|
|
110
|
-
return typeof e == "function" && (e.prototype instanceof
|
|
115
|
+
return typeof e == "function" && (e.prototype instanceof Fe || e.prototype instanceof Ne);
|
|
111
116
|
}
|
|
112
117
|
function vt(e, t) {
|
|
113
|
-
e.setMicroservice(t.microservice), e.setApiBasePath(pt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging =
|
|
118
|
+
e.setMicroservice(t.microservice), e.setApiBasePath(pt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Pe.noPaging;
|
|
114
119
|
}
|
|
115
120
|
function yt(e, t, n) {
|
|
116
121
|
let r = new e();
|
|
@@ -118,19 +123,19 @@ function yt(e, t, n) {
|
|
|
118
123
|
}
|
|
119
124
|
function bt(e, t, n, r) {
|
|
120
125
|
let i = new e();
|
|
121
|
-
if (i instanceof
|
|
126
|
+
if (i instanceof Ne) return vt(i, n), i.subscribe(r, t);
|
|
122
127
|
}
|
|
123
128
|
function xt(e) {
|
|
124
|
-
if (
|
|
129
|
+
if (z(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
125
130
|
}
|
|
126
131
|
var St = "STAGE-SCENE-ACTION-001", Ct = "item.";
|
|
127
|
-
function
|
|
132
|
+
function z(e) {
|
|
128
133
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
129
134
|
}
|
|
130
135
|
function wt(e, t) {
|
|
131
136
|
let n = e;
|
|
132
137
|
for (let e of t.split(".").filter(Boolean)) {
|
|
133
|
-
if (!
|
|
138
|
+
if (!z(n)) return;
|
|
134
139
|
n = n[e];
|
|
135
140
|
}
|
|
136
141
|
return n;
|
|
@@ -164,7 +169,7 @@ function Dt(e, t, n, r) {
|
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
function Ot(e, t) {
|
|
167
|
-
if (
|
|
172
|
+
if (z(e)) {
|
|
168
173
|
if (e.kind === "comparison") {
|
|
169
174
|
let n = xt(e.left);
|
|
170
175
|
if (typeof n != "string" || !n.startsWith(Ct) || typeof e.operator != "string" || !Tt(e.right)) return;
|
|
@@ -184,7 +189,7 @@ function At(e, t) {
|
|
|
184
189
|
if (kt(e)) return e.findIndex((e) => Ot(e, t) === !0);
|
|
185
190
|
}
|
|
186
191
|
function jt(e, t) {
|
|
187
|
-
if (!
|
|
192
|
+
if (!z(e) || !Array.isArray(e.alternatives) || !z(t)) return;
|
|
188
193
|
let n = At(e.alternatives, t);
|
|
189
194
|
if (n !== void 0) {
|
|
190
195
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
@@ -192,7 +197,7 @@ function jt(e, t) {
|
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
function Mt(e, t) {
|
|
195
|
-
if (e.startsWith(Ct) &&
|
|
200
|
+
if (e.startsWith(Ct) && z(t)) return wt(t, e.slice(5));
|
|
196
201
|
}
|
|
197
202
|
//#endregion
|
|
198
203
|
//#region src/stageSession.ts
|
|
@@ -258,7 +263,7 @@ var Lt = "cratis.stage.data-changed", Rt = t({
|
|
|
258
263
|
3e3
|
|
259
264
|
], Bt = {};
|
|
260
265
|
function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, locales: o, screen: u, children: d }) {
|
|
261
|
-
let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [te,
|
|
266
|
+
let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [te, T] = l({}), [E, re] = l({ version: 0 }), D = s(() => qt(te), [te]), ie = r((e, t) => {
|
|
262
267
|
p((n) => {
|
|
263
268
|
if (!t) {
|
|
264
269
|
let { [e]: t, ...r } = n;
|
|
@@ -269,56 +274,56 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
|
|
|
269
274
|
[e]: t
|
|
270
275
|
};
|
|
271
276
|
});
|
|
272
|
-
}, []),
|
|
277
|
+
}, []), O = n, ae = s(() => It(), [m]), oe = s(() => ({
|
|
273
278
|
name: u,
|
|
274
279
|
keys: {
|
|
275
|
-
...
|
|
280
|
+
...ae,
|
|
276
281
|
...n
|
|
277
282
|
}
|
|
278
283
|
}), [
|
|
279
284
|
n,
|
|
280
285
|
u,
|
|
281
|
-
|
|
282
|
-
]),
|
|
286
|
+
ae
|
|
287
|
+
]), se = r((e, t) => {
|
|
283
288
|
_((n) => ({
|
|
284
289
|
...n,
|
|
285
290
|
[e]: t
|
|
286
291
|
})), y(t ? e : (t) => t === e ? void 0 : t);
|
|
287
|
-
}, []),
|
|
292
|
+
}, []), ce = r((e) => {
|
|
288
293
|
_((t) => ({
|
|
289
294
|
...t,
|
|
290
295
|
[e]: void 0
|
|
291
296
|
})), y((t) => t === e ? void 0 : t);
|
|
292
|
-
}, []),
|
|
297
|
+
}, []), le = r((e, t, n) => {
|
|
293
298
|
ee((r) => {
|
|
294
|
-
let i =
|
|
299
|
+
let i = U(r[e]) ? r[e] : {};
|
|
295
300
|
return {
|
|
296
301
|
...r,
|
|
297
302
|
[e]: Kt(i, t.split(".").filter(Boolean), n)
|
|
298
303
|
};
|
|
299
304
|
});
|
|
300
|
-
}, []),
|
|
305
|
+
}, []), k = r((e) => re((t) => ({
|
|
301
306
|
query: e,
|
|
302
307
|
version: t.version + 1
|
|
303
|
-
})), []),
|
|
304
|
-
h((e) => e + 1),
|
|
305
|
-
for (let e of zt)
|
|
306
|
-
}, [
|
|
307
|
-
a(() => () =>
|
|
308
|
-
let e = () =>
|
|
308
|
+
})), []), ue = c([]), de = r(() => {
|
|
309
|
+
h((e) => e + 1), k();
|
|
310
|
+
for (let e of zt) ue.current.push(setTimeout(() => k(), e));
|
|
311
|
+
}, [k]);
|
|
312
|
+
a(() => () => ue.current.forEach(clearTimeout), []), a(() => {
|
|
313
|
+
let e = () => k(), t = (e) => k(e.detail?.query);
|
|
309
314
|
return globalThis.addEventListener(Lt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
|
|
310
315
|
globalThis.removeEventListener(Lt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
|
|
311
316
|
};
|
|
312
|
-
}, [
|
|
313
|
-
let
|
|
317
|
+
}, [k]);
|
|
318
|
+
let A = v ? g[v] : void 0, fe = r((e) => {
|
|
314
319
|
if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
|
|
315
|
-
if (typeof e == "string") return Jt(e,
|
|
316
|
-
let t = Ut(
|
|
317
|
-
...
|
|
320
|
+
if (typeof e == "string") return Jt(e, A, g, f, x, O, oe, i, o);
|
|
321
|
+
let t = Ut(A, f, x, {
|
|
322
|
+
...D,
|
|
318
323
|
...w
|
|
319
324
|
}, g);
|
|
320
325
|
if (!e.kind && e.path.startsWith("component.")) return S(e.path, t);
|
|
321
|
-
if (!e.kind) return Jt(e.path,
|
|
326
|
+
if (!e.kind) return Jt(e.path, A, g, f, x, O, oe, i, o);
|
|
322
327
|
let n = ne(e, t);
|
|
323
328
|
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), b(t)(e);
|
|
324
329
|
}, [
|
|
@@ -326,87 +331,87 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
|
|
|
326
331
|
i,
|
|
327
332
|
o,
|
|
328
333
|
x,
|
|
329
|
-
E,
|
|
330
|
-
ae,
|
|
331
|
-
f,
|
|
332
|
-
ce,
|
|
333
334
|
O,
|
|
335
|
+
D,
|
|
336
|
+
f,
|
|
337
|
+
oe,
|
|
338
|
+
A,
|
|
334
339
|
g
|
|
335
|
-
]),
|
|
336
|
-
...
|
|
340
|
+
]), pe = r((e) => e ? S(e, Ut(A, f, x, {
|
|
341
|
+
...D,
|
|
337
342
|
...w
|
|
338
343
|
}, g)) : void 0, [
|
|
339
344
|
w,
|
|
340
345
|
x,
|
|
341
|
-
|
|
346
|
+
D,
|
|
342
347
|
f,
|
|
343
|
-
|
|
348
|
+
A,
|
|
344
349
|
g
|
|
345
|
-
]),
|
|
350
|
+
]), me = r((e, t) => T((n) => ({
|
|
346
351
|
...n,
|
|
347
352
|
[e]: t
|
|
348
|
-
})), []),
|
|
353
|
+
})), []), he = r((e) => T((t) => {
|
|
349
354
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
350
355
|
let n = { ...t };
|
|
351
356
|
return delete n[e], n;
|
|
352
|
-
}), []),
|
|
357
|
+
}), []), ge = s(() => Ut(void 0, f, {}, {}, {}).queryResults, [f]), _e = s(() => ({
|
|
353
358
|
locale: i,
|
|
354
359
|
locales: o,
|
|
355
360
|
screen: u,
|
|
356
361
|
routes: e,
|
|
357
362
|
routesReady: t,
|
|
358
|
-
parameters:
|
|
359
|
-
session:
|
|
363
|
+
parameters: O,
|
|
364
|
+
session: ae,
|
|
360
365
|
queries: f,
|
|
361
|
-
selected:
|
|
366
|
+
selected: A,
|
|
362
367
|
selections: g,
|
|
363
|
-
selectRow:
|
|
364
|
-
clearSelection:
|
|
368
|
+
selectRow: se,
|
|
369
|
+
clearSelection: ce,
|
|
365
370
|
setState: (e, t) => C((n) => Kt(n, e.split(".").filter(Boolean), t)),
|
|
366
|
-
setComponentOutput:
|
|
367
|
-
publishComponentOutputs:
|
|
368
|
-
withdrawComponentOutputs:
|
|
369
|
-
queryResults:
|
|
370
|
-
refreshQuery:
|
|
371
|
-
refreshAfterCommand:
|
|
372
|
-
resolveBinding:
|
|
373
|
-
resolveArgument:
|
|
374
|
-
registerQueryResult:
|
|
375
|
-
refreshVersion:
|
|
376
|
-
refreshQueryName:
|
|
371
|
+
setComponentOutput: le,
|
|
372
|
+
publishComponentOutputs: me,
|
|
373
|
+
withdrawComponentOutputs: he,
|
|
374
|
+
queryResults: ge,
|
|
375
|
+
refreshQuery: k,
|
|
376
|
+
refreshAfterCommand: de,
|
|
377
|
+
resolveBinding: fe,
|
|
378
|
+
resolveArgument: pe,
|
|
379
|
+
registerQueryResult: ie,
|
|
380
|
+
refreshVersion: E.version,
|
|
381
|
+
refreshQueryName: E.query
|
|
377
382
|
}), [
|
|
378
|
-
|
|
383
|
+
ce,
|
|
379
384
|
i,
|
|
380
385
|
o,
|
|
381
386
|
f,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
ge,
|
|
388
|
-
_e,
|
|
389
|
-
ve,
|
|
390
|
-
he,
|
|
387
|
+
de,
|
|
388
|
+
k,
|
|
389
|
+
E.query,
|
|
390
|
+
E.version,
|
|
391
|
+
ie,
|
|
391
392
|
me,
|
|
393
|
+
he,
|
|
394
|
+
ge,
|
|
395
|
+
pe,
|
|
396
|
+
fe,
|
|
392
397
|
e,
|
|
393
398
|
t,
|
|
394
|
-
E,
|
|
395
|
-
se,
|
|
396
|
-
u,
|
|
397
|
-
le,
|
|
398
399
|
O,
|
|
400
|
+
ae,
|
|
401
|
+
u,
|
|
402
|
+
se,
|
|
403
|
+
A,
|
|
399
404
|
g,
|
|
400
|
-
|
|
405
|
+
le
|
|
401
406
|
]);
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
value:
|
|
407
|
+
return /* @__PURE__ */ I(Rt.Provider, {
|
|
408
|
+
value: _e,
|
|
404
409
|
children: d
|
|
405
410
|
});
|
|
406
411
|
}
|
|
407
|
-
var
|
|
408
|
-
function
|
|
409
|
-
let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o } =
|
|
412
|
+
var B = () => i(Rt);
|
|
413
|
+
function V(e) {
|
|
414
|
+
let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o } = B(), s = i(Me), u = e.publish !== !1, d = r((e, t) => {
|
|
410
415
|
u && o(e, t);
|
|
411
416
|
}, [u, o]), [f, p] = l([]), [m, h] = l(""), [g, _] = l(!1), [v, y] = l(0), b = c(0), x = c(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
|
|
412
417
|
return a(() => {
|
|
@@ -430,7 +435,7 @@ function z(e) {
|
|
|
430
435
|
e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? dt(o, e.changeSet) : e.data, p(Qt(o)), h(""), _(!1));
|
|
431
436
|
};
|
|
432
437
|
if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
|
|
433
|
-
let l = i.prototype instanceof
|
|
438
|
+
let l = i.prototype instanceof Ne, u = () => Promise.resolve().then(() => yt(i, l ? {
|
|
434
439
|
...r,
|
|
435
440
|
waitForFirstResult: !0
|
|
436
441
|
} : r, s)).then(c).catch(a);
|
|
@@ -538,7 +543,7 @@ function Kt(e, t, n) {
|
|
|
538
543
|
[r]: n
|
|
539
544
|
} : {
|
|
540
545
|
...e,
|
|
541
|
-
[r]: Kt(
|
|
546
|
+
[r]: Kt(U(e[r]) ? e[r] : {}, i, n)
|
|
542
547
|
} : e;
|
|
543
548
|
}
|
|
544
549
|
function qt(e) {
|
|
@@ -555,24 +560,24 @@ function Jt(e, t, n, r, i, a, o, s, c) {
|
|
|
555
560
|
if (l.length !== 0) {
|
|
556
561
|
if (l[0] === "screen") {
|
|
557
562
|
if (l.length === 1) return { name: o.name };
|
|
558
|
-
let e =
|
|
559
|
-
return e === void 0 && l[1] === "keys" && l.length === 3 ?
|
|
563
|
+
let e = H(o, l.slice(1));
|
|
564
|
+
return e === void 0 && l[1] === "keys" && l.length === 3 ? H(t, [l[2]]) : e;
|
|
560
565
|
}
|
|
561
|
-
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Xt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Yt(l.slice(1).join("."), t, n) : l[0] === "state" ?
|
|
566
|
+
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Xt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Yt(l.slice(1).join("."), t, n) : l[0] === "state" ? H(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : H(t, l) ?? Xt(r, void 0, l.join(".")) ?? H(i, l);
|
|
562
567
|
}
|
|
563
568
|
}
|
|
564
569
|
function Yt(e, t, n) {
|
|
565
570
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
566
|
-
return r.length > 0 && Object.hasOwn(n, r[0]) ?
|
|
571
|
+
return r.length > 0 && Object.hasOwn(n, r[0]) ? H(n[r[0]], r.slice(1)) : r.length === 0 ? t : H(t, r);
|
|
567
572
|
}
|
|
568
573
|
function Xt(e, t, n) {
|
|
569
574
|
let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
|
|
570
575
|
if (r.length === 0) return;
|
|
571
576
|
let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
|
|
572
|
-
return a.length === 0 ? i : i.length === 1 ?
|
|
577
|
+
return a.length === 0 ? i : i.length === 1 ? H(i[0], a) : i.map((e) => H(e, a));
|
|
573
578
|
}
|
|
574
579
|
function Zt(e) {
|
|
575
|
-
if (!
|
|
580
|
+
if (!U(e)) return "";
|
|
576
581
|
if (e.isAuthorized === !1) return "The query answered 403.";
|
|
577
582
|
if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
|
|
578
583
|
let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
|
|
@@ -581,46 +586,46 @@ function Zt(e) {
|
|
|
581
586
|
return "";
|
|
582
587
|
}
|
|
583
588
|
function Qt(e) {
|
|
584
|
-
return Array.isArray(e) ? e.filter(
|
|
589
|
+
return Array.isArray(e) ? e.filter(U) : U(e) ? [e] : [];
|
|
585
590
|
}
|
|
586
|
-
function
|
|
591
|
+
function H(e, t) {
|
|
587
592
|
let n = e;
|
|
588
593
|
for (let e of t) {
|
|
589
|
-
if (!
|
|
594
|
+
if (!U(n)) return;
|
|
590
595
|
n = n[e];
|
|
591
596
|
}
|
|
592
597
|
return n;
|
|
593
598
|
}
|
|
594
|
-
function
|
|
599
|
+
function U(e) {
|
|
595
600
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
596
601
|
}
|
|
597
602
|
//#endregion
|
|
598
603
|
//#region src/stageComponentOutputs.ts
|
|
599
604
|
function $t() {
|
|
600
|
-
let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } =
|
|
605
|
+
let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = B();
|
|
601
606
|
return a(() => () => n(e), [e, n]), r((n) => t(e, n), [t, e]);
|
|
602
607
|
}
|
|
603
608
|
//#endregion
|
|
604
609
|
//#region src/commandExecutor.ts
|
|
605
|
-
function
|
|
610
|
+
function W(e, t, n) {
|
|
606
611
|
for (let r of [
|
|
607
612
|
t,
|
|
608
613
|
n?.replace(/^\//, ""),
|
|
609
614
|
e
|
|
610
615
|
]) {
|
|
611
616
|
if (!r) continue;
|
|
612
|
-
let t =
|
|
617
|
+
let t = Ie(r);
|
|
613
618
|
if (en(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
614
619
|
}
|
|
615
620
|
}
|
|
616
621
|
function en(e) {
|
|
617
|
-
return typeof e == "function" && e.prototype instanceof
|
|
622
|
+
return typeof e == "function" && e.prototype instanceof We;
|
|
618
623
|
}
|
|
619
624
|
function tn(e, t) {
|
|
620
625
|
return e.setApiBasePath(pt(t)), e;
|
|
621
626
|
}
|
|
622
627
|
async function nn(e, t, n) {
|
|
623
|
-
let r =
|
|
628
|
+
let r = W(e);
|
|
624
629
|
if (!r) return {
|
|
625
630
|
isSuccess: !1,
|
|
626
631
|
validationErrors: [],
|
|
@@ -648,7 +653,7 @@ function rn(e, t) {
|
|
|
648
653
|
};
|
|
649
654
|
}
|
|
650
655
|
function an() {
|
|
651
|
-
let e = i(
|
|
656
|
+
let e = i(Me);
|
|
652
657
|
return r((t, n) => nn(t, n, e), [e]);
|
|
653
658
|
}
|
|
654
659
|
//#endregion
|
|
@@ -657,43 +662,57 @@ function on(e, t = {}) {
|
|
|
657
662
|
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
658
663
|
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
659
664
|
}
|
|
660
|
-
function
|
|
665
|
+
function G(e, t = {}) {
|
|
661
666
|
if (!globalThis.location) return;
|
|
667
|
+
if (sn === "path") {
|
|
668
|
+
let n = ln(e, t);
|
|
669
|
+
if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
|
|
670
|
+
globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
662
673
|
let n = on(e, t);
|
|
663
674
|
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
664
675
|
}
|
|
665
|
-
|
|
666
|
-
|
|
676
|
+
var sn = "hash";
|
|
677
|
+
function cn(e) {
|
|
678
|
+
sn = e;
|
|
679
|
+
}
|
|
680
|
+
function ln(e, t = {}) {
|
|
681
|
+
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
682
|
+
return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
|
|
683
|
+
}
|
|
684
|
+
function un(e) {
|
|
685
|
+
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ue)).map(([e, t]) => [e, String(t)]));
|
|
667
686
|
}
|
|
668
687
|
//#endregion
|
|
669
688
|
//#region src/stageFormSchema.ts
|
|
670
|
-
var
|
|
671
|
-
function
|
|
689
|
+
var dn = 8;
|
|
690
|
+
function K(e) {
|
|
672
691
|
if (!e) return [];
|
|
673
692
|
try {
|
|
674
|
-
return
|
|
693
|
+
return fn(JSON.parse(e), 0);
|
|
675
694
|
} catch {
|
|
676
695
|
return [];
|
|
677
696
|
}
|
|
678
697
|
}
|
|
679
|
-
function
|
|
680
|
-
let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i =
|
|
681
|
-
return Object.entries(i).map(([e, i]) =>
|
|
698
|
+
function fn(e, t) {
|
|
699
|
+
let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = bn(e.properties) ? e.properties : {};
|
|
700
|
+
return Object.entries(i).map(([e, i]) => pn(e, i, !n || r.has(e), t));
|
|
682
701
|
}
|
|
683
|
-
function
|
|
702
|
+
function pn(e, t, n, r) {
|
|
684
703
|
return {
|
|
685
704
|
name: e,
|
|
686
705
|
identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
687
706
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
688
707
|
required: n,
|
|
689
|
-
...
|
|
708
|
+
...mn(t, r)
|
|
690
709
|
};
|
|
691
710
|
}
|
|
692
|
-
function
|
|
711
|
+
function mn(e, t) {
|
|
693
712
|
let n = e?.type;
|
|
694
713
|
if (Array.isArray(n)) {
|
|
695
714
|
let r = n.filter((e) => e !== "null");
|
|
696
|
-
return r.length === 1 ?
|
|
715
|
+
return r.length === 1 ? mn({
|
|
697
716
|
...e,
|
|
698
717
|
type: r[0]
|
|
699
718
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -704,8 +723,8 @@ function dn(e, t) {
|
|
|
704
723
|
type: "date",
|
|
705
724
|
withTime: e.format === "date-time"
|
|
706
725
|
};
|
|
707
|
-
if (n === "array") return
|
|
708
|
-
if (n === "object") return
|
|
726
|
+
if (n === "array") return hn(e, t);
|
|
727
|
+
if (n === "object") return gn(e, t);
|
|
709
728
|
if (n === void 0 || n === "string") {
|
|
710
729
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
711
730
|
return t.length > 0 ? {
|
|
@@ -715,77 +734,77 @@ function dn(e, t) {
|
|
|
715
734
|
}
|
|
716
735
|
return { unsupportedReason: `type ${String(n)}` };
|
|
717
736
|
}
|
|
718
|
-
function
|
|
737
|
+
function hn(e, t) {
|
|
719
738
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
720
|
-
if (t >=
|
|
721
|
-
let r =
|
|
739
|
+
if (t >= dn || e?.items === void 0) return n;
|
|
740
|
+
let r = pn("", e.items, !0, t + 1);
|
|
722
741
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
723
742
|
}
|
|
724
|
-
function
|
|
743
|
+
function gn(e, t) {
|
|
725
744
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
726
|
-
if (t >=
|
|
727
|
-
let r =
|
|
745
|
+
if (t >= dn || !bn(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
746
|
+
let r = fn(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
728
747
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
729
748
|
}
|
|
730
|
-
function
|
|
749
|
+
function q(e) {
|
|
731
750
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
|
732
751
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
733
752
|
}
|
|
734
|
-
function
|
|
753
|
+
function _n(e, t, n) {
|
|
735
754
|
if (t != null) {
|
|
736
|
-
if (e.members &&
|
|
737
|
-
let e = t[r.name], i =
|
|
738
|
-
if (
|
|
755
|
+
if (e.members && bn(t)) for (let r of e.members) {
|
|
756
|
+
let e = t[r.name], i = q(r.name);
|
|
757
|
+
if (vn(e)) {
|
|
739
758
|
if (r.required) return `${n}: ${i} is required`;
|
|
740
759
|
continue;
|
|
741
760
|
}
|
|
742
|
-
let a =
|
|
761
|
+
let a = _n(r, e, `${n} ${i.toLowerCase()}`);
|
|
743
762
|
if (a) return a;
|
|
744
763
|
}
|
|
745
764
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
746
|
-
let t =
|
|
765
|
+
let t = vn(i) ? `${n} ${r + 1} is required` : _n(e.item, i, `${n} ${r + 1}`);
|
|
747
766
|
if (t) return t;
|
|
748
767
|
}
|
|
749
768
|
}
|
|
750
769
|
}
|
|
751
|
-
function
|
|
770
|
+
function vn(e) {
|
|
752
771
|
return e == null || e === "";
|
|
753
772
|
}
|
|
754
|
-
function
|
|
755
|
-
return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members &&
|
|
773
|
+
function yn(e, t) {
|
|
774
|
+
return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && bn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
756
775
|
let r = e.members?.find((e) => e.name === t);
|
|
757
|
-
return [t, r ?
|
|
758
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
776
|
+
return [t, r ? yn(r, n) : n];
|
|
777
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => yn(e.item, t)) : t;
|
|
759
778
|
}
|
|
760
|
-
function
|
|
779
|
+
function bn(e) {
|
|
761
780
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
762
781
|
}
|
|
763
782
|
//#endregion
|
|
764
783
|
//#region src/StageValueFields.tsx
|
|
765
|
-
var
|
|
784
|
+
var xn = Ke((e) => /* @__PURE__ */ I(Sn, {
|
|
766
785
|
descriptor: e.descriptor,
|
|
767
|
-
label: e.title ??
|
|
786
|
+
label: e.title ?? q(e.descriptor.name),
|
|
768
787
|
value: e.value,
|
|
769
788
|
onChange: e.onChange,
|
|
770
789
|
onBlur: e.onBlur,
|
|
771
790
|
invalid: e.invalid
|
|
772
791
|
}), { defaultValue: void 0 });
|
|
773
|
-
function
|
|
774
|
-
return e.members ? /* @__PURE__ */
|
|
792
|
+
function Sn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
793
|
+
return e.members ? /* @__PURE__ */ I(Cn, {
|
|
775
794
|
descriptor: e,
|
|
776
795
|
label: t,
|
|
777
796
|
value: n,
|
|
778
797
|
onChange: r,
|
|
779
798
|
onBlur: i,
|
|
780
799
|
invalid: a
|
|
781
|
-
}) : e.item ? /* @__PURE__ */
|
|
800
|
+
}) : e.item ? /* @__PURE__ */ I(wn, {
|
|
782
801
|
descriptor: e,
|
|
783
802
|
label: t,
|
|
784
803
|
value: n,
|
|
785
804
|
onChange: r,
|
|
786
805
|
onBlur: i,
|
|
787
806
|
invalid: a
|
|
788
|
-
}) : /* @__PURE__ */
|
|
807
|
+
}) : /* @__PURE__ */ I(Tn, {
|
|
789
808
|
descriptor: e,
|
|
790
809
|
label: t,
|
|
791
810
|
value: n,
|
|
@@ -794,14 +813,14 @@ function yn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
794
813
|
invalid: a
|
|
795
814
|
});
|
|
796
815
|
}
|
|
797
|
-
function
|
|
798
|
-
let o =
|
|
799
|
-
return /* @__PURE__ */
|
|
816
|
+
function Cn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
817
|
+
let o = On(n) ? n : {};
|
|
818
|
+
return /* @__PURE__ */ L("fieldset", {
|
|
800
819
|
className: "stage-record-field",
|
|
801
820
|
"data-invalid": a ? "true" : void 0,
|
|
802
|
-
children: [/* @__PURE__ */
|
|
821
|
+
children: [/* @__PURE__ */ I("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ I(Sn, {
|
|
803
822
|
descriptor: e,
|
|
804
|
-
label:
|
|
823
|
+
label: q(e.name),
|
|
805
824
|
value: o[e.name],
|
|
806
825
|
onBlur: i,
|
|
807
826
|
onChange: (t) => r({
|
|
@@ -811,74 +830,74 @@ function bn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
811
830
|
}, e.name))]
|
|
812
831
|
});
|
|
813
832
|
}
|
|
814
|
-
function
|
|
833
|
+
function wn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
815
834
|
let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
|
|
816
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ L("fieldset", {
|
|
817
836
|
className: "stage-list-field",
|
|
818
837
|
"data-invalid": a ? "true" : void 0,
|
|
819
838
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
s.length === 0 && /* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ I("legend", { children: t }),
|
|
840
|
+
s.length === 0 && /* @__PURE__ */ I("p", {
|
|
822
841
|
className: "stage-note",
|
|
823
842
|
children: "Nothing added yet."
|
|
824
843
|
}),
|
|
825
|
-
s.map((e, n) => /* @__PURE__ */
|
|
844
|
+
s.map((e, n) => /* @__PURE__ */ L("div", {
|
|
826
845
|
className: "stage-list-field__row",
|
|
827
|
-
children: [/* @__PURE__ */
|
|
846
|
+
children: [/* @__PURE__ */ I(Sn, {
|
|
828
847
|
descriptor: o,
|
|
829
848
|
label: `${t} ${n + 1}`,
|
|
830
849
|
value: e,
|
|
831
850
|
onBlur: i,
|
|
832
851
|
onChange: (e) => c(s.map((t, r) => r === n ? e : t))
|
|
833
|
-
}), /* @__PURE__ */
|
|
852
|
+
}), /* @__PURE__ */ I("button", {
|
|
834
853
|
type: "button",
|
|
835
854
|
"aria-label": `Remove ${t} ${n + 1}`,
|
|
836
855
|
onClick: () => c(s.filter((e, t) => t !== n)),
|
|
837
856
|
children: "Remove"
|
|
838
857
|
})]
|
|
839
858
|
}, n)),
|
|
840
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ I("button", {
|
|
841
860
|
type: "button",
|
|
842
861
|
"aria-label": `Add ${t}`,
|
|
843
|
-
onClick: () => c([...s,
|
|
862
|
+
onClick: () => c([...s, En(o)]),
|
|
844
863
|
children: "Add"
|
|
845
864
|
})
|
|
846
865
|
]
|
|
847
866
|
});
|
|
848
867
|
}
|
|
849
|
-
function
|
|
868
|
+
function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
850
869
|
let o = {
|
|
851
870
|
"aria-invalid": a ? !0 : void 0,
|
|
852
871
|
onBlur: i
|
|
853
872
|
};
|
|
854
|
-
if (e.options) return /* @__PURE__ */
|
|
873
|
+
if (e.options) return /* @__PURE__ */ L("label", {
|
|
855
874
|
className: "stage-value-field",
|
|
856
|
-
children: [/* @__PURE__ */
|
|
875
|
+
children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ L("select", {
|
|
857
876
|
...o,
|
|
858
877
|
value: typeof n == "string" ? n : "",
|
|
859
878
|
onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
|
|
860
|
-
children: [/* @__PURE__ */
|
|
879
|
+
children: [/* @__PURE__ */ I("option", {
|
|
861
880
|
value: "",
|
|
862
881
|
children: ""
|
|
863
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
882
|
+
}), e.options.map((e) => /* @__PURE__ */ I("option", {
|
|
864
883
|
value: e,
|
|
865
|
-
children:
|
|
884
|
+
children: q(e)
|
|
866
885
|
}, e))]
|
|
867
886
|
})]
|
|
868
887
|
});
|
|
869
888
|
switch (e.type) {
|
|
870
|
-
case "boolean": return /* @__PURE__ */
|
|
889
|
+
case "boolean": return /* @__PURE__ */ L("label", {
|
|
871
890
|
className: "stage-value-field stage-value-field--check",
|
|
872
|
-
children: [/* @__PURE__ */
|
|
891
|
+
children: [/* @__PURE__ */ I("input", {
|
|
873
892
|
...o,
|
|
874
893
|
type: "checkbox",
|
|
875
894
|
checked: n === !0,
|
|
876
895
|
onChange: (e) => r(e.target.checked)
|
|
877
|
-
}), /* @__PURE__ */
|
|
896
|
+
}), /* @__PURE__ */ I("span", { children: t })]
|
|
878
897
|
});
|
|
879
|
-
case "number": return /* @__PURE__ */
|
|
898
|
+
case "number": return /* @__PURE__ */ L("label", {
|
|
880
899
|
className: "stage-value-field",
|
|
881
|
-
children: [/* @__PURE__ */
|
|
900
|
+
children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
|
|
882
901
|
...o,
|
|
883
902
|
type: "number",
|
|
884
903
|
step: "any",
|
|
@@ -886,18 +905,18 @@ function Sn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
886
905
|
onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
|
|
887
906
|
})]
|
|
888
907
|
});
|
|
889
|
-
case "date": return /* @__PURE__ */
|
|
908
|
+
case "date": return /* @__PURE__ */ L("label", {
|
|
890
909
|
className: "stage-value-field",
|
|
891
|
-
children: [/* @__PURE__ */
|
|
910
|
+
children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
|
|
892
911
|
...o,
|
|
893
912
|
type: e.withTime ? "datetime-local" : "date",
|
|
894
913
|
value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
|
|
895
|
-
onChange: (t) => r(t.target.value === "" ? void 0 :
|
|
914
|
+
onChange: (t) => r(t.target.value === "" ? void 0 : Dn(t.target.value, e.withTime === !0))
|
|
896
915
|
})]
|
|
897
916
|
});
|
|
898
|
-
default: return /* @__PURE__ */
|
|
917
|
+
default: return /* @__PURE__ */ L("label", {
|
|
899
918
|
className: "stage-value-field",
|
|
900
|
-
children: [/* @__PURE__ */
|
|
919
|
+
children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
|
|
901
920
|
...o,
|
|
902
921
|
type: "text",
|
|
903
922
|
value: typeof n == "string" ? n : "",
|
|
@@ -906,118 +925,125 @@ function Sn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
906
925
|
});
|
|
907
926
|
}
|
|
908
927
|
}
|
|
909
|
-
function
|
|
928
|
+
function En(e) {
|
|
910
929
|
return e.members ? {} : void 0;
|
|
911
930
|
}
|
|
912
|
-
function
|
|
931
|
+
function Dn(e, t) {
|
|
913
932
|
if (!t) return e;
|
|
914
933
|
let n = new Date(e);
|
|
915
934
|
return Number.isNaN(n.getTime()) ? e : n.toISOString();
|
|
916
935
|
}
|
|
917
|
-
function
|
|
936
|
+
function On(e) {
|
|
918
937
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
919
938
|
}
|
|
920
939
|
//#endregion
|
|
921
940
|
//#region src/StageCommandForm.tsx
|
|
922
|
-
var
|
|
923
|
-
function
|
|
924
|
-
let t =
|
|
925
|
-
...
|
|
926
|
-
...
|
|
927
|
-
...
|
|
941
|
+
var kn = t(void 0), An = t(null);
|
|
942
|
+
function jn({ element: e }) {
|
|
943
|
+
let t = B(), n = i(Me), r = i(kn), a = i(An), o = c(null), u = s(() => Nn(e), [e]), d = s(() => dr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? Pn(u, d) : [], [u, d]), m = u ? W(u.command, Y(e, "typeName"), Y(e, "route")) : void 0, h = Y(e, "submitLabel") || "Submit", g = $n(e, p, t.resolveArgument), _ = Zn(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), b = s(() => Jn(t.selections, t.queries), [t.selections, t.queries]), x = s(() => qn(t.queries), [t.queries]), S = e.properties.rowAction === !0, C = s(() => ({
|
|
944
|
+
...y,
|
|
945
|
+
...Bn(p, d, t.parameters, b, x, S),
|
|
946
|
+
...zn(p, t.parameters)
|
|
928
947
|
}), [
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
948
|
+
y,
|
|
949
|
+
p,
|
|
950
|
+
d,
|
|
932
951
|
t.parameters,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
]),
|
|
937
|
-
a,
|
|
952
|
+
b,
|
|
953
|
+
x,
|
|
954
|
+
S
|
|
955
|
+
]), w = s(() => u ? Fn(u, p, d) : void 0, [
|
|
938
956
|
u,
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
957
|
+
p,
|
|
958
|
+
d
|
|
959
|
+
]), ee = s(() => u ? lr(p, d) : [], [
|
|
942
960
|
u,
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
961
|
+
p,
|
|
962
|
+
d
|
|
963
|
+
]), te = s(() => u ? ur(u.layout, p) : [], [u, p]), [ne, T] = l([]);
|
|
964
|
+
return u ? !m && !t.routesReady ? /* @__PURE__ */ L("p", {
|
|
946
965
|
className: "stage-note",
|
|
947
966
|
children: [
|
|
948
967
|
"The modeled command “",
|
|
949
|
-
|
|
968
|
+
u.command,
|
|
950
969
|
"” is waiting for Stage routes."
|
|
951
970
|
]
|
|
952
|
-
}) :
|
|
953
|
-
form:
|
|
954
|
-
messages: [`The modeled command “${
|
|
955
|
-
}) :
|
|
956
|
-
form:
|
|
957
|
-
messages:
|
|
958
|
-
}) : /* @__PURE__ */
|
|
971
|
+
}) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ I(Mn, {
|
|
972
|
+
form: u,
|
|
973
|
+
messages: [`The modeled command “${u.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
974
|
+
}) : ee.length > 0 ? /* @__PURE__ */ I(Mn, {
|
|
975
|
+
form: u,
|
|
976
|
+
messages: ee
|
|
977
|
+
}) : /* @__PURE__ */ I("section", {
|
|
978
|
+
ref: o,
|
|
959
979
|
className: "stage-command-form",
|
|
960
|
-
"data-command":
|
|
961
|
-
"data-generation-mode":
|
|
962
|
-
children: /* @__PURE__ */
|
|
963
|
-
command:
|
|
964
|
-
initialValues:
|
|
965
|
-
currentValues:
|
|
980
|
+
"data-command": u.command,
|
|
981
|
+
"data-generation-mode": u.generationMode,
|
|
982
|
+
children: /* @__PURE__ */ L(Ge, {
|
|
983
|
+
command: m,
|
|
984
|
+
initialValues: C,
|
|
985
|
+
currentValues: g,
|
|
966
986
|
validateOn: "both",
|
|
967
987
|
validateAllFieldsOnChange: !0,
|
|
968
988
|
onBeforeExecute: (e) => tn(e, n.apiBasePath),
|
|
969
|
-
onFieldValidate: (e, t, n, r) =>
|
|
970
|
-
onValidationFailure: (e) =>
|
|
971
|
-
onException: (e) =>
|
|
972
|
-
onFailed: (e) =>
|
|
989
|
+
onFieldValidate: (e, t, n, r) => cr(p, d, t, r),
|
|
990
|
+
onValidationFailure: (e) => T(sr(p, e)),
|
|
991
|
+
onException: (e) => T(e),
|
|
992
|
+
onFailed: (e) => T(rn(u.command, e).messages),
|
|
973
993
|
onSuccess: () => {
|
|
974
|
-
|
|
994
|
+
T([]), t.refreshAfterCommand();
|
|
975
995
|
let n = Y(e, "navigateToScreen");
|
|
976
|
-
n &&
|
|
996
|
+
n && G(n, {}), r?.();
|
|
977
997
|
},
|
|
978
998
|
children: [
|
|
979
|
-
|
|
999
|
+
te.map((e) => /* @__PURE__ */ I("p", {
|
|
980
1000
|
role: "alert",
|
|
981
1001
|
className: "stage-form-error",
|
|
982
1002
|
children: e
|
|
983
1003
|
}, e)),
|
|
984
|
-
|
|
985
|
-
|
|
1004
|
+
w,
|
|
1005
|
+
ne.map((e) => /* @__PURE__ */ I("p", {
|
|
986
1006
|
role: "alert",
|
|
987
1007
|
className: "stage-form-error",
|
|
988
1008
|
children: e
|
|
989
1009
|
}, e)),
|
|
990
|
-
/* @__PURE__ */
|
|
1010
|
+
a ? Ve(/* @__PURE__ */ I("button", {
|
|
1011
|
+
type: "button",
|
|
1012
|
+
className: "scene-slice-dialog-submit",
|
|
1013
|
+
onClick: () => o.current?.querySelector("form")?.requestSubmit(),
|
|
1014
|
+
children: h
|
|
1015
|
+
}), a) : /* @__PURE__ */ I("button", {
|
|
991
1016
|
type: "submit",
|
|
992
|
-
|
|
1017
|
+
className: "stage-command-form__submit",
|
|
1018
|
+
children: h
|
|
993
1019
|
})
|
|
994
1020
|
]
|
|
995
|
-
},
|
|
996
|
-
}) : /* @__PURE__ */
|
|
1021
|
+
}, v)
|
|
1022
|
+
}) : /* @__PURE__ */ L("p", {
|
|
997
1023
|
className: "stage-note",
|
|
998
1024
|
children: [
|
|
999
1025
|
"The modeled command “",
|
|
1000
|
-
|
|
1026
|
+
u.command,
|
|
1001
1027
|
"” is not registered by this Stage."
|
|
1002
1028
|
]
|
|
1003
|
-
}) : /* @__PURE__ */
|
|
1029
|
+
}) : /* @__PURE__ */ I("p", {
|
|
1004
1030
|
className: "stage-note",
|
|
1005
1031
|
children: "This form is missing its command metadata."
|
|
1006
1032
|
});
|
|
1007
1033
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return /* @__PURE__ */
|
|
1034
|
+
function Mn({ form: e, messages: t }) {
|
|
1035
|
+
return /* @__PURE__ */ I("section", {
|
|
1010
1036
|
className: "stage-command-form",
|
|
1011
1037
|
"data-command": e.command,
|
|
1012
1038
|
"data-generation-mode": e.generationMode,
|
|
1013
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1039
|
+
children: t.map((e) => /* @__PURE__ */ I("p", {
|
|
1014
1040
|
role: "alert",
|
|
1015
1041
|
className: "stage-form-error",
|
|
1016
1042
|
children: e
|
|
1017
1043
|
}, e))
|
|
1018
1044
|
});
|
|
1019
1045
|
}
|
|
1020
|
-
function
|
|
1046
|
+
function Nn(e) {
|
|
1021
1047
|
let t = Y(e, "command");
|
|
1022
1048
|
if (!t) return;
|
|
1023
1049
|
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(X) : [];
|
|
@@ -1025,41 +1051,41 @@ function On(e) {
|
|
|
1025
1051
|
command: t,
|
|
1026
1052
|
label: Y(e, "label", t),
|
|
1027
1053
|
fields: n,
|
|
1028
|
-
generationMode:
|
|
1029
|
-
layout:
|
|
1054
|
+
generationMode: tr(e.properties.generationMode),
|
|
1055
|
+
layout: nr(e.properties.layout)
|
|
1030
1056
|
};
|
|
1031
1057
|
}
|
|
1032
|
-
function
|
|
1058
|
+
function Pn(e, t) {
|
|
1033
1059
|
return e.generationMode === f.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1034
1060
|
name: e.name,
|
|
1035
|
-
label:
|
|
1061
|
+
label: q(e.name)
|
|
1036
1062
|
}));
|
|
1037
1063
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let r = e.layout, i = r ?
|
|
1040
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
1041
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1042
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1064
|
+
function Fn(e, t, n) {
|
|
1065
|
+
let r = e.layout, i = r ? rr(r, t) : [];
|
|
1066
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => In(e, n));
|
|
1067
|
+
let a = new Map(t.map((e) => [e.name, e])), o = ir(r, i), s = {
|
|
1068
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => ar(t + 1, r.columns)).join(" "),
|
|
1043
1069
|
columnGap: J(r.columnGap),
|
|
1044
1070
|
rowGap: J(r.rowGap)
|
|
1045
1071
|
}, c = /* @__PURE__ */ new Set();
|
|
1046
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ L("div", {
|
|
1047
1073
|
className: "stage-command-form__layout",
|
|
1048
1074
|
style: s,
|
|
1049
1075
|
children: [i.map((e) => {
|
|
1050
1076
|
let t = a.get(e.field);
|
|
1051
|
-
return t ? (c.add(t.name),
|
|
1052
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
1077
|
+
return t ? (c.add(t.name), In(t, n, e)) : null;
|
|
1078
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => In(e, n))]
|
|
1053
1079
|
});
|
|
1054
1080
|
}
|
|
1055
|
-
function
|
|
1081
|
+
function In(e, t, n) {
|
|
1056
1082
|
let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
|
|
1057
1083
|
if (i?.options) {
|
|
1058
1084
|
let e = i.options.map((e) => ({
|
|
1059
1085
|
value: e,
|
|
1060
|
-
label:
|
|
1086
|
+
label: q(e)
|
|
1061
1087
|
}));
|
|
1062
|
-
return /* @__PURE__ */
|
|
1088
|
+
return /* @__PURE__ */ I(Xe, {
|
|
1063
1089
|
value: o,
|
|
1064
1090
|
fieldName: r,
|
|
1065
1091
|
title: a,
|
|
@@ -1069,7 +1095,7 @@ function jn(e, t, n) {
|
|
|
1069
1095
|
optionLabel: "label"
|
|
1070
1096
|
});
|
|
1071
1097
|
}
|
|
1072
|
-
if (i?.members || i?.item) return /* @__PURE__ */
|
|
1098
|
+
if (i?.members || i?.item) return /* @__PURE__ */ I(xn, {
|
|
1073
1099
|
value: o,
|
|
1074
1100
|
fieldName: r,
|
|
1075
1101
|
title: a,
|
|
@@ -1077,19 +1103,19 @@ function jn(e, t, n) {
|
|
|
1077
1103
|
descriptor: i
|
|
1078
1104
|
});
|
|
1079
1105
|
switch (i?.type ?? "text") {
|
|
1080
|
-
case "number": return /* @__PURE__ */
|
|
1106
|
+
case "number": return /* @__PURE__ */ I(Qe, {
|
|
1081
1107
|
value: o,
|
|
1082
1108
|
fieldName: r,
|
|
1083
1109
|
title: a,
|
|
1084
1110
|
required: s
|
|
1085
1111
|
});
|
|
1086
|
-
case "boolean": return /* @__PURE__ */
|
|
1112
|
+
case "boolean": return /* @__PURE__ */ I(Ye, {
|
|
1087
1113
|
value: o,
|
|
1088
1114
|
fieldName: r,
|
|
1089
1115
|
label: a,
|
|
1090
1116
|
required: s
|
|
1091
1117
|
});
|
|
1092
|
-
case "date": return /* @__PURE__ */
|
|
1118
|
+
case "date": return /* @__PURE__ */ I(Ln, {
|
|
1093
1119
|
value: o,
|
|
1094
1120
|
fieldName: r,
|
|
1095
1121
|
title: a,
|
|
@@ -1097,15 +1123,15 @@ function jn(e, t, n) {
|
|
|
1097
1123
|
showIcon: !0,
|
|
1098
1124
|
showTime: i?.withTime
|
|
1099
1125
|
});
|
|
1100
|
-
default: return /* @__PURE__ */
|
|
1126
|
+
default: return /* @__PURE__ */ I(Ze, {
|
|
1101
1127
|
value: o,
|
|
1102
1128
|
fieldName: r,
|
|
1103
1129
|
title: a,
|
|
1104
1130
|
required: s
|
|
1105
1131
|
});
|
|
1106
1132
|
}
|
|
1107
|
-
})(), l =
|
|
1108
|
-
return /* @__PURE__ */
|
|
1133
|
+
})(), l = or(n);
|
|
1134
|
+
return /* @__PURE__ */ I("span", {
|
|
1109
1135
|
className: "stage-command-form__field",
|
|
1110
1136
|
"data-field": e.name,
|
|
1111
1137
|
"data-row": n?.row,
|
|
@@ -1115,21 +1141,21 @@ function jn(e, t, n) {
|
|
|
1115
1141
|
children: c
|
|
1116
1142
|
}, e.name);
|
|
1117
1143
|
}
|
|
1118
|
-
var
|
|
1144
|
+
var Ln = qe((e) => /* @__PURE__ */ I(Je, {
|
|
1119
1145
|
...e,
|
|
1120
|
-
currentValue: e.showTime ? e.currentValue :
|
|
1121
|
-
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ?
|
|
1146
|
+
currentValue: e.showTime ? e.currentValue : Rn(e.currentValue),
|
|
1147
|
+
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? He.fromDate(t) : t)
|
|
1122
1148
|
}));
|
|
1123
|
-
function
|
|
1124
|
-
if (e instanceof
|
|
1149
|
+
function Rn(e) {
|
|
1150
|
+
if (e instanceof He) return e.toDate();
|
|
1125
1151
|
if (typeof e != "string") return e;
|
|
1126
1152
|
try {
|
|
1127
|
-
return
|
|
1153
|
+
return He.parse(e).toDate();
|
|
1128
1154
|
} catch {
|
|
1129
1155
|
return null;
|
|
1130
1156
|
}
|
|
1131
1157
|
}
|
|
1132
|
-
function
|
|
1158
|
+
function zn(e, t) {
|
|
1133
1159
|
let n = {};
|
|
1134
1160
|
for (let r of e) {
|
|
1135
1161
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1137,35 +1163,35 @@ function Pn(e, t) {
|
|
|
1137
1163
|
}
|
|
1138
1164
|
return n;
|
|
1139
1165
|
}
|
|
1140
|
-
function
|
|
1166
|
+
function Bn(e, t, n, r = [], i = [], a = !1) {
|
|
1141
1167
|
let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
|
|
1142
1168
|
for (let e of t) {
|
|
1143
1169
|
if (!e.identifier || !e.required || o.has(e.name)) continue;
|
|
1144
|
-
if (a &&
|
|
1145
|
-
let t = n[e.name] ||
|
|
1170
|
+
if (a && Wn(e, i)) {
|
|
1171
|
+
let t = n[e.name] || Un(e, r);
|
|
1146
1172
|
t && (c[e.name] = t);
|
|
1147
1173
|
continue;
|
|
1148
1174
|
}
|
|
1149
|
-
let t = n[e.name] ||
|
|
1175
|
+
let t = n[e.name] || Un(e, r) || Pt(e.identifier) || (e.identity || !s && !Wn(e, i) ? Ft(e.identifier) : void 0);
|
|
1150
1176
|
t !== void 0 && (c[e.name] = t);
|
|
1151
1177
|
}
|
|
1152
1178
|
return c;
|
|
1153
1179
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 ||
|
|
1180
|
+
function Vn(e, t) {
|
|
1181
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || Hn(e, t) !== void 0;
|
|
1156
1182
|
}
|
|
1157
|
-
function
|
|
1183
|
+
function Hn(e, t) {
|
|
1158
1184
|
if (e.identifier) return t[e.name] || Pt(e.identifier);
|
|
1159
1185
|
}
|
|
1160
|
-
function
|
|
1186
|
+
function Un(e, t) {
|
|
1161
1187
|
if (!e.identifier) return;
|
|
1162
1188
|
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1163
1189
|
return n.size === 1 ? [...n][0] : void 0;
|
|
1164
1190
|
}
|
|
1165
|
-
function
|
|
1191
|
+
function Wn(e, t) {
|
|
1166
1192
|
return t.some((t) => Object.hasOwn(t, e.name));
|
|
1167
1193
|
}
|
|
1168
|
-
function
|
|
1194
|
+
function Gn(e, t) {
|
|
1169
1195
|
let n = e.id;
|
|
1170
1196
|
if (typeof n != "string" || n === "") return e;
|
|
1171
1197
|
let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
|
|
@@ -1174,25 +1200,25 @@ function zn(e, t) {
|
|
|
1174
1200
|
...e
|
|
1175
1201
|
};
|
|
1176
1202
|
}
|
|
1177
|
-
function
|
|
1178
|
-
return Object.values(e).flatMap((e) => e.rows.map((t) => [t,
|
|
1203
|
+
function Kn(e) {
|
|
1204
|
+
return Object.values(e).flatMap((e) => e.rows.map((t) => [t, Gn(t, e)]));
|
|
1179
1205
|
}
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1206
|
+
function qn(e) {
|
|
1207
|
+
return Kn(e).map(([, e]) => e);
|
|
1182
1208
|
}
|
|
1183
|
-
function
|
|
1184
|
-
let n = new Map(
|
|
1209
|
+
function Jn(e, t) {
|
|
1210
|
+
let n = new Map(Kn(t));
|
|
1185
1211
|
return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
|
|
1186
1212
|
}
|
|
1187
|
-
function
|
|
1188
|
-
return e.filter((e) => e.identifier && e.required &&
|
|
1213
|
+
function Yn(e, t, n, r) {
|
|
1214
|
+
return e.filter((e) => e.identifier && e.required && Wn(e, r)).filter((e) => !t[e.name] && Un(e, n) === void 0).map((e) => e.name);
|
|
1189
1215
|
}
|
|
1190
|
-
function
|
|
1216
|
+
function Xn(e) {
|
|
1191
1217
|
let t = e.properties.populateSource;
|
|
1192
1218
|
return X(t) ? t : void 0;
|
|
1193
1219
|
}
|
|
1194
|
-
function
|
|
1195
|
-
let r =
|
|
1220
|
+
function Zn(e, t, n) {
|
|
1221
|
+
let r = Xn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Qn(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = V({
|
|
1196
1222
|
scope: `populate:${Y(e, "command")}`,
|
|
1197
1223
|
name: i,
|
|
1198
1224
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
@@ -1205,12 +1231,12 @@ function Gn(e, t, n) {
|
|
|
1205
1231
|
let e = {};
|
|
1206
1232
|
for (let n of t) {
|
|
1207
1233
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1208
|
-
t != null && (e[n.name] =
|
|
1234
|
+
t != null && (e[n.name] = yn(n, t));
|
|
1209
1235
|
}
|
|
1210
1236
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1211
1237
|
}, [d, t]);
|
|
1212
1238
|
}
|
|
1213
|
-
function
|
|
1239
|
+
function Qn(e, t, n, r) {
|
|
1214
1240
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1215
1241
|
if (i) return i;
|
|
1216
1242
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
@@ -1218,45 +1244,45 @@ function Kn(e, t, n, r) {
|
|
|
1218
1244
|
let o = r.resolveBinding({ path: t });
|
|
1219
1245
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1220
1246
|
}
|
|
1221
|
-
function
|
|
1222
|
-
let r = s(() =>
|
|
1247
|
+
function $n(e, t, n) {
|
|
1248
|
+
let r = s(() => er(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1223
1249
|
return s(() => {
|
|
1224
1250
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1225
1251
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1226
1252
|
}, [r, a]);
|
|
1227
1253
|
}
|
|
1228
|
-
function
|
|
1254
|
+
function er(e, t) {
|
|
1229
1255
|
let n = e.properties.arguments;
|
|
1230
1256
|
if (!Array.isArray(n)) return [];
|
|
1231
1257
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1232
1258
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1233
1259
|
}
|
|
1234
|
-
function
|
|
1260
|
+
function tr(e) {
|
|
1235
1261
|
return e === f.Manual ? f.Manual : f.Auto;
|
|
1236
1262
|
}
|
|
1237
|
-
function
|
|
1263
|
+
function nr(e) {
|
|
1238
1264
|
if (!X(e)) return;
|
|
1239
1265
|
let t = e;
|
|
1240
1266
|
return {
|
|
1241
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1242
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1243
|
-
columnGap:
|
|
1244
|
-
rowGap:
|
|
1267
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(fr) : [],
|
|
1268
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(pr) : [],
|
|
1269
|
+
columnGap: mr(t.columnGap) ? t.columnGap : void 0,
|
|
1270
|
+
rowGap: mr(t.rowGap) ? t.rowGap : void 0
|
|
1245
1271
|
};
|
|
1246
1272
|
}
|
|
1247
|
-
function
|
|
1273
|
+
function rr(e, t) {
|
|
1248
1274
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1249
|
-
for (let e of t) !n.has(e.name) &&
|
|
1275
|
+
for (let e of t) !n.has(e.name) && pr(e.placement) && n.set(e.name, e.placement);
|
|
1250
1276
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1251
1277
|
}
|
|
1252
|
-
function
|
|
1278
|
+
function ir(e, t) {
|
|
1253
1279
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1254
1280
|
}
|
|
1255
|
-
function
|
|
1281
|
+
function ar(e, t) {
|
|
1256
1282
|
let n = t.find((t) => t.index === e), r = J(n?.width), i = J(n?.minWidth), a = J(n?.maxWidth);
|
|
1257
1283
|
return n?.width?.unit === p.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
|
|
1258
1284
|
}
|
|
1259
|
-
function
|
|
1285
|
+
function or(e) {
|
|
1260
1286
|
if (e) return {
|
|
1261
1287
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1262
1288
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
@@ -1271,40 +1297,40 @@ function J(e) {
|
|
|
1271
1297
|
case p.Auto: return "auto";
|
|
1272
1298
|
}
|
|
1273
1299
|
}
|
|
1274
|
-
function
|
|
1300
|
+
function sr(e, t) {
|
|
1275
1301
|
let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
|
|
1276
1302
|
return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
|
|
1277
1303
|
}
|
|
1278
|
-
function
|
|
1304
|
+
function cr(e, t, n, r) {
|
|
1279
1305
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1280
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1306
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? _n(a, r, i?.label ?? n) : void 0;
|
|
1281
1307
|
}
|
|
1282
|
-
function
|
|
1308
|
+
function lr(e, t) {
|
|
1283
1309
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1284
1310
|
return e.flatMap((e) => {
|
|
1285
1311
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1286
1312
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1287
1313
|
});
|
|
1288
1314
|
}
|
|
1289
|
-
function
|
|
1315
|
+
function ur(e, t) {
|
|
1290
1316
|
if (!e) return [];
|
|
1291
|
-
let n =
|
|
1317
|
+
let n = rr(e, t).filter((e) => e.width?.unit === p.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === p.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
|
|
1292
1318
|
return [...n, ...r];
|
|
1293
1319
|
}
|
|
1294
|
-
function
|
|
1295
|
-
return
|
|
1320
|
+
function dr(e) {
|
|
1321
|
+
return K(Y(e, "schema"));
|
|
1296
1322
|
}
|
|
1297
1323
|
function Y(e, t, n = "") {
|
|
1298
1324
|
let r = e.properties[t];
|
|
1299
1325
|
return typeof r == "string" ? r : n;
|
|
1300
1326
|
}
|
|
1301
|
-
function
|
|
1327
|
+
function fr(e) {
|
|
1302
1328
|
return X(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1303
1329
|
}
|
|
1304
|
-
function
|
|
1330
|
+
function pr(e) {
|
|
1305
1331
|
return X(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1306
1332
|
}
|
|
1307
|
-
function
|
|
1333
|
+
function mr(e) {
|
|
1308
1334
|
return X(e) && Object.values(p).includes(e.unit);
|
|
1309
1335
|
}
|
|
1310
1336
|
function X(e) {
|
|
@@ -1312,23 +1338,23 @@ function X(e) {
|
|
|
1312
1338
|
}
|
|
1313
1339
|
//#endregion
|
|
1314
1340
|
//#region src/StageGuardedAction.tsx
|
|
1315
|
-
function
|
|
1341
|
+
function hr(e) {
|
|
1316
1342
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1317
1343
|
}
|
|
1318
|
-
function
|
|
1344
|
+
function gr(e, t) {
|
|
1319
1345
|
let n = e.properties[t];
|
|
1320
1346
|
return typeof n == "string" ? n : "";
|
|
1321
1347
|
}
|
|
1322
|
-
function
|
|
1348
|
+
function _r(e) {
|
|
1323
1349
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1324
1350
|
}
|
|
1325
|
-
function
|
|
1326
|
-
let t =
|
|
1351
|
+
function vr(e) {
|
|
1352
|
+
let t = B(), n = gr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? gr(e, "itemRoute"), i = hr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1327
1353
|
for (let [e, n] of Object.entries(i)) {
|
|
1328
|
-
let r =
|
|
1354
|
+
let r = hr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1329
1355
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1330
1356
|
}
|
|
1331
|
-
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l =
|
|
1357
|
+
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = V({
|
|
1332
1358
|
scope: `${e.id}:item`,
|
|
1333
1359
|
name: n || void 0,
|
|
1334
1360
|
route: r || void 0,
|
|
@@ -1344,23 +1370,23 @@ function fr(e) {
|
|
|
1344
1370
|
item: l.rows.length === 1 ? l.rows[0] : void 0
|
|
1345
1371
|
};
|
|
1346
1372
|
}
|
|
1347
|
-
function
|
|
1373
|
+
function yr(e, t) {
|
|
1348
1374
|
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Mt(xt(n) ?? "", t)]));
|
|
1349
1375
|
}
|
|
1350
|
-
function
|
|
1351
|
-
let n =
|
|
1376
|
+
function br({ element: e, interactions: t }) {
|
|
1377
|
+
let n = B(), r = vr(e), i = an(), [a, o] = l([]), [c, u] = l(!1), d = gr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = hr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1352
1378
|
if (!kt(m) || !h || !r.hasSource) {
|
|
1353
1379
|
let n = r.hasSource ? `${St}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${St}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1354
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ L("div", {
|
|
1355
1381
|
className: "stage-guarded-action",
|
|
1356
1382
|
"data-scene-id": e.id,
|
|
1357
|
-
children: [/* @__PURE__ */
|
|
1383
|
+
children: [/* @__PURE__ */ I(R, {
|
|
1358
1384
|
type: "button",
|
|
1359
1385
|
disabled: !0,
|
|
1360
1386
|
title: n,
|
|
1361
1387
|
...t,
|
|
1362
1388
|
children: d
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1389
|
+
}), /* @__PURE__ */ I("p", {
|
|
1364
1390
|
role: "alert",
|
|
1365
1391
|
className: "stage-form-error",
|
|
1366
1392
|
children: n
|
|
@@ -1370,35 +1396,35 @@ function mr({ element: e, interactions: t }) {
|
|
|
1370
1396
|
if (!r.item) return null;
|
|
1371
1397
|
let g = At(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1372
1398
|
if (!_?.command) return null;
|
|
1373
|
-
let v = _.command, y =
|
|
1399
|
+
let v = _.command, y = W(v), b = r.item, x = async () => {
|
|
1374
1400
|
if (!y) return;
|
|
1375
1401
|
u(!0);
|
|
1376
|
-
let t = await i(v,
|
|
1402
|
+
let t = await i(v, yr(_, b));
|
|
1377
1403
|
if (u(!1), o(t.messages), !t.isSuccess) return;
|
|
1378
1404
|
n.refreshAfterCommand();
|
|
1379
|
-
let r =
|
|
1380
|
-
r &&
|
|
1405
|
+
let r = gr(e, "navigateToScreen"), a = gr(e, "navigateByParameter"), s = a ? Mt(`item.${a}`, b) : void 0;
|
|
1406
|
+
r && G(r, a && s != null ? { [a]: String(s) } : {});
|
|
1381
1407
|
};
|
|
1382
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ L("div", {
|
|
1383
1409
|
className: "stage-guarded-action",
|
|
1384
1410
|
"data-scene-id": e.id,
|
|
1385
1411
|
"data-command": v,
|
|
1386
|
-
children: [/* @__PURE__ */
|
|
1412
|
+
children: [/* @__PURE__ */ I(R, {
|
|
1387
1413
|
...t,
|
|
1388
1414
|
type: "button",
|
|
1389
1415
|
disabled: !y || c,
|
|
1390
1416
|
title: y ? void 0 : "This command is not exposed as an API yet",
|
|
1391
1417
|
onClick: () => void x(),
|
|
1392
1418
|
children: d
|
|
1393
|
-
}), a.map((e) => /* @__PURE__ */
|
|
1419
|
+
}), a.map((e) => /* @__PURE__ */ I("p", {
|
|
1394
1420
|
role: "alert",
|
|
1395
1421
|
className: "stage-form-error",
|
|
1396
1422
|
children: e
|
|
1397
1423
|
}, e))]
|
|
1398
1424
|
});
|
|
1399
1425
|
}
|
|
1400
|
-
function
|
|
1401
|
-
let t =
|
|
1426
|
+
function xr(e) {
|
|
1427
|
+
let t = pe(), n = c(void 0), i = s(() => C(ce(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
|
|
1402
1428
|
a(() => () => clearTimeout(n.current), []);
|
|
1403
1429
|
let o = r((e) => {
|
|
1404
1430
|
if (clearTimeout(n.current), n.current = void 0, !t) return;
|
|
@@ -1425,12 +1451,12 @@ function hr(e) {
|
|
|
1425
1451
|
}
|
|
1426
1452
|
//#endregion
|
|
1427
1453
|
//#region src/stageDialogScreens.ts
|
|
1428
|
-
var
|
|
1429
|
-
function
|
|
1454
|
+
var Sr = "Stage:confirmDialog", Cr = "ConfirmDialog";
|
|
1455
|
+
function wr(e, t) {
|
|
1430
1456
|
let n = new Set(t.map((e) => e.name));
|
|
1431
1457
|
return e.map((t) => {
|
|
1432
|
-
if (t.screenTemplate !==
|
|
1433
|
-
let r =
|
|
1458
|
+
if (t.screenTemplate !== Cr || n.has(Cr)) return t;
|
|
1459
|
+
let r = Tr(t), i = e.find((e) => e.name !== t.name)?.name, a = F(`confirm-dialog-${t.name}`, Sr, {
|
|
1434
1460
|
title: t.name,
|
|
1435
1461
|
decisions: r,
|
|
1436
1462
|
home: i
|
|
@@ -1443,100 +1469,100 @@ function vr(e, t) {
|
|
|
1443
1469
|
};
|
|
1444
1470
|
});
|
|
1445
1471
|
}
|
|
1446
|
-
function
|
|
1472
|
+
function Tr(e) {
|
|
1447
1473
|
let t = [];
|
|
1448
|
-
for (let n of
|
|
1449
|
-
let r =
|
|
1474
|
+
for (let n of Er(Object.values(e.slotContent).flat())) {
|
|
1475
|
+
let r = Dr(n.properties.command);
|
|
1450
1476
|
r && !t.some((e) => e.command === r) && t.push({
|
|
1451
1477
|
command: r,
|
|
1452
|
-
label:
|
|
1453
|
-
navigateToScreen:
|
|
1454
|
-
typeName:
|
|
1455
|
-
route:
|
|
1478
|
+
label: Dr(n.properties.label),
|
|
1479
|
+
navigateToScreen: Dr(n.properties.navigateToScreen),
|
|
1480
|
+
typeName: Dr(n.properties.typeName),
|
|
1481
|
+
route: Dr(n.properties.route),
|
|
1456
1482
|
form: e.forms.find((e) => e.forCommand === r)
|
|
1457
1483
|
});
|
|
1458
1484
|
}
|
|
1459
1485
|
return t;
|
|
1460
1486
|
}
|
|
1461
|
-
function
|
|
1487
|
+
function Er(e) {
|
|
1462
1488
|
return e.flatMap((e) => {
|
|
1463
1489
|
let t = e;
|
|
1464
|
-
return t.componentName === "core:action" ? [t] :
|
|
1490
|
+
return t.componentName === "core:action" ? [t] : Er(Object.values(t.slots ?? {}).flat());
|
|
1465
1491
|
});
|
|
1466
1492
|
}
|
|
1467
|
-
function
|
|
1493
|
+
function Dr(e) {
|
|
1468
1494
|
return typeof e == "string" && e !== "" ? e : void 0;
|
|
1469
1495
|
}
|
|
1470
1496
|
//#endregion
|
|
1471
1497
|
//#region src/StageConfirmDialog.tsx
|
|
1472
|
-
function
|
|
1473
|
-
let { routes: t, parameters: n, queries: r, selections: i } =
|
|
1474
|
-
return a(() => u.current?.focus(), []), /* @__PURE__ */
|
|
1498
|
+
function Or({ element: e }) {
|
|
1499
|
+
let { routes: t, parameters: n, queries: r, selections: i } = B(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = Jn(i, r);
|
|
1500
|
+
return a(() => u.current?.focus(), []), /* @__PURE__ */ L("section", {
|
|
1475
1501
|
className: "scene-slice-dialog stage-confirm-dialog",
|
|
1476
1502
|
role: "dialog",
|
|
1477
|
-
"aria-label":
|
|
1478
|
-
"data-stage-component":
|
|
1503
|
+
"aria-label": q(d),
|
|
1504
|
+
"data-stage-component": Sr,
|
|
1479
1505
|
children: [
|
|
1480
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ I("header", {
|
|
1481
1507
|
className: "scene-slice-dialog-header",
|
|
1482
|
-
children: /* @__PURE__ */
|
|
1508
|
+
children: /* @__PURE__ */ I("h2", {
|
|
1483
1509
|
className: "scene-slice-dialog-title",
|
|
1484
|
-
children:
|
|
1510
|
+
children: q(d)
|
|
1485
1511
|
})
|
|
1486
1512
|
}),
|
|
1487
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ I("div", {
|
|
1488
1514
|
className: "stage-confirm-dialog__decisions",
|
|
1489
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
1515
|
+
children: f.map((e, t) => /* @__PURE__ */ I("button", {
|
|
1490
1516
|
ref: t === 0 ? u : void 0,
|
|
1491
1517
|
type: "button",
|
|
1492
1518
|
className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
|
|
1493
1519
|
"data-emphasis": t === 0 ? "primary" : "secondary",
|
|
1494
1520
|
"aria-pressed": e.command === o,
|
|
1495
1521
|
onClick: () => s(e.command),
|
|
1496
|
-
children:
|
|
1522
|
+
children: Ar(e)
|
|
1497
1523
|
}, e.command))
|
|
1498
1524
|
}),
|
|
1499
|
-
m && /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1525
|
+
m && /* @__PURE__ */ I(jn, { element: Nr(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command),
|
|
1526
|
+
/* @__PURE__ */ I("footer", {
|
|
1501
1527
|
className: "scene-slice-dialog-footer",
|
|
1502
|
-
children: /* @__PURE__ */
|
|
1528
|
+
children: /* @__PURE__ */ I("button", {
|
|
1503
1529
|
type: "button",
|
|
1504
1530
|
className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
|
|
1505
|
-
onClick: () =>
|
|
1531
|
+
onClick: () => kr(f, p),
|
|
1506
1532
|
children: "Cancel"
|
|
1507
1533
|
})
|
|
1508
1534
|
})
|
|
1509
1535
|
]
|
|
1510
1536
|
});
|
|
1511
1537
|
}
|
|
1512
|
-
function
|
|
1538
|
+
function kr(e, t) {
|
|
1513
1539
|
let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
|
|
1514
|
-
r &&
|
|
1540
|
+
r && G(r, {});
|
|
1515
1541
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return e.label ??
|
|
1542
|
+
function Ar(e) {
|
|
1543
|
+
return e.label ?? q(e.command);
|
|
1518
1544
|
}
|
|
1519
|
-
function
|
|
1520
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] ||
|
|
1545
|
+
function jr(e, t, n) {
|
|
1546
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Un(e, n) !== void 0;
|
|
1521
1547
|
}
|
|
1522
|
-
function
|
|
1548
|
+
function Mr(e, t, n, r) {
|
|
1523
1549
|
let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1524
1550
|
name: e.name,
|
|
1525
1551
|
label: e.name
|
|
1526
|
-
})), o = new Set(t.filter((e) =>
|
|
1552
|
+
})), o = new Set(t.filter((e) => jr(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
|
|
1527
1553
|
return [...s, ...l.map((e) => ({
|
|
1528
1554
|
name: e.name,
|
|
1529
|
-
label:
|
|
1555
|
+
label: q(e.name)
|
|
1530
1556
|
}))];
|
|
1531
1557
|
}
|
|
1532
|
-
function
|
|
1533
|
-
let i =
|
|
1558
|
+
function Nr(e, t, n, r) {
|
|
1559
|
+
let i = Mr(e, K(t), n, r);
|
|
1534
1560
|
return {
|
|
1535
1561
|
id: `confirm-${e.command}`,
|
|
1536
|
-
componentName:
|
|
1562
|
+
componentName: Sr,
|
|
1537
1563
|
properties: {
|
|
1538
1564
|
command: e.command,
|
|
1539
|
-
label:
|
|
1565
|
+
label: Ar(e),
|
|
1540
1566
|
submitLabel: "Confirm",
|
|
1541
1567
|
typeName: e.typeName,
|
|
1542
1568
|
route: e.route,
|
|
@@ -1552,8 +1578,8 @@ function Dr(e, t, n, r) {
|
|
|
1552
1578
|
}
|
|
1553
1579
|
//#endregion
|
|
1554
1580
|
//#region src/stageComponents.tsx
|
|
1555
|
-
var
|
|
1556
|
-
function
|
|
1581
|
+
var Pr = "Stage:commandForm";
|
|
1582
|
+
function Fr(e, t, n = {}) {
|
|
1557
1583
|
return {
|
|
1558
1584
|
id: e,
|
|
1559
1585
|
componentName: "",
|
|
@@ -1565,19 +1591,19 @@ function Z(e, t, n = "") {
|
|
|
1565
1591
|
let r = e.properties[t];
|
|
1566
1592
|
return typeof r == "string" ? r : n;
|
|
1567
1593
|
}
|
|
1568
|
-
function
|
|
1594
|
+
function Ir(e, t, n) {
|
|
1569
1595
|
let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
|
|
1570
|
-
return typeof r == "string" && t?.includes(r) ?
|
|
1596
|
+
return typeof r == "string" && t?.includes(r) ? q(r) : String(e ?? "");
|
|
1571
1597
|
}
|
|
1572
|
-
function
|
|
1598
|
+
function Lr(e, t) {
|
|
1573
1599
|
let n = e.properties.queryArguments;
|
|
1574
|
-
if (!
|
|
1600
|
+
if (!Vr(n)) return {
|
|
1575
1601
|
values: {},
|
|
1576
1602
|
ready: !0
|
|
1577
1603
|
};
|
|
1578
1604
|
let r = {}, i = !0;
|
|
1579
1605
|
for (let [e, a] of Object.entries(n)) {
|
|
1580
|
-
let n =
|
|
1606
|
+
let n = Br(a) ? t.resolveBinding(a) : a;
|
|
1581
1607
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1582
1608
|
}
|
|
1583
1609
|
return {
|
|
@@ -1585,7 +1611,7 @@ function jr(e, t) {
|
|
|
1585
1611
|
ready: i
|
|
1586
1612
|
};
|
|
1587
1613
|
}
|
|
1588
|
-
function
|
|
1614
|
+
function Rr(e, t) {
|
|
1589
1615
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1590
1616
|
let t = e.properties;
|
|
1591
1617
|
return {
|
|
@@ -1603,14 +1629,14 @@ function Mr(e, t) {
|
|
|
1603
1629
|
function Q(e, t) {
|
|
1604
1630
|
return e[t] ?? e.id ?? e.key;
|
|
1605
1631
|
}
|
|
1606
|
-
function
|
|
1607
|
-
let n =
|
|
1632
|
+
function zr({ element: e, slots: t }) {
|
|
1633
|
+
let n = B(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() => Lr(e, n), [n, e]), { rows: c, error: l, loading: u } = V({
|
|
1608
1634
|
scope: e.id,
|
|
1609
1635
|
name: r,
|
|
1610
1636
|
route: i || void 0,
|
|
1611
1637
|
arguments: o.values,
|
|
1612
1638
|
ready: o.ready
|
|
1613
|
-
}), d =
|
|
1639
|
+
}), d = Rr(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = xr(e);
|
|
1614
1640
|
a(() => {
|
|
1615
1641
|
if (!h) return;
|
|
1616
1642
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1651,15 +1677,15 @@ function Nr({ element: e, slots: t }) {
|
|
|
1651
1677
|
...f && f !== n.screen ? {} : n.parameters,
|
|
1652
1678
|
[p]: String(r)
|
|
1653
1679
|
};
|
|
1654
|
-
(!f || f === n.screen) && n.selectRow(e.id, t),
|
|
1680
|
+
(!f || f === n.screen) && n.selectRow(e.id, t), G(f || n.screen, i);
|
|
1655
1681
|
return;
|
|
1656
1682
|
}
|
|
1657
1683
|
n.selectRow(e.id, t);
|
|
1658
1684
|
};
|
|
1659
|
-
return !Z(e, "query") && !i && !gt(r) ? /* @__PURE__ */
|
|
1685
|
+
return !Z(e, "query") && !i && !gt(r) ? /* @__PURE__ */ L("section", {
|
|
1660
1686
|
className: "stage-table",
|
|
1661
1687
|
"data-scene-id": e.id,
|
|
1662
|
-
children: [/* @__PURE__ */
|
|
1688
|
+
children: [/* @__PURE__ */ L("p", {
|
|
1663
1689
|
className: "stage-note",
|
|
1664
1690
|
children: [
|
|
1665
1691
|
"No query is exposed for ",
|
|
@@ -1667,34 +1693,34 @@ function Nr({ element: e, slots: t }) {
|
|
|
1667
1693
|
" yet."
|
|
1668
1694
|
]
|
|
1669
1695
|
}), t.columns]
|
|
1670
|
-
}) : /* @__PURE__ */
|
|
1696
|
+
}) : /* @__PURE__ */ L("section", {
|
|
1671
1697
|
className: "stage-table",
|
|
1672
1698
|
"data-scene-id": e.id,
|
|
1673
1699
|
children: [
|
|
1674
|
-
u && /* @__PURE__ */
|
|
1700
|
+
u && /* @__PURE__ */ I(Be, {
|
|
1675
1701
|
severity: "info",
|
|
1676
1702
|
text: "Loading…"
|
|
1677
1703
|
}),
|
|
1678
|
-
l && /* @__PURE__ */
|
|
1704
|
+
l && /* @__PURE__ */ I(Be, {
|
|
1679
1705
|
severity: "error",
|
|
1680
1706
|
text: l
|
|
1681
1707
|
}),
|
|
1682
|
-
h && /* @__PURE__ */
|
|
1708
|
+
h && /* @__PURE__ */ I(R, {
|
|
1683
1709
|
type: "button",
|
|
1684
1710
|
size: "small",
|
|
1685
1711
|
onClick: () => {
|
|
1686
1712
|
if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
|
|
1687
1713
|
let { [p]: t, ...r } = n.parameters;
|
|
1688
|
-
|
|
1714
|
+
G(n.screen, r);
|
|
1689
1715
|
},
|
|
1690
1716
|
children: "Clear selection"
|
|
1691
1717
|
}),
|
|
1692
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ L("table", {
|
|
1693
1719
|
"aria-label": Z(e, "label", Z(e, "typeName", "Results")),
|
|
1694
|
-
children: [/* @__PURE__ */
|
|
1720
|
+
children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ I("tr", { children: d.map((e) => /* @__PURE__ */ I("th", {
|
|
1695
1721
|
scope: "col",
|
|
1696
1722
|
children: e.label
|
|
1697
|
-
}, e.property)) }) }), /* @__PURE__ */
|
|
1723
|
+
}, e.property)) }) }), /* @__PURE__ */ L("tbody", { children: [c.map((e, t) => /* @__PURE__ */ I("tr", {
|
|
1698
1724
|
"aria-selected": h === e,
|
|
1699
1725
|
tabIndex: 0,
|
|
1700
1726
|
onClick: () => _.click(e, () => v(e)),
|
|
@@ -1702,8 +1728,8 @@ function Nr({ element: e, slots: t }) {
|
|
|
1702
1728
|
onKeyDown: (t) => {
|
|
1703
1729
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
|
|
1704
1730
|
},
|
|
1705
|
-
children: d.map((t) => /* @__PURE__ */
|
|
1706
|
-
}, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */
|
|
1731
|
+
children: d.map((t) => /* @__PURE__ */ I("td", { children: Ir(e[t.property], t.options, t.optionValues) }, t.property))
|
|
1732
|
+
}, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ I("tr", { children: /* @__PURE__ */ I("td", {
|
|
1707
1733
|
colSpan: Math.max(d.length, 1),
|
|
1708
1734
|
children: "No records found"
|
|
1709
1735
|
}) })] })]
|
|
@@ -1711,28 +1737,28 @@ function Nr({ element: e, slots: t }) {
|
|
|
1711
1737
|
]
|
|
1712
1738
|
});
|
|
1713
1739
|
}
|
|
1714
|
-
function
|
|
1715
|
-
return
|
|
1740
|
+
function Br(e) {
|
|
1741
|
+
return Vr(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1716
1742
|
}
|
|
1717
|
-
function
|
|
1743
|
+
function Vr(e) {
|
|
1718
1744
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1719
1745
|
}
|
|
1720
|
-
function
|
|
1721
|
-
return
|
|
1746
|
+
function Hr({ element: e, interactions: t, slots: n }) {
|
|
1747
|
+
return _r(e) ? /* @__PURE__ */ I(br, {
|
|
1722
1748
|
element: e,
|
|
1723
1749
|
interactions: t
|
|
1724
|
-
}) : /* @__PURE__ */
|
|
1750
|
+
}) : /* @__PURE__ */ I(Ur, {
|
|
1725
1751
|
element: e,
|
|
1726
1752
|
interactions: t,
|
|
1727
1753
|
slots: n
|
|
1728
1754
|
});
|
|
1729
1755
|
}
|
|
1730
|
-
function
|
|
1756
|
+
function Ur({ element: e, interactions: t }) {
|
|
1731
1757
|
let n = Z(e, "label", Z(e, "command"));
|
|
1732
|
-
return
|
|
1758
|
+
return W(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ I(Wr, {
|
|
1733
1759
|
element: e,
|
|
1734
1760
|
label: n
|
|
1735
|
-
}) : /* @__PURE__ */
|
|
1761
|
+
}) : /* @__PURE__ */ I(R, {
|
|
1736
1762
|
type: "button",
|
|
1737
1763
|
"data-scene-id": e.id,
|
|
1738
1764
|
disabled: !0,
|
|
@@ -1741,21 +1767,21 @@ function Lr({ element: e, interactions: t }) {
|
|
|
1741
1767
|
children: n
|
|
1742
1768
|
});
|
|
1743
1769
|
}
|
|
1744
|
-
function
|
|
1770
|
+
function Wr({ element: e, label: t }) {
|
|
1745
1771
|
let [n, i] = l(0), [a, o] = l(!1), s = r(() => {
|
|
1746
1772
|
o(!1), i((e) => e + 1);
|
|
1747
|
-
}, []), c = /* @__PURE__ */
|
|
1773
|
+
}, []), c = /* @__PURE__ */ I(kn.Provider, {
|
|
1748
1774
|
value: s,
|
|
1749
|
-
children: /* @__PURE__ */
|
|
1775
|
+
children: /* @__PURE__ */ I(jn, { element: e }, n)
|
|
1750
1776
|
});
|
|
1751
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ L("div", {
|
|
1752
1778
|
className: "stage-action",
|
|
1753
1779
|
"data-scene-id": e.id,
|
|
1754
|
-
children: [/* @__PURE__ */
|
|
1780
|
+
children: [/* @__PURE__ */ I(R, {
|
|
1755
1781
|
type: "button",
|
|
1756
1782
|
onClick: () => o(!0),
|
|
1757
1783
|
children: t
|
|
1758
|
-
}), /* @__PURE__ */
|
|
1784
|
+
}), /* @__PURE__ */ I(ze, {
|
|
1759
1785
|
title: t,
|
|
1760
1786
|
visible: a,
|
|
1761
1787
|
onClose: () => o(!1),
|
|
@@ -1765,62 +1791,66 @@ function Rr({ element: e, label: t }) {
|
|
|
1765
1791
|
})]
|
|
1766
1792
|
});
|
|
1767
1793
|
}
|
|
1768
|
-
function
|
|
1769
|
-
let t = e.element ??
|
|
1770
|
-
if (!
|
|
1794
|
+
function Gr(e) {
|
|
1795
|
+
let t = e.element ?? Fr("slice-dialog", {}), n = me(), { routes: i, parameters: a, queries: o, selections: c } = B(), u = fe(n?.currentDialogParameters), d = Z(t, "command") || u?.command || Z(t, "slice") || "", f = Z(t, "title") || u?.title || d, p = i?.commandSchemas?.[d], m = s(() => K(p ?? ""), [p]), h = s(() => qn(o), [o]), g = s(() => Jn(c, o), [c, o]), _ = r(() => n?.closeDialog(), [n]), [v, y] = l(null), b = (e) => e.identifier && e.required && Wn(e, h) && Un(e, g) !== void 0;
|
|
1796
|
+
if (!p || !(m.some((e) => e.options || e.members || e.item) || m.some(b))) return e.element ? /* @__PURE__ */ I(T, {
|
|
1771
1797
|
element: e.element,
|
|
1772
1798
|
slots: e.slots ?? {}
|
|
1773
|
-
}) : /* @__PURE__ */
|
|
1774
|
-
let
|
|
1775
|
-
command:
|
|
1776
|
-
label:
|
|
1777
|
-
schema:
|
|
1778
|
-
fields:
|
|
1799
|
+
}) : /* @__PURE__ */ I(oe, {});
|
|
1800
|
+
let x = m.filter((e) => !Vn(e, a) && !b(e)), S = Fr(`slice-dialog-${d}`, {
|
|
1801
|
+
command: d,
|
|
1802
|
+
label: f,
|
|
1803
|
+
schema: p,
|
|
1804
|
+
fields: x.map((e) => ({
|
|
1779
1805
|
name: e.name,
|
|
1780
|
-
label:
|
|
1806
|
+
label: q(e.name)
|
|
1781
1807
|
})),
|
|
1782
1808
|
generationMode: "manual"
|
|
1783
1809
|
});
|
|
1784
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ L("section", {
|
|
1785
1811
|
className: "scene-slice-dialog",
|
|
1786
|
-
"data-scene-slice-dialog": Z(t, "slice") ||
|
|
1787
|
-
"data-scene-command":
|
|
1812
|
+
"data-scene-slice-dialog": Z(t, "slice") || u?.slice,
|
|
1813
|
+
"data-scene-command": d,
|
|
1788
1814
|
children: [
|
|
1789
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ I("header", {
|
|
1790
1816
|
className: "scene-slice-dialog-header",
|
|
1791
|
-
children: /* @__PURE__ */
|
|
1817
|
+
children: /* @__PURE__ */ I("h2", {
|
|
1792
1818
|
className: "scene-slice-dialog-title",
|
|
1793
|
-
children:
|
|
1819
|
+
children: f
|
|
1794
1820
|
})
|
|
1795
1821
|
}),
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
value:
|
|
1798
|
-
children: /* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ I(kn.Provider, {
|
|
1823
|
+
value: _,
|
|
1824
|
+
children: /* @__PURE__ */ I(An.Provider, {
|
|
1825
|
+
value: v,
|
|
1826
|
+
children: /* @__PURE__ */ I(jn, { element: S })
|
|
1827
|
+
})
|
|
1799
1828
|
}),
|
|
1800
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ I("footer", {
|
|
1830
|
+
ref: y,
|
|
1801
1831
|
className: "scene-slice-dialog-footer",
|
|
1802
|
-
children: /* @__PURE__ */
|
|
1832
|
+
children: /* @__PURE__ */ I("button", {
|
|
1803
1833
|
type: "button",
|
|
1804
1834
|
className: "scene-slice-dialog-cancel",
|
|
1805
|
-
onClick:
|
|
1835
|
+
onClick: _,
|
|
1806
1836
|
children: "Cancel"
|
|
1807
1837
|
})
|
|
1808
1838
|
})
|
|
1809
1839
|
]
|
|
1810
1840
|
});
|
|
1811
1841
|
}
|
|
1812
|
-
function
|
|
1842
|
+
function Kr(e) {
|
|
1813
1843
|
let { element: t } = e;
|
|
1814
|
-
return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */
|
|
1844
|
+
return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ I(Jr, { ...e }) : /* @__PURE__ */ I(E, { ...e }) : /* @__PURE__ */ I(qr, { ...e });
|
|
1815
1845
|
}
|
|
1816
|
-
function
|
|
1817
|
-
let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } =
|
|
1818
|
-
if (
|
|
1846
|
+
function qr(e) {
|
|
1847
|
+
let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } = B(), o = Z(t, "slice"), c = Z(t, "command") || o.split(".").at(-1) || "", l = n?.commandSchemas?.[c], u = s(() => K(l ?? ""), [l]), d = s(() => qn(i), [i]);
|
|
1848
|
+
if (Yn(u, r, s(() => Jn(a, i), [a, i]), d).length === 0) return /* @__PURE__ */ I(E, { ...e });
|
|
1819
1849
|
let f = Z(t, "label", Z(t, "name", t.id));
|
|
1820
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ I("span", {
|
|
1821
1851
|
className: "stage-toolbar-action",
|
|
1822
1852
|
"data-scene-toolbar-item": Z(t, "name", t.id),
|
|
1823
|
-
children: /* @__PURE__ */
|
|
1853
|
+
children: /* @__PURE__ */ I(R, {
|
|
1824
1854
|
type: "button",
|
|
1825
1855
|
"data-scene-id": t.id,
|
|
1826
1856
|
disabled: !0,
|
|
@@ -1830,12 +1860,12 @@ function Vr(e) {
|
|
|
1830
1860
|
})
|
|
1831
1861
|
});
|
|
1832
1862
|
}
|
|
1833
|
-
function
|
|
1834
|
-
let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } =
|
|
1863
|
+
function Jr(e) {
|
|
1864
|
+
let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } = B(), o = Z(t, "name", t.id), c = Z(t, "target"), l = Z(t, "label", o), u = n?.commandSchemas?.[c], d = s(() => K(u ?? ""), [u]), f = s(() => qn(i), [i]), p = Yn(d, r, s(() => Jn(a, i), [a, i]), f), m = d.filter((e) => !Vn(e, r) && !(e.identifier && e.required && Wn(e, f))), h = u ? {
|
|
1835
1865
|
schema: u,
|
|
1836
1866
|
fields: m.map((e) => ({
|
|
1837
1867
|
name: e.name,
|
|
1838
|
-
label:
|
|
1868
|
+
label: q(e.name)
|
|
1839
1869
|
})),
|
|
1840
1870
|
generationMode: "manual"
|
|
1841
1871
|
} : {}, g = {
|
|
@@ -1848,36 +1878,36 @@ function Hr(e) {
|
|
|
1848
1878
|
...h
|
|
1849
1879
|
}
|
|
1850
1880
|
};
|
|
1851
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ I("span", {
|
|
1852
1882
|
className: "stage-toolbar-action",
|
|
1853
1883
|
"data-scene-toolbar-item": o,
|
|
1854
|
-
children: p.length > 0 ? /* @__PURE__ */
|
|
1884
|
+
children: p.length > 0 ? /* @__PURE__ */ I(R, {
|
|
1855
1885
|
type: "button",
|
|
1856
1886
|
"data-scene-id": t.id,
|
|
1857
1887
|
disabled: !0,
|
|
1858
1888
|
title: "Select a row first",
|
|
1859
1889
|
...e.interactions,
|
|
1860
1890
|
children: l
|
|
1861
|
-
}) : /* @__PURE__ */
|
|
1891
|
+
}) : /* @__PURE__ */ I(Hr, {
|
|
1862
1892
|
element: g,
|
|
1863
1893
|
interactions: e.interactions,
|
|
1864
1894
|
slots: e.slots
|
|
1865
1895
|
})
|
|
1866
1896
|
});
|
|
1867
1897
|
}
|
|
1868
|
-
var
|
|
1869
|
-
...
|
|
1870
|
-
"core:table":
|
|
1871
|
-
"core:action":
|
|
1872
|
-
"core:toolbarItem":
|
|
1873
|
-
"core:sliceDialog":
|
|
1874
|
-
[
|
|
1875
|
-
[
|
|
1898
|
+
var Yr = {
|
|
1899
|
+
...le,
|
|
1900
|
+
"core:table": zr,
|
|
1901
|
+
"core:action": Hr,
|
|
1902
|
+
"core:toolbarItem": Kr,
|
|
1903
|
+
"core:sliceDialog": Gr,
|
|
1904
|
+
[Pr]: jn,
|
|
1905
|
+
[Sr]: Or
|
|
1876
1906
|
};
|
|
1877
1907
|
//#endregion
|
|
1878
1908
|
//#region src/useStrings.ts
|
|
1879
|
-
function
|
|
1880
|
-
let e =
|
|
1909
|
+
function Xr() {
|
|
1910
|
+
let e = ot(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
|
|
1881
1911
|
return a(() => {
|
|
1882
1912
|
let t = new AbortController();
|
|
1883
1913
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1898,11 +1928,11 @@ function Wr() {
|
|
|
1898
1928
|
dictionary: o
|
|
1899
1929
|
};
|
|
1900
1930
|
}
|
|
1901
|
-
var
|
|
1902
|
-
function
|
|
1903
|
-
return
|
|
1931
|
+
var Zr = /* @__PURE__ */ new Set(["core:table"]);
|
|
1932
|
+
function Qr(e) {
|
|
1933
|
+
return $r(e, /* @__PURE__ */ new Map(), void 0);
|
|
1904
1934
|
}
|
|
1905
|
-
function
|
|
1935
|
+
function $r(e, t, n) {
|
|
1906
1936
|
let r = e;
|
|
1907
1937
|
if (!r.slots) return e;
|
|
1908
1938
|
let i = !1, a = {};
|
|
@@ -1911,7 +1941,7 @@ function qr(e, t, n) {
|
|
|
1911
1941
|
a[e] = o.map((e) => {
|
|
1912
1942
|
let t = e, n = $(t, "typeName");
|
|
1913
1943
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1914
|
-
let a =
|
|
1944
|
+
let a = $r(ti(ei(t, r), s), r, s);
|
|
1915
1945
|
return a !== e && (i = !0), a;
|
|
1916
1946
|
});
|
|
1917
1947
|
}
|
|
@@ -1920,8 +1950,8 @@ function qr(e, t, n) {
|
|
|
1920
1950
|
slots: a
|
|
1921
1951
|
} : e;
|
|
1922
1952
|
}
|
|
1923
|
-
function
|
|
1924
|
-
if (!
|
|
1953
|
+
function ei(e, t) {
|
|
1954
|
+
if (!Zr.has(e.componentName)) return e;
|
|
1925
1955
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1926
1956
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1927
1957
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -1930,7 +1960,7 @@ function Jr(e, t) {
|
|
|
1930
1960
|
properties: a
|
|
1931
1961
|
};
|
|
1932
1962
|
}
|
|
1933
|
-
function
|
|
1963
|
+
function ti(e, t) {
|
|
1934
1964
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
|
|
1935
1965
|
let n = { ...e.properties };
|
|
1936
1966
|
if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
|
|
@@ -1949,7 +1979,7 @@ function $(e, t) {
|
|
|
1949
1979
|
}
|
|
1950
1980
|
//#endregion
|
|
1951
1981
|
//#region src/stageQueryBindings.tsx
|
|
1952
|
-
function
|
|
1982
|
+
function ni(e) {
|
|
1953
1983
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1954
1984
|
if (Array.isArray(e)) {
|
|
1955
1985
|
e.forEach(n);
|
|
@@ -1969,7 +1999,7 @@ function Xr(e) {
|
|
|
1969
1999
|
};
|
|
1970
2000
|
return r(e), [...t];
|
|
1971
2001
|
}
|
|
1972
|
-
function
|
|
2002
|
+
function ri(e) {
|
|
1973
2003
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
1974
2004
|
let n = e.properties?.[t];
|
|
1975
2005
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -1988,8 +2018,8 @@ function Zr(e) {
|
|
|
1988
2018
|
};
|
|
1989
2019
|
return r(e), [...t.values()];
|
|
1990
2020
|
}
|
|
1991
|
-
function
|
|
1992
|
-
let { routes: t, routesReady: n, parameters: r, session: i } =
|
|
2021
|
+
function ii({ source: e }) {
|
|
2022
|
+
let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
|
|
1993
2023
|
...i,
|
|
1994
2024
|
...r
|
|
1995
2025
|
}, [
|
|
@@ -1998,7 +2028,7 @@ function Qr({ source: e }) {
|
|
|
1998
2028
|
i,
|
|
1999
2029
|
e.by
|
|
2000
2030
|
]);
|
|
2001
|
-
return
|
|
2031
|
+
return V({
|
|
2002
2032
|
scope: `data:${e.typeName}`,
|
|
2003
2033
|
name: e.query,
|
|
2004
2034
|
alias: e.typeName,
|
|
@@ -2008,12 +2038,12 @@ function Qr({ source: e }) {
|
|
|
2008
2038
|
list: !0
|
|
2009
2039
|
}), null;
|
|
2010
2040
|
}
|
|
2011
|
-
function
|
|
2012
|
-
let { routes: t, routesReady: n, parameters: r, session: i } =
|
|
2041
|
+
function ai({ name: e }) {
|
|
2042
|
+
let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = s(() => ({
|
|
2013
2043
|
...i,
|
|
2014
2044
|
...r
|
|
2015
2045
|
}), [r, i]);
|
|
2016
|
-
return
|
|
2046
|
+
return V({
|
|
2017
2047
|
scope: `binding:${e}`,
|
|
2018
2048
|
name: e,
|
|
2019
2049
|
route: t?.queries?.[e],
|
|
@@ -2022,11 +2052,11 @@ function $r({ name: e }) {
|
|
|
2022
2052
|
list: !0
|
|
2023
2053
|
}), null;
|
|
2024
2054
|
}
|
|
2025
|
-
function
|
|
2026
|
-
let t = s(() =>
|
|
2027
|
-
return /* @__PURE__ */
|
|
2055
|
+
function oi({ element: e }) {
|
|
2056
|
+
let t = s(() => ni(e), [e]), n = s(() => ri(e), [e]);
|
|
2057
|
+
return /* @__PURE__ */ L(Re, { children: [t.map((e) => /* @__PURE__ */ I(ai, { name: e }, e)), n.map((e) => /* @__PURE__ */ I(ii, { source: e }, e.typeName))] });
|
|
2028
2058
|
}
|
|
2029
|
-
function
|
|
2059
|
+
function si(e) {
|
|
2030
2060
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2031
2061
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
2032
2062
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -2039,7 +2069,7 @@ function ti(e) {
|
|
|
2039
2069
|
]);
|
|
2040
2070
|
if (t.has(s)) continue;
|
|
2041
2071
|
t.add(s);
|
|
2042
|
-
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l =
|
|
2072
|
+
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = ui(r.destination) ? r.destination : void 0;
|
|
2043
2073
|
n.push({
|
|
2044
2074
|
label: i,
|
|
2045
2075
|
targetScreen: a,
|
|
@@ -2047,7 +2077,7 @@ function ti(e) {
|
|
|
2047
2077
|
order: c,
|
|
2048
2078
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
2049
2079
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
2050
|
-
...l &&
|
|
2080
|
+
...l && di(l) ? { destination: l } : {}
|
|
2051
2081
|
});
|
|
2052
2082
|
}
|
|
2053
2083
|
return n.map((e, t) => ({
|
|
@@ -2055,7 +2085,7 @@ function ti(e) {
|
|
|
2055
2085
|
index: t
|
|
2056
2086
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
2057
2087
|
}
|
|
2058
|
-
function
|
|
2088
|
+
function ci(e) {
|
|
2059
2089
|
let t = {
|
|
2060
2090
|
label: "",
|
|
2061
2091
|
children: []
|
|
@@ -2080,21 +2110,21 @@ function ni(e) {
|
|
|
2080
2110
|
}
|
|
2081
2111
|
return t.children;
|
|
2082
2112
|
}
|
|
2083
|
-
function
|
|
2113
|
+
function li(e, t) {
|
|
2084
2114
|
for (let n of e) {
|
|
2085
2115
|
if (n.screen === t) return [n.label];
|
|
2086
|
-
let e =
|
|
2116
|
+
let e = li(n.children, t);
|
|
2087
2117
|
if (e.length > 0) return [n.label, ...e];
|
|
2088
2118
|
}
|
|
2089
2119
|
return [];
|
|
2090
2120
|
}
|
|
2091
|
-
function
|
|
2121
|
+
function ui(e) {
|
|
2092
2122
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2093
2123
|
}
|
|
2094
|
-
function
|
|
2124
|
+
function di(e) {
|
|
2095
2125
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
2096
2126
|
}
|
|
2097
|
-
function
|
|
2127
|
+
function fi(e, t, n) {
|
|
2098
2128
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
2099
2129
|
label: e.name,
|
|
2100
2130
|
targetScreen: e.name,
|
|
@@ -2103,54 +2133,54 @@ function oi(e, t, n) {
|
|
|
2103
2133
|
}
|
|
2104
2134
|
//#endregion
|
|
2105
2135
|
//#region src/blueprint.ts
|
|
2106
|
-
var
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2136
|
+
var pi = "Stage:locale", mi = "Stage:themeToggle", hi = "Cratis.Components", gi = "PrimeReact", _i = /* @__PURE__ */ new Map();
|
|
2137
|
+
function vi(e) {
|
|
2138
|
+
return Ae(e).packages.includes(gi);
|
|
2109
2139
|
}
|
|
2110
|
-
function
|
|
2111
|
-
|
|
2140
|
+
function yi(e, t) {
|
|
2141
|
+
_i.set(e, t);
|
|
2112
2142
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let t =
|
|
2143
|
+
function bi(e) {
|
|
2144
|
+
let t = Ae(e);
|
|
2115
2145
|
return {
|
|
2116
2146
|
...t,
|
|
2117
2147
|
name: e?.length ? t.name : "Stage",
|
|
2118
2148
|
packages: x(t.packages, {
|
|
2119
|
-
baseline:
|
|
2120
|
-
catalog: { [
|
|
2149
|
+
baseline: hi,
|
|
2150
|
+
catalog: { [Ce]: g.Blueprint }
|
|
2121
2151
|
})
|
|
2122
2152
|
};
|
|
2123
2153
|
}
|
|
2124
|
-
var
|
|
2125
|
-
...
|
|
2126
|
-
[
|
|
2154
|
+
var xi = {
|
|
2155
|
+
...be,
|
|
2156
|
+
[hi]: et.components
|
|
2127
2157
|
};
|
|
2128
|
-
function
|
|
2129
|
-
let t = [...
|
|
2158
|
+
function Si(e) {
|
|
2159
|
+
let t = [..._i.values()].reduce((e, t) => ({
|
|
2130
2160
|
...e,
|
|
2131
2161
|
...t.components
|
|
2132
2162
|
}), {});
|
|
2133
2163
|
return {
|
|
2134
|
-
...
|
|
2135
|
-
|
|
2164
|
+
...le,
|
|
2165
|
+
...$e,
|
|
2136
2166
|
...t,
|
|
2137
|
-
...
|
|
2138
|
-
...
|
|
2167
|
+
...Se,
|
|
2168
|
+
...ke,
|
|
2139
2169
|
...e
|
|
2140
2170
|
};
|
|
2141
2171
|
}
|
|
2142
|
-
function
|
|
2143
|
-
let t = Object.fromEntries([...
|
|
2172
|
+
function Ci(e) {
|
|
2173
|
+
let t = Object.fromEntries([..._i].map(([e, t]) => [e, t.declared]));
|
|
2144
2174
|
return {
|
|
2145
2175
|
...e,
|
|
2146
|
-
...
|
|
2176
|
+
...xi,
|
|
2147
2177
|
...t
|
|
2148
2178
|
};
|
|
2149
2179
|
}
|
|
2150
|
-
var
|
|
2151
|
-
function
|
|
2180
|
+
var wi = "Stage:navigationTree";
|
|
2181
|
+
function Ti(e, t, n) {
|
|
2152
2182
|
let r = t?.title ?? "Cratis Stage";
|
|
2153
|
-
return
|
|
2183
|
+
return F(e, M.Logo, {
|
|
2154
2184
|
label: r,
|
|
2155
2185
|
initials: r.slice(0, 1).toUpperCase() || "S",
|
|
2156
2186
|
targetScreen: n,
|
|
@@ -2159,40 +2189,40 @@ function vi(e, t, n) {
|
|
|
2159
2189
|
...t?.showName === void 0 ? {} : { showName: t.showName }
|
|
2160
2190
|
});
|
|
2161
2191
|
}
|
|
2162
|
-
function
|
|
2163
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
2192
|
+
function Ei(e, t, n, r, i, a = !1, o = !0) {
|
|
2193
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = si(e), u = fi(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = ci([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => Oe({
|
|
2164
2194
|
label: e.name,
|
|
2165
2195
|
targetScreen: e.name,
|
|
2166
2196
|
icon: "pi pi-table",
|
|
2167
2197
|
group: "Screens",
|
|
2168
2198
|
order: n
|
|
2169
|
-
}, t)), p =
|
|
2199
|
+
}, t)), p = li(ci(l), t), m = e.find((e) => e.name === t)?.path?.length ? li(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? F("menu-hierarchy", wi, {
|
|
2170
2200
|
nodes: d,
|
|
2171
2201
|
activeScreen: t
|
|
2172
|
-
}) :
|
|
2202
|
+
}) : F("menu-screens", M.Menu, {
|
|
2173
2203
|
title: "Screens",
|
|
2174
2204
|
label: "Screens"
|
|
2175
2205
|
}, { items: f }), _ = [];
|
|
2176
|
-
n.length > 1 && _.push(
|
|
2206
|
+
n.length > 1 && _.push(F("topbar-locale", pi, {
|
|
2177
2207
|
locales: n,
|
|
2178
2208
|
locale: r
|
|
2179
|
-
})), _.push(
|
|
2209
|
+
})), _.push(F("topbar-theme", mi, { label: "Theme" }));
|
|
2180
2210
|
let v = { regionNavigation: a };
|
|
2181
2211
|
return {
|
|
2182
|
-
[
|
|
2183
|
-
logo: [
|
|
2212
|
+
[N.Topbar]: [F("topbar", M.Topbar, v, {
|
|
2213
|
+
logo: [Ti("topbar-logo", i, s)],
|
|
2184
2214
|
end: _
|
|
2185
2215
|
})],
|
|
2186
|
-
[
|
|
2187
|
-
...a ? {} : { [
|
|
2188
|
-
[
|
|
2216
|
+
[N.Sidebar]: [F("sidebar", M.Sidebar, v, { logo: [Ti("sidebar-logo", i, s)] })],
|
|
2217
|
+
...a ? {} : { [N.Menu]: [g] },
|
|
2218
|
+
[N.Breadcrumb]: [F("breadcrumb", M.Breadcrumb, {
|
|
2189
2219
|
homeTargetScreen: s,
|
|
2190
2220
|
items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
|
|
2191
2221
|
})],
|
|
2192
|
-
...o ? { [
|
|
2193
|
-
[
|
|
2222
|
+
...o ? { [N.Footer]: [F("footer", M.Footer, { text: `${c} · rendered from your model` })] } : {},
|
|
2223
|
+
[N.ConfigPanel]: [F(M.ConfigPanel, M.ConfigPanel, {
|
|
2194
2224
|
title: "Settings",
|
|
2195
|
-
themes:
|
|
2225
|
+
themes: P.map((e) => ({
|
|
2196
2226
|
name: e.name,
|
|
2197
2227
|
label: e.name,
|
|
2198
2228
|
isDark: e.isDark ?? !1
|
|
@@ -2200,65 +2230,102 @@ function yi(e, t, n, r, i, a = !1, o = !0) {
|
|
|
2200
2230
|
})]
|
|
2201
2231
|
};
|
|
2202
2232
|
}
|
|
2203
|
-
function
|
|
2233
|
+
function Di(e) {
|
|
2204
2234
|
return `#/${encodeURIComponent(e)}`;
|
|
2205
2235
|
}
|
|
2206
2236
|
//#endregion
|
|
2207
2237
|
//#region src/StageChrome.tsx
|
|
2208
|
-
var
|
|
2238
|
+
var Oi = t({
|
|
2209
2239
|
locales: [],
|
|
2210
2240
|
locale: "",
|
|
2211
2241
|
setLocale: () => void 0,
|
|
2212
2242
|
activity: ""
|
|
2213
2243
|
});
|
|
2214
|
-
function
|
|
2215
|
-
return /* @__PURE__ */
|
|
2244
|
+
function ki({ state: e, children: t }) {
|
|
2245
|
+
return /* @__PURE__ */ I(Oi.Provider, {
|
|
2216
2246
|
value: e,
|
|
2217
2247
|
children: t
|
|
2218
2248
|
});
|
|
2219
2249
|
}
|
|
2220
|
-
var
|
|
2221
|
-
function
|
|
2222
|
-
let { locales: e, locale: t, setLocale: n } = i(
|
|
2223
|
-
return e.length < 2 ? null : /* @__PURE__ */
|
|
2250
|
+
var Ai = "Stage:activity";
|
|
2251
|
+
function ji() {
|
|
2252
|
+
let { locales: e, locale: t, setLocale: n } = i(Oi);
|
|
2253
|
+
return e.length < 2 ? null : /* @__PURE__ */ I("select", {
|
|
2224
2254
|
className: "stage-locale",
|
|
2225
2255
|
"aria-label": "Locale",
|
|
2226
2256
|
value: t,
|
|
2227
2257
|
onChange: (e) => n(e.target.value),
|
|
2228
|
-
children: e.map((e) => /* @__PURE__ */
|
|
2258
|
+
children: e.map((e) => /* @__PURE__ */ I("option", {
|
|
2229
2259
|
value: e,
|
|
2230
2260
|
children: e
|
|
2231
2261
|
}, e))
|
|
2232
2262
|
});
|
|
2233
2263
|
}
|
|
2234
|
-
function
|
|
2264
|
+
function Mi({ element: e }) {
|
|
2265
|
+
let { config: t, setThemeName: n, setColorScheme: r } = je(), i = typeof e.properties.label == "string" ? e.properties.label : "Theme", a = P.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === j.Dark, o = P.find((e) => (e.isDark ?? !1) !== a);
|
|
2266
|
+
if (!o) return null;
|
|
2267
|
+
let s = a ? "Switch to a light theme" : "Switch to a dark theme";
|
|
2268
|
+
return /* @__PURE__ */ L("div", {
|
|
2269
|
+
className: "stage-theme-toggle",
|
|
2270
|
+
"data-scene-id": e.id,
|
|
2271
|
+
children: [/* @__PURE__ */ I("h3", {
|
|
2272
|
+
className: "layout-config-section-title",
|
|
2273
|
+
children: i
|
|
2274
|
+
}), /* @__PURE__ */ I("button", {
|
|
2275
|
+
type: "button",
|
|
2276
|
+
className: "stage-theme-toggle__button",
|
|
2277
|
+
"aria-label": s,
|
|
2278
|
+
title: s,
|
|
2279
|
+
onClick: () => {
|
|
2280
|
+
n(o.name), r(o.isDark ? j.Dark : j.Light);
|
|
2281
|
+
},
|
|
2282
|
+
children: /* @__PURE__ */ I("svg", {
|
|
2283
|
+
width: "18",
|
|
2284
|
+
height: "18",
|
|
2285
|
+
viewBox: "0 0 24 24",
|
|
2286
|
+
fill: "none",
|
|
2287
|
+
stroke: "currentColor",
|
|
2288
|
+
strokeWidth: "2",
|
|
2289
|
+
strokeLinecap: "round",
|
|
2290
|
+
strokeLinejoin: "round",
|
|
2291
|
+
"aria-hidden": "true",
|
|
2292
|
+
children: a ? /* @__PURE__ */ L(Re, { children: [/* @__PURE__ */ I("circle", {
|
|
2293
|
+
cx: "12",
|
|
2294
|
+
cy: "12",
|
|
2295
|
+
r: "4"
|
|
2296
|
+
}), /* @__PURE__ */ I("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ I("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
2297
|
+
})
|
|
2298
|
+
})]
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
function Ni({ element: e }) {
|
|
2235
2302
|
let t = e.properties ?? {};
|
|
2236
|
-
return /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ I("nav", {
|
|
2237
2304
|
className: "stage-navigation-tree",
|
|
2238
2305
|
"aria-label": "Navigation",
|
|
2239
2306
|
"data-scene-id": e.id,
|
|
2240
|
-
children: /* @__PURE__ */
|
|
2307
|
+
children: /* @__PURE__ */ I(Pi, {
|
|
2241
2308
|
nodes: t.nodes ?? [],
|
|
2242
2309
|
activeScreen: t.activeScreen
|
|
2243
2310
|
})
|
|
2244
2311
|
});
|
|
2245
2312
|
}
|
|
2246
|
-
function
|
|
2247
|
-
return /* @__PURE__ */
|
|
2313
|
+
function Pi({ nodes: e, activeScreen: t }) {
|
|
2314
|
+
return /* @__PURE__ */ I("ul", {
|
|
2248
2315
|
role: "tree",
|
|
2249
|
-
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */
|
|
2316
|
+
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ L("li", {
|
|
2250
2317
|
role: "treeitem",
|
|
2251
2318
|
"aria-expanded": "true",
|
|
2252
|
-
children: [/* @__PURE__ */
|
|
2319
|
+
children: [/* @__PURE__ */ I("span", {
|
|
2253
2320
|
className: "stage-navigation-group",
|
|
2254
2321
|
children: e.label
|
|
2255
|
-
}), /* @__PURE__ */
|
|
2322
|
+
}), /* @__PURE__ */ I(Pi, {
|
|
2256
2323
|
nodes: e.children,
|
|
2257
2324
|
activeScreen: t
|
|
2258
2325
|
})]
|
|
2259
|
-
}, e.label) : /* @__PURE__ */
|
|
2326
|
+
}, e.label) : /* @__PURE__ */ I("li", {
|
|
2260
2327
|
role: "treeitem",
|
|
2261
|
-
children: /* @__PURE__ */
|
|
2328
|
+
children: /* @__PURE__ */ I(Fi, {
|
|
2262
2329
|
node: e,
|
|
2263
2330
|
screen: e.screen,
|
|
2264
2331
|
activeScreen: t
|
|
@@ -2266,56 +2333,56 @@ function Ei({ nodes: e, activeScreen: t }) {
|
|
|
2266
2333
|
}, `${e.screen}:${e.label}`))
|
|
2267
2334
|
});
|
|
2268
2335
|
}
|
|
2269
|
-
function
|
|
2270
|
-
let r = i(
|
|
2336
|
+
function Fi({ node: e, screen: t, activeScreen: n }) {
|
|
2337
|
+
let r = i(O), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && r && !s && di(o) ? (e) => {
|
|
2271
2338
|
e.preventDefault(), r.navigate(o);
|
|
2272
2339
|
} : void 0;
|
|
2273
|
-
return /* @__PURE__ */
|
|
2274
|
-
href: s ? o.route :
|
|
2340
|
+
return /* @__PURE__ */ L("a", {
|
|
2341
|
+
href: s ? o.route : Di(t),
|
|
2275
2342
|
rel: s ? "noreferrer" : void 0,
|
|
2276
2343
|
"aria-current": t === n ? "page" : void 0,
|
|
2277
2344
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
2278
2345
|
"data-presentation": e.presentation,
|
|
2279
2346
|
"data-icon": e.icon,
|
|
2280
2347
|
onClick: c,
|
|
2281
|
-
children: [a !== "text" && e.icon && /* @__PURE__ */
|
|
2348
|
+
children: [a !== "text" && e.icon && /* @__PURE__ */ I("span", {
|
|
2282
2349
|
className: "stage-navigation-icon",
|
|
2283
2350
|
"aria-hidden": "true",
|
|
2284
2351
|
"data-icon-name": e.icon
|
|
2285
2352
|
}), a !== "icon" && e.label]
|
|
2286
2353
|
});
|
|
2287
2354
|
}
|
|
2288
|
-
function
|
|
2289
|
-
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(
|
|
2290
|
-
return /* @__PURE__ */
|
|
2355
|
+
function Ii({ element: e }) {
|
|
2356
|
+
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(O), r = ge(), a = B(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
|
|
2357
|
+
return /* @__PURE__ */ L("div", {
|
|
2291
2358
|
"data-scene-outlet": t,
|
|
2292
2359
|
"data-scene-outlet-screen": o,
|
|
2293
|
-
children: [c && o && /* @__PURE__ */
|
|
2360
|
+
children: [c && o && /* @__PURE__ */ I("div", {
|
|
2294
2361
|
className: "scene-outlet-bar",
|
|
2295
|
-
children: /* @__PURE__ */
|
|
2362
|
+
children: /* @__PURE__ */ I("button", {
|
|
2296
2363
|
type: "button",
|
|
2297
2364
|
className: "scene-outlet-close",
|
|
2298
2365
|
"aria-label": "Close",
|
|
2299
2366
|
onClick: () => n?.closeOutlet(t),
|
|
2300
2367
|
children: "Close"
|
|
2301
2368
|
})
|
|
2302
|
-
}), s && r && /* @__PURE__ */
|
|
2369
|
+
}), s && r && /* @__PURE__ */ I(ie, {
|
|
2303
2370
|
element: s,
|
|
2304
2371
|
registry: r.registry,
|
|
2305
2372
|
resolveBinding: a.resolveBinding
|
|
2306
2373
|
})]
|
|
2307
2374
|
});
|
|
2308
2375
|
}
|
|
2309
|
-
function
|
|
2310
|
-
let { activity: e } = i(
|
|
2311
|
-
return e ? /* @__PURE__ */
|
|
2376
|
+
function Li() {
|
|
2377
|
+
let { activity: e } = i(Oi);
|
|
2378
|
+
return e ? /* @__PURE__ */ I("p", {
|
|
2312
2379
|
className: "stage-activity",
|
|
2313
2380
|
role: "status",
|
|
2314
2381
|
children: e
|
|
2315
2382
|
}) : null;
|
|
2316
2383
|
}
|
|
2317
|
-
function
|
|
2318
|
-
let e =
|
|
2384
|
+
function Ri() {
|
|
2385
|
+
let e = _e(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2319
2386
|
return a(() => {
|
|
2320
2387
|
let r = e?.isDark ? "dark" : "light";
|
|
2321
2388
|
document.documentElement.setAttribute("data-scene-color-scheme", r), document.body.setAttribute("data-scene-color-scheme", r), document.body.style.backgroundColor = t ?? "", document.body.style.color = n ?? "";
|
|
@@ -2325,44 +2392,45 @@ function Ai() {
|
|
|
2325
2392
|
n
|
|
2326
2393
|
]), null;
|
|
2327
2394
|
}
|
|
2328
|
-
var
|
|
2329
|
-
[
|
|
2330
|
-
[
|
|
2331
|
-
[
|
|
2332
|
-
|
|
2333
|
-
|
|
2395
|
+
var zi = {
|
|
2396
|
+
[pi]: ji,
|
|
2397
|
+
[mi]: Mi,
|
|
2398
|
+
[wi]: Ni,
|
|
2399
|
+
[Ai]: Li,
|
|
2400
|
+
"core:outlet": Ii
|
|
2401
|
+
}, Bi = [
|
|
2334
2402
|
"navigationMode",
|
|
2335
2403
|
"menuTheme",
|
|
2336
2404
|
"showFooter"
|
|
2337
|
-
],
|
|
2338
|
-
function
|
|
2405
|
+
], Vi = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2406
|
+
function Hi(e, t, n = !1) {
|
|
2339
2407
|
let r = [], i = t.options ?? {}, a = {
|
|
2340
2408
|
showFooter: !0,
|
|
2341
2409
|
followsSystem: !1,
|
|
2342
2410
|
problems: r
|
|
2343
2411
|
};
|
|
2344
2412
|
for (let [e, n] of Object.entries(i)) {
|
|
2345
|
-
if (!
|
|
2346
|
-
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${
|
|
2413
|
+
if (!Bi.includes(e)) {
|
|
2414
|
+
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Bi.join(", ")}.`);
|
|
2347
2415
|
continue;
|
|
2348
2416
|
}
|
|
2349
2417
|
if (e === "navigationMode") {
|
|
2350
|
-
let e =
|
|
2351
|
-
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${
|
|
2418
|
+
let e = Ee.find((e) => e === n);
|
|
2419
|
+
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${Ee.join(", ")}.`);
|
|
2352
2420
|
} else if (e === "menuTheme") {
|
|
2353
|
-
let e =
|
|
2354
|
-
e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${
|
|
2421
|
+
let e = De.find((e) => e === n);
|
|
2422
|
+
e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${De.join(", ")}.`);
|
|
2355
2423
|
} else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
|
|
2356
2424
|
}
|
|
2357
2425
|
let o = e?.appearance;
|
|
2358
2426
|
if (o?.colorScheme !== void 0) {
|
|
2359
2427
|
a.followsSystem = o.colorScheme === u.System;
|
|
2360
2428
|
let e = a.followsSystem ? n : o.colorScheme === u.Dark;
|
|
2361
|
-
a.colorScheme = e ?
|
|
2429
|
+
a.colorScheme = e ? j.Dark : j.Light, a.themeName = P.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2362
2430
|
}
|
|
2363
|
-
return o?.accent !== void 0 && (
|
|
2431
|
+
return o?.accent !== void 0 && (Vi.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
|
|
2364
2432
|
}
|
|
2365
|
-
function
|
|
2433
|
+
function Ui(e, t) {
|
|
2366
2434
|
if (e?.root === void 0) return [];
|
|
2367
2435
|
let n = /* @__PURE__ */ new Set([
|
|
2368
2436
|
v.RootTemplateUnknown,
|
|
@@ -2374,7 +2442,7 @@ function Fi(e, t) {
|
|
|
2374
2442
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2375
2443
|
return r.length === 0 && t.origin !== y.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
|
|
2376
2444
|
}
|
|
2377
|
-
function
|
|
2445
|
+
function Wi(e) {
|
|
2378
2446
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2379
2447
|
0,
|
|
2380
2448
|
2,
|
|
@@ -2382,7 +2450,7 @@ function Ii(e) {
|
|
|
2382
2450
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2383
2451
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2384
2452
|
}
|
|
2385
|
-
function
|
|
2453
|
+
function Gi(e, t) {
|
|
2386
2454
|
if (t === void 0) return e;
|
|
2387
2455
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2388
2456
|
0,
|
|
@@ -2394,20 +2462,20 @@ function Li(e, t) {
|
|
|
2394
2462
|
tokens: {
|
|
2395
2463
|
...e.tokens,
|
|
2396
2464
|
"primary.color": t,
|
|
2397
|
-
"primary.contrastColor":
|
|
2465
|
+
"primary.contrastColor": Wi(t),
|
|
2398
2466
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2399
2467
|
}
|
|
2400
2468
|
}));
|
|
2401
2469
|
}
|
|
2402
2470
|
//#endregion
|
|
2403
2471
|
//#region src/StageShellSettings.tsx
|
|
2404
|
-
var
|
|
2405
|
-
function
|
|
2472
|
+
var Ki = "(prefers-color-scheme: dark)";
|
|
2473
|
+
function qi() {
|
|
2406
2474
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2407
2475
|
}
|
|
2408
|
-
function
|
|
2409
|
-
let n = c(
|
|
2410
|
-
n.current =
|
|
2476
|
+
function Ji({ settings: e, onSystemSchemeChange: t }) {
|
|
2477
|
+
let n = c(je());
|
|
2478
|
+
n.current = je();
|
|
2411
2479
|
let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
|
|
2412
2480
|
return a(() => {
|
|
2413
2481
|
let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
|
|
@@ -2419,16 +2487,16 @@ function Bi({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2419
2487
|
s
|
|
2420
2488
|
]), a(() => {
|
|
2421
2489
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2422
|
-
let n = globalThis.matchMedia(
|
|
2490
|
+
let n = globalThis.matchMedia(Ki), r = (e) => t(e.matches);
|
|
2423
2491
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2424
2492
|
}, [e.followsSystem, t]), null;
|
|
2425
2493
|
}
|
|
2426
2494
|
//#endregion
|
|
2427
2495
|
//#region src/stageNavigationModel.ts
|
|
2428
|
-
function
|
|
2496
|
+
function Yi(e) {
|
|
2429
2497
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2430
2498
|
}
|
|
2431
|
-
function
|
|
2499
|
+
function Xi(e) {
|
|
2432
2500
|
let t = /* @__PURE__ */ new Map();
|
|
2433
2501
|
for (let n of e) {
|
|
2434
2502
|
let e = (n.path ?? []).join(".");
|
|
@@ -2441,42 +2509,42 @@ function Hi(e) {
|
|
|
2441
2509
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2442
2510
|
};
|
|
2443
2511
|
}
|
|
2444
|
-
function
|
|
2512
|
+
function Zi(e) {
|
|
2445
2513
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2446
2514
|
}
|
|
2447
|
-
function
|
|
2515
|
+
function Qi(e, t, n) {
|
|
2448
2516
|
let r = e.navigation ?? {
|
|
2449
2517
|
application: { regions: [] },
|
|
2450
2518
|
modules: []
|
|
2451
2519
|
};
|
|
2452
2520
|
return {
|
|
2453
2521
|
structure: e.structure ?? { modules: [] },
|
|
2454
|
-
navigation: n ?
|
|
2455
|
-
screenFor:
|
|
2456
|
-
moduleOf:
|
|
2522
|
+
navigation: n ? $i(r, n) : r,
|
|
2523
|
+
screenFor: Xi(e.screens),
|
|
2524
|
+
moduleOf: Zi(e.screens),
|
|
2457
2525
|
...t ? { isVisible: t } : {}
|
|
2458
2526
|
};
|
|
2459
2527
|
}
|
|
2460
|
-
function
|
|
2461
|
-
return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) =>
|
|
2528
|
+
function $i(e, t) {
|
|
2529
|
+
return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) => $i(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, $i(n, t)])) : e;
|
|
2462
2530
|
}
|
|
2463
2531
|
//#endregion
|
|
2464
2532
|
//#region src/stageSlices.ts
|
|
2465
|
-
function
|
|
2466
|
-
return (t) =>
|
|
2533
|
+
function ea(e) {
|
|
2534
|
+
return (t) => K(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2467
2535
|
name: e.name,
|
|
2468
2536
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2469
|
-
label:
|
|
2537
|
+
label: ta(e.name),
|
|
2470
2538
|
required: e.required
|
|
2471
2539
|
}));
|
|
2472
2540
|
}
|
|
2473
|
-
function
|
|
2541
|
+
function ta(e) {
|
|
2474
2542
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2475
2543
|
}
|
|
2476
|
-
function
|
|
2544
|
+
function na(e, t, n) {
|
|
2477
2545
|
return { invoke: async (r, i, a) => {
|
|
2478
2546
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2479
|
-
if (!
|
|
2547
|
+
if (!W(o)) return {
|
|
2480
2548
|
succeeded: !1,
|
|
2481
2549
|
message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
|
|
2482
2550
|
};
|
|
@@ -2494,7 +2562,7 @@ function Ji(e, t, n) {
|
|
|
2494
2562
|
}
|
|
2495
2563
|
//#endregion
|
|
2496
2564
|
//#region src/standaloneScreenTemplates.ts
|
|
2497
|
-
function
|
|
2565
|
+
function ra(e) {
|
|
2498
2566
|
let t = new Set(e.map((e) => e.name));
|
|
2499
2567
|
return e.map((e) => {
|
|
2500
2568
|
let n = e.fitsSlot, r = n?.includes(".") ? n.slice(0, n.lastIndexOf(".")) : void 0;
|
|
@@ -2506,7 +2574,7 @@ function Yi(e) {
|
|
|
2506
2574
|
}
|
|
2507
2575
|
//#endregion
|
|
2508
2576
|
//#region src/withoutSeededSlots.ts
|
|
2509
|
-
function
|
|
2577
|
+
function ia(e, t) {
|
|
2510
2578
|
let n = /* @__PURE__ */ new Map();
|
|
2511
2579
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2512
2580
|
return e.map((e) => {
|
|
@@ -2524,7 +2592,7 @@ function Xi(e, t) {
|
|
|
2524
2592
|
}
|
|
2525
2593
|
//#endregion
|
|
2526
2594
|
//#region src/stageIcons.ts
|
|
2527
|
-
var
|
|
2595
|
+
var aa = /* @__PURE__ */ new Map([
|
|
2528
2596
|
["chart", "chart-column"],
|
|
2529
2597
|
["add", "plus"],
|
|
2530
2598
|
["dollar", "dollar-sign"],
|
|
@@ -2532,24 +2600,24 @@ var Zi = /* @__PURE__ */ new Map([
|
|
|
2532
2600
|
["refresh", "refresh-cw"],
|
|
2533
2601
|
["invoice", "receipt-text"],
|
|
2534
2602
|
["batch", "layers"]
|
|
2535
|
-
]),
|
|
2603
|
+
]), oa = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), sa = A([{
|
|
2536
2604
|
library: _,
|
|
2537
2605
|
loadGlyph: async ({ key: e }) => {
|
|
2538
|
-
let t =
|
|
2539
|
-
if (Object.hasOwn(
|
|
2606
|
+
let t = oa(e), n = aa.get(t) ?? t;
|
|
2607
|
+
if (Object.hasOwn(tt, n)) return (await tt[n]())?.default;
|
|
2540
2608
|
}
|
|
2541
2609
|
}]);
|
|
2542
2610
|
//#endregion
|
|
2543
2611
|
//#region src/App.tsx
|
|
2544
|
-
function
|
|
2545
|
-
return
|
|
2612
|
+
function ca(e = {}) {
|
|
2613
|
+
return Si({
|
|
2546
2614
|
...e,
|
|
2547
|
-
...
|
|
2548
|
-
...
|
|
2615
|
+
...Yr,
|
|
2616
|
+
...zi
|
|
2549
2617
|
});
|
|
2550
2618
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2619
|
+
function la(e, t) {
|
|
2620
|
+
return F(`form-${e}-${t.name}`, Pr, {
|
|
2553
2621
|
command: t.forCommand,
|
|
2554
2622
|
label: t.name,
|
|
2555
2623
|
generationMode: t.generationMode,
|
|
@@ -2557,35 +2625,35 @@ function ta(e, t) {
|
|
|
2557
2625
|
fields: t.fields
|
|
2558
2626
|
});
|
|
2559
2627
|
}
|
|
2560
|
-
function
|
|
2628
|
+
function ua(e, t) {
|
|
2561
2629
|
let n = e.screens[0];
|
|
2562
|
-
return
|
|
2563
|
-
profile:
|
|
2564
|
-
blueprintTemplates:
|
|
2630
|
+
return we(e, n, {
|
|
2631
|
+
profile: bi(e.uiProfiles),
|
|
2632
|
+
blueprintTemplates: ra(t?.length ? [...Te, ...t] : Te)
|
|
2565
2633
|
});
|
|
2566
2634
|
}
|
|
2567
|
-
function
|
|
2568
|
-
let s =
|
|
2635
|
+
function da(e, t, n, r, i, a, o = !0) {
|
|
2636
|
+
let s = Yi(e.navigation), c = fa(e);
|
|
2569
2637
|
return {
|
|
2570
|
-
profile:
|
|
2571
|
-
catalog:
|
|
2572
|
-
blueprintTemplates:
|
|
2573
|
-
chrome: (r, i) => i ===
|
|
2574
|
-
form:
|
|
2575
|
-
trailing: [
|
|
2638
|
+
profile: bi(e.uiProfiles),
|
|
2639
|
+
catalog: Ci(r),
|
|
2640
|
+
blueprintTemplates: ra(a?.length ? [...Te, ...a] : Te),
|
|
2641
|
+
chrome: (r, i) => i === M.FullPageShell ? { [N.ConfigPanel]: Ei(e.screens, r.name, t, n, c, s, o)[N.ConfigPanel] } : Ei(e.screens, r.name, t, n, c, s, o),
|
|
2642
|
+
form: la,
|
|
2643
|
+
trailing: [F("activity", Ai)],
|
|
2576
2644
|
decorate: (e) => {
|
|
2577
|
-
let t =
|
|
2645
|
+
let t = Qr(e);
|
|
2578
2646
|
return i ? w(t, i) : t;
|
|
2579
2647
|
}
|
|
2580
2648
|
};
|
|
2581
2649
|
}
|
|
2582
|
-
function
|
|
2650
|
+
function fa(e) {
|
|
2583
2651
|
let t = e.navigation?.application.logo;
|
|
2584
2652
|
if (t) return {
|
|
2585
2653
|
title: t.title,
|
|
2586
2654
|
image: t.image || void 0
|
|
2587
2655
|
};
|
|
2588
|
-
let n =
|
|
2656
|
+
let n = bi(e.uiProfiles).identity;
|
|
2589
2657
|
if (!n?.name) return;
|
|
2590
2658
|
let r = n.logo;
|
|
2591
2659
|
return {
|
|
@@ -2595,122 +2663,127 @@ function ia(e) {
|
|
|
2595
2663
|
showName: n.showName
|
|
2596
2664
|
};
|
|
2597
2665
|
}
|
|
2598
|
-
function
|
|
2599
|
-
let [o] =
|
|
2600
|
-
return
|
|
2666
|
+
function pa(e, t, n, r, i, a) {
|
|
2667
|
+
let [o] = wr([t], ma(e));
|
|
2668
|
+
return xe(e, o, da(e, n, r, i, void 0, a)).element;
|
|
2601
2669
|
}
|
|
2602
|
-
function
|
|
2670
|
+
function ma(e) {
|
|
2603
2671
|
return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
|
|
2604
2672
|
}
|
|
2605
|
-
function
|
|
2673
|
+
function ha() {
|
|
2606
2674
|
try {
|
|
2607
2675
|
return globalThis.localStorage ?? null;
|
|
2608
2676
|
} catch {
|
|
2609
2677
|
return null;
|
|
2610
2678
|
}
|
|
2611
2679
|
}
|
|
2612
|
-
function
|
|
2613
|
-
let
|
|
2680
|
+
function ga({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
|
|
2681
|
+
let c = ot(), [u, d] = l(), [f, p] = l(""), m = s(() => ca(e), [e, u]), h = st(), g = Xr();
|
|
2614
2682
|
return a(() => {
|
|
2615
2683
|
let e = new AbortController();
|
|
2616
|
-
return
|
|
2684
|
+
return c.scene(e.signal).then((e) => d(r?.length ? {
|
|
2617
2685
|
...e,
|
|
2618
2686
|
dialogTemplates: [...e.dialogTemplates ?? [], ...r.filter((t) => !e.dialogTemplates?.some((e) => e.name === t.name))]
|
|
2619
2687
|
} : e)).catch((t) => {
|
|
2620
|
-
e.signal.aborted ||
|
|
2688
|
+
e.signal.aborted || p(t instanceof Error ? t.message : String(t));
|
|
2621
2689
|
}), () => e.abort();
|
|
2622
|
-
}, [
|
|
2690
|
+
}, [c, r]), f ? /* @__PURE__ */ L("main", {
|
|
2623
2691
|
className: "stage-message",
|
|
2624
|
-
children: [/* @__PURE__ */
|
|
2625
|
-
}) :
|
|
2626
|
-
scene:
|
|
2627
|
-
registry:
|
|
2628
|
-
|
|
2629
|
-
|
|
2692
|
+
children: [/* @__PURE__ */ I("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ I("p", { children: f })]
|
|
2693
|
+
}) : u ? /* @__PURE__ */ I(_a, {
|
|
2694
|
+
scene: u,
|
|
2695
|
+
registry: m,
|
|
2696
|
+
routing: o,
|
|
2697
|
+
routeState: h,
|
|
2698
|
+
strings: g,
|
|
2630
2699
|
packageCatalog: t,
|
|
2631
2700
|
screenTemplates: n,
|
|
2632
2701
|
isVisible: i
|
|
2633
|
-
}) : /* @__PURE__ */
|
|
2702
|
+
}) : /* @__PURE__ */ I("main", {
|
|
2634
2703
|
className: "stage-message",
|
|
2635
|
-
children: /* @__PURE__ */
|
|
2704
|
+
children: /* @__PURE__ */ I("h1", { children: "Preparing the Stage" })
|
|
2636
2705
|
});
|
|
2637
2706
|
}
|
|
2638
|
-
function
|
|
2639
|
-
let
|
|
2707
|
+
function _a({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
|
|
2708
|
+
let d = s(() => {
|
|
2709
|
+
if (cn(n), n === "hash") return de();
|
|
2710
|
+
let e = /^#\/(.+)$/.exec(globalThis.location.hash);
|
|
2711
|
+
return e && globalThis.history.replaceState(null, "", `/${e[1]}`), ue(window, "/");
|
|
2712
|
+
}, [n]), [f, p] = l(qi), m = e.screens[0]?.name ?? "", h = s(() => bi(e.uiProfiles), [e]), g = s(() => m ? ua(e, c) : void 0, [
|
|
2640
2713
|
e,
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
]),
|
|
2644
|
-
m,
|
|
2714
|
+
c,
|
|
2715
|
+
m
|
|
2716
|
+
]), _ = s(() => g ? Ui(h, g) : [], [h, g]), v = s(() => g ? Hi(h, g, f) : void 0, [
|
|
2645
2717
|
h,
|
|
2646
|
-
|
|
2647
|
-
|
|
2718
|
+
g,
|
|
2719
|
+
f
|
|
2720
|
+
]), y = s(() => Gi(P, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => da(e, a.locales, a.locale, o, a.dictionary, c, b), [
|
|
2648
2721
|
e,
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
a,
|
|
2722
|
+
a.locales,
|
|
2723
|
+
a.locale,
|
|
2724
|
+
a.dictionary,
|
|
2653
2725
|
o,
|
|
2654
|
-
y
|
|
2655
|
-
]), x = r((e) => f(e), []), S = s(() => Wi(e, c, i.dictionary), [
|
|
2656
|
-
e,
|
|
2657
2726
|
c,
|
|
2658
|
-
|
|
2659
|
-
]), C = s(() => (
|
|
2727
|
+
b
|
|
2728
|
+
]), S = r((e) => p(e), []), C = s(() => Qi(e, u, a.dictionary), [
|
|
2729
|
+
e,
|
|
2730
|
+
u,
|
|
2731
|
+
a.dictionary
|
|
2732
|
+
]), w = s(() => ({
|
|
2660
2733
|
...e,
|
|
2661
|
-
screens:
|
|
2734
|
+
screens: wr(ia(e.screens, [
|
|
2662
2735
|
...e.screenTemplates,
|
|
2663
2736
|
...e.dialogTemplates ?? [],
|
|
2664
|
-
...
|
|
2665
|
-
...
|
|
2666
|
-
]),
|
|
2667
|
-
}), [e,
|
|
2668
|
-
return
|
|
2737
|
+
...Te,
|
|
2738
|
+
...c ?? []
|
|
2739
|
+
]), ma(e))
|
|
2740
|
+
}), [e, c]);
|
|
2741
|
+
return m ? _.length > 0 ? /* @__PURE__ */ L("main", {
|
|
2669
2742
|
className: "stage-message",
|
|
2670
2743
|
role: "alert",
|
|
2671
2744
|
"data-stage-startup-problem": "root-template",
|
|
2672
2745
|
children: [
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ I("h1", { children: "Unable to start this Stage" }),
|
|
2747
|
+
/* @__PURE__ */ I("p", { children: "The ui profile's root template cannot be the application's shell." }),
|
|
2748
|
+
/* @__PURE__ */ I("ul", { children: _.map((e) => /* @__PURE__ */ I("li", { children: e }, e)) })
|
|
2676
2749
|
]
|
|
2677
|
-
}) : /* @__PURE__ */
|
|
2678
|
-
application:
|
|
2679
|
-
composition:
|
|
2680
|
-
navigationModel:
|
|
2750
|
+
}) : /* @__PURE__ */ I(ve, {
|
|
2751
|
+
application: w,
|
|
2752
|
+
composition: x,
|
|
2753
|
+
navigationModel: C,
|
|
2681
2754
|
registry: t,
|
|
2682
|
-
initialScreen:
|
|
2683
|
-
history:
|
|
2684
|
-
layoutConfigStorage:
|
|
2685
|
-
scope: (t,
|
|
2755
|
+
initialScreen: m,
|
|
2756
|
+
history: d,
|
|
2757
|
+
layoutConfigStorage: ha(),
|
|
2758
|
+
scope: (t, n) => /* @__PURE__ */ I(va, {
|
|
2686
2759
|
scene: e,
|
|
2687
|
-
routeState:
|
|
2688
|
-
strings:
|
|
2760
|
+
routeState: i,
|
|
2761
|
+
strings: a,
|
|
2689
2762
|
navigation: t,
|
|
2690
|
-
themes:
|
|
2691
|
-
shellSettings:
|
|
2692
|
-
onSystemSchemeChange:
|
|
2693
|
-
children:
|
|
2763
|
+
themes: y,
|
|
2764
|
+
shellSettings: v,
|
|
2765
|
+
onSystemSchemeChange: S,
|
|
2766
|
+
children: n
|
|
2694
2767
|
}),
|
|
2695
|
-
renderScreen: (e, n) => /* @__PURE__ */
|
|
2768
|
+
renderScreen: (e, n) => /* @__PURE__ */ I(ba, {
|
|
2696
2769
|
element: e,
|
|
2697
2770
|
configuration: n,
|
|
2698
2771
|
registry: t
|
|
2699
2772
|
}),
|
|
2700
|
-
renderDialog: () => /* @__PURE__ */
|
|
2701
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */
|
|
2773
|
+
renderDialog: () => /* @__PURE__ */ I(Gr, {}),
|
|
2774
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ I(xa, {
|
|
2702
2775
|
template: e,
|
|
2703
2776
|
content: n,
|
|
2704
2777
|
registry: t,
|
|
2705
|
-
strings:
|
|
2778
|
+
strings: a,
|
|
2706
2779
|
close: () => r.closeDialog()
|
|
2707
2780
|
})
|
|
2708
|
-
}) : /* @__PURE__ */
|
|
2781
|
+
}) : /* @__PURE__ */ L("main", {
|
|
2709
2782
|
className: "stage-message",
|
|
2710
|
-
children: [/* @__PURE__ */
|
|
2783
|
+
children: [/* @__PURE__ */ I("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ I("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
2711
2784
|
});
|
|
2712
2785
|
}
|
|
2713
|
-
function
|
|
2786
|
+
function va({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
|
|
2714
2787
|
let [u, f] = l(""), { navigate: p } = r;
|
|
2715
2788
|
return a(() => f(""), [r.currentScreen, r.currentDialog]), a(() => {
|
|
2716
2789
|
let e = (e) => {
|
|
@@ -2727,24 +2800,24 @@ function ua({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
2727
2800
|
r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
|
|
2728
2801
|
};
|
|
2729
2802
|
return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
|
|
2730
|
-
}, [p, e]), /* @__PURE__ */
|
|
2731
|
-
registry:
|
|
2732
|
-
children: /* @__PURE__ */
|
|
2803
|
+
}, [p, e]), /* @__PURE__ */ I(re, {
|
|
2804
|
+
registry: sa,
|
|
2805
|
+
children: /* @__PURE__ */ L(ye, {
|
|
2733
2806
|
themes: i,
|
|
2734
2807
|
children: [
|
|
2735
|
-
o && /* @__PURE__ */
|
|
2808
|
+
o && /* @__PURE__ */ I(Ji, {
|
|
2736
2809
|
settings: o,
|
|
2737
2810
|
onSystemSchemeChange: s
|
|
2738
2811
|
}),
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ I(Ri, {}),
|
|
2813
|
+
/* @__PURE__ */ I(Vt, {
|
|
2741
2814
|
routes: t.routes,
|
|
2742
2815
|
routesReady: t.ready,
|
|
2743
2816
|
parameters: r.currentParameters,
|
|
2744
2817
|
locale: n.locale,
|
|
2745
2818
|
locales: n.locales,
|
|
2746
2819
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2747
|
-
children: /* @__PURE__ */
|
|
2820
|
+
children: /* @__PURE__ */ I(ya, {
|
|
2748
2821
|
activity: u,
|
|
2749
2822
|
routesReady: t.ready,
|
|
2750
2823
|
scene: e,
|
|
@@ -2757,14 +2830,14 @@ function ua({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
2757
2830
|
})
|
|
2758
2831
|
});
|
|
2759
2832
|
}
|
|
2760
|
-
function
|
|
2761
|
-
let o =
|
|
2833
|
+
function ya({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2834
|
+
let o = B(), c = he(), l = an(), u = s(() => na(l, t, o.refreshAfterCommand), [
|
|
2762
2835
|
l,
|
|
2763
2836
|
t,
|
|
2764
2837
|
o.refreshAfterCommand
|
|
2765
|
-
]), f = s(() =>
|
|
2838
|
+
]), f = s(() => ea(n.commandSchemas), [n.commandSchemas]), p = k({
|
|
2766
2839
|
executeCommand: async (e, n) => {
|
|
2767
|
-
let i =
|
|
2840
|
+
let i = W(e);
|
|
2768
2841
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
2769
2842
|
isSuccess: !1,
|
|
2770
2843
|
validationErrors: []
|
|
@@ -2781,7 +2854,7 @@ function da({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2781
2854
|
};
|
|
2782
2855
|
},
|
|
2783
2856
|
navigate: (e, t) => {
|
|
2784
|
-
n.screens.some((t) => t.name === e) ?
|
|
2857
|
+
n.screens.some((t) => t.name === e) ? G(e, un(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
2785
2858
|
},
|
|
2786
2859
|
navigateBack: () => globalThis.history?.back(),
|
|
2787
2860
|
openDialog: async (e) => {
|
|
@@ -2798,18 +2871,18 @@ function da({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2798
2871
|
refreshQuery: async (e) => o.refreshQuery(e),
|
|
2799
2872
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
2800
2873
|
});
|
|
2801
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ I(ki, {
|
|
2802
2875
|
state: {
|
|
2803
2876
|
locales: i.locales,
|
|
2804
2877
|
locale: i.locale,
|
|
2805
2878
|
setLocale: i.setLocale,
|
|
2806
2879
|
activity: e
|
|
2807
2880
|
},
|
|
2808
|
-
children: /* @__PURE__ */
|
|
2881
|
+
children: /* @__PURE__ */ I(se, {
|
|
2809
2882
|
invoker: u,
|
|
2810
|
-
children: /* @__PURE__ */
|
|
2883
|
+
children: /* @__PURE__ */ I(ae, {
|
|
2811
2884
|
fieldsFor: f,
|
|
2812
|
-
children: /* @__PURE__ */
|
|
2885
|
+
children: /* @__PURE__ */ I(D, {
|
|
2813
2886
|
dispatcher: p,
|
|
2814
2887
|
context: {
|
|
2815
2888
|
resolve: o.resolveBinding,
|
|
@@ -2823,9 +2896,9 @@ function da({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2823
2896
|
})
|
|
2824
2897
|
});
|
|
2825
2898
|
}
|
|
2826
|
-
function
|
|
2827
|
-
let r =
|
|
2828
|
-
return /* @__PURE__ */
|
|
2899
|
+
function ba({ element: e, configuration: t, registry: n }) {
|
|
2900
|
+
let r = B(), i = $t();
|
|
2901
|
+
return /* @__PURE__ */ L(Re, { children: [/* @__PURE__ */ I(oi, { element: e }), /* @__PURE__ */ I(ie, {
|
|
2829
2902
|
element: e,
|
|
2830
2903
|
registry: n,
|
|
2831
2904
|
resolveBinding: r.resolveBinding,
|
|
@@ -2834,25 +2907,25 @@ function fa({ element: e, configuration: t, registry: n }) {
|
|
|
2834
2907
|
configuration: t
|
|
2835
2908
|
})] });
|
|
2836
2909
|
}
|
|
2837
|
-
function
|
|
2838
|
-
let o =
|
|
2910
|
+
function xa({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
2911
|
+
let o = B(), s = $t(), c = w(t, r.dictionary);
|
|
2839
2912
|
return a(() => {
|
|
2840
2913
|
let e = (e) => {
|
|
2841
2914
|
e.key === "Escape" && i();
|
|
2842
2915
|
};
|
|
2843
2916
|
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
2844
|
-
}, [i]), /* @__PURE__ */
|
|
2917
|
+
}, [i]), /* @__PURE__ */ I("div", {
|
|
2845
2918
|
className: "stage-dialog-backdrop",
|
|
2846
|
-
children: /* @__PURE__ */
|
|
2919
|
+
children: /* @__PURE__ */ L("section", {
|
|
2847
2920
|
role: "dialog",
|
|
2848
2921
|
"aria-modal": "true",
|
|
2849
2922
|
"aria-label": e.displayName ?? e.name,
|
|
2850
2923
|
className: "stage-dialog",
|
|
2851
|
-
children: [/* @__PURE__ */
|
|
2924
|
+
children: [/* @__PURE__ */ I("button", {
|
|
2852
2925
|
type: "button",
|
|
2853
2926
|
onClick: i,
|
|
2854
2927
|
children: "Close"
|
|
2855
|
-
}), /* @__PURE__ */
|
|
2928
|
+
}), /* @__PURE__ */ I(ie, {
|
|
2856
2929
|
element: c,
|
|
2857
2930
|
registry: n,
|
|
2858
2931
|
resolveBinding: o.resolveBinding,
|
|
@@ -2863,4 +2936,4 @@ function pa({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
|
2863
2936
|
});
|
|
2864
2937
|
}
|
|
2865
2938
|
//#endregion
|
|
2866
|
-
export {
|
|
2939
|
+
export { ga as App, ga as StageApplication, jn as StageCommandForm, Vt as StageDataProvider, br as StageGuardedAction, at as StageSourceProvider, pa as composeStageScreen, na as createStageSliceInvoker, Ht as dataChanged, nn as executeRegisteredCommand, ft as hostedBasePath, vi as listsPrimeReact, yt as performQuery, ht as registerQueryRouteResolver, yi as registerStageLibrary, W as registeredCommand, gt as registeredQuery, ea as sliceFieldsFrom, ca as stageApplicationRegistry, da as stageComposition, e as stageDarkSelector, rt as stageEndpoints, ua as stageShellOf, nt as staticStageSource, bt as subscribeQuery, an as useStageCommandExecutor, B as useStageData, V as useStageQuery, ot as useStageSource };
|