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