@cratis/stage.runtime 4.189.0 → 4.189.2
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/StageCommandForm.d.ts +10 -1
- package/dist/src/index.js +456 -450
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -9,15 +9,15 @@ import { ArcContext as Te } from "@cratis/arc.react";
|
|
|
9
9
|
import { ObservableQueryFor as Ee, Paging as De, QueryFor as Oe } from "@cratis/arc/queries";
|
|
10
10
|
import { resolveCommand as ke, resolveExactQuery as Ae } from "@cratis/scene.components";
|
|
11
11
|
import { Fragment as je, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
12
|
-
import { Button as
|
|
13
|
-
import { PrimeDialog as
|
|
14
|
-
import { Command as
|
|
15
|
-
import { CommandForm as
|
|
16
|
-
import { CalendarField as
|
|
17
|
-
import { Guid as
|
|
18
|
-
import
|
|
12
|
+
import { Button as I } from "primereact/button";
|
|
13
|
+
import { PrimeDialog as Me, PrimeMessage as Ne, primeReactComponents as Pe, primeReactPackageManifest as Fe } from "@cratis/scene.primereact";
|
|
14
|
+
import { Command as Ie } from "@cratis/arc/commands";
|
|
15
|
+
import { CommandForm as Le, asCommandFormField as Re } from "@cratis/arc.react/commands";
|
|
16
|
+
import { CalendarField as ze, CheckboxField as Be, DropdownField as Ve, InputTextField as He, NumberField as Ue } from "@cratis/components/CommandForm";
|
|
17
|
+
import { Guid as We } from "@cratis/fundamentals";
|
|
18
|
+
import Ge from "@primeuix/themes/lara";
|
|
19
19
|
//#region src/stageSource.ts
|
|
20
|
-
function
|
|
20
|
+
function Ke(e) {
|
|
21
21
|
return {
|
|
22
22
|
scene: async () => e.scene,
|
|
23
23
|
routes: async () => e.routes,
|
|
@@ -25,23 +25,23 @@ function qe(e) {
|
|
|
25
25
|
strings: async (t) => e.strings[t] ?? {}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var qe = {
|
|
29
29
|
scene: "stage/scene",
|
|
30
30
|
routes: "stage/routes",
|
|
31
31
|
locales: "stage/locales",
|
|
32
32
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
33
|
-
},
|
|
34
|
-
function
|
|
35
|
-
return t(
|
|
33
|
+
}, Je = e(void 0);
|
|
34
|
+
function Ye({ source: e, children: n }) {
|
|
35
|
+
return t(Je.Provider, { value: e }, n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let e = r(
|
|
37
|
+
function Xe() {
|
|
38
|
+
let e = r(Je);
|
|
39
39
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
let e =
|
|
42
|
+
qe.routes;
|
|
43
|
+
function Ze() {
|
|
44
|
+
let e = Xe(), [t, n] = c({
|
|
45
45
|
routes: void 0,
|
|
46
46
|
ready: !1
|
|
47
47
|
});
|
|
@@ -62,75 +62,75 @@ function Qe() {
|
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/applyQueryChangeSet.ts
|
|
65
|
-
function
|
|
65
|
+
function L(e) {
|
|
66
66
|
return typeof e == "object" && e && "id" in e ? e.id : void 0;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Qe(e) {
|
|
69
69
|
if (typeof e != "object" || !e) return e;
|
|
70
70
|
let t = e.toString();
|
|
71
71
|
return t === "[object Object]" ? JSON.stringify(e) : t;
|
|
72
72
|
}
|
|
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) :
|
|
73
|
+
function $e(e, t) {
|
|
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) : Qe(e) === Qe(t);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
if (t.removed.length > 0 ?
|
|
76
|
+
function et(e, t) {
|
|
77
|
+
if (t.removed.length > 0 ? L(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => $e(L(e), L(t)))).map((e) => t.replaced.find((t) => $e(L(t), L(e))) ?? e), ...t.added];
|
|
78
78
|
let n = new Set(t.removed.map((e) => JSON.stringify(e)));
|
|
79
79
|
return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/queryExecutor.ts
|
|
83
|
-
var
|
|
84
|
-
function
|
|
85
|
-
|
|
83
|
+
var tt;
|
|
84
|
+
function nt(e) {
|
|
85
|
+
tt = e;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function rt(e, t) {
|
|
88
88
|
let n = Ae(e);
|
|
89
|
-
return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)),
|
|
89
|
+
return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), it(n) ? n : t ? tt?.(t) : void 0;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function it(e) {
|
|
92
92
|
return typeof e == "function" && (e.prototype instanceof Oe || e.prototype instanceof Ee);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function at(e, t) {
|
|
95
95
|
e.setMicroservice(t.microservice), e.setApiBasePath(t.apiBasePath ?? ""), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = De.noPaging;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function ot(e, t, n) {
|
|
98
98
|
let r = new e();
|
|
99
|
-
return
|
|
99
|
+
return at(r, n), r.perform(t);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function st(e, t, n, r) {
|
|
102
102
|
let i = new e();
|
|
103
|
-
if (i instanceof Ee) return
|
|
103
|
+
if (i instanceof Ee) return at(i, n), i.subscribe(r, t);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
if (
|
|
105
|
+
function ct(e) {
|
|
106
|
+
if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
107
107
|
}
|
|
108
|
-
var
|
|
109
|
-
function
|
|
108
|
+
var lt = "STAGE-SCENE-ACTION-001", ut = "item.";
|
|
109
|
+
function R(e) {
|
|
110
110
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function dt(e, t) {
|
|
113
113
|
let n = e;
|
|
114
114
|
for (let e of t.split(".").filter(Boolean)) {
|
|
115
|
-
if (!
|
|
115
|
+
if (!R(n)) return;
|
|
116
116
|
n = n[e];
|
|
117
117
|
}
|
|
118
118
|
return n;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function ft(e) {
|
|
121
121
|
return e === null || [
|
|
122
122
|
"string",
|
|
123
123
|
"number",
|
|
124
124
|
"boolean"
|
|
125
125
|
].includes(typeof e);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function pt(e, t) {
|
|
128
128
|
if (typeof e == "number") return t[e];
|
|
129
129
|
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function mt(e, t, n, r) {
|
|
132
132
|
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
133
|
-
let i =
|
|
133
|
+
let i = pt(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
134
134
|
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
135
135
|
}
|
|
136
136
|
switch (t) {
|
|
@@ -145,57 +145,57 @@ function ht(e, t, n, r) {
|
|
|
145
145
|
default: return;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
148
|
+
function ht(e, t) {
|
|
149
|
+
if (R(e)) {
|
|
150
150
|
if (e.kind === "comparison") {
|
|
151
|
-
let n =
|
|
152
|
-
if (typeof n != "string" || !n.startsWith(
|
|
151
|
+
let n = ct(e.left);
|
|
152
|
+
if (typeof n != "string" || !n.startsWith(ut) || typeof e.operator != "string" || !ft(e.right)) return;
|
|
153
153
|
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
154
|
-
return
|
|
154
|
+
return mt(dt(t, n.slice(5)), e.operator, e.right, r);
|
|
155
155
|
}
|
|
156
156
|
if (e.kind === "logical") {
|
|
157
|
-
let n =
|
|
157
|
+
let n = ht(e.left, t), r = ht(e.right, t);
|
|
158
158
|
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
return e.every((e) =>
|
|
162
|
+
function gt(e) {
|
|
163
|
+
return e.every((e) => ht(e, {}) !== void 0);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
if (
|
|
165
|
+
function _t(e, t) {
|
|
166
|
+
if (gt(e)) return e.findIndex((e) => ht(e, t) === !0);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
if (!
|
|
170
|
-
let n =
|
|
168
|
+
function vt(e, t) {
|
|
169
|
+
if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
|
|
170
|
+
let n = _t(e.alternatives, t);
|
|
171
171
|
if (n !== void 0) {
|
|
172
172
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
173
173
|
if (e.kind === "otherwise") return n === -1;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
if (e.startsWith(
|
|
176
|
+
function yt(e, t) {
|
|
177
|
+
if (e.startsWith(ut) && R(t)) return dt(t, e.slice(5));
|
|
178
178
|
}
|
|
179
179
|
//#endregion
|
|
180
180
|
//#region src/stageSession.ts
|
|
181
|
-
var
|
|
182
|
-
function
|
|
181
|
+
var bt = "stage.session.";
|
|
182
|
+
function xt(e) {
|
|
183
183
|
try {
|
|
184
184
|
return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
|
|
185
185
|
} catch {
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
let t =
|
|
189
|
+
function St(e) {
|
|
190
|
+
let t = xt(e);
|
|
191
191
|
if (t) return t;
|
|
192
192
|
let n = globalThis.crypto.randomUUID();
|
|
193
193
|
try {
|
|
194
|
-
globalThis.localStorage?.setItem(`${
|
|
194
|
+
globalThis.localStorage?.setItem(`${bt}${e}`, n);
|
|
195
195
|
} catch {}
|
|
196
196
|
return n;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Ct() {
|
|
199
199
|
let e = {};
|
|
200
200
|
try {
|
|
201
201
|
let t = globalThis.localStorage;
|
|
@@ -210,7 +210,7 @@ function wt() {
|
|
|
210
210
|
}
|
|
211
211
|
//#endregion
|
|
212
212
|
//#region src/stageData.tsx
|
|
213
|
-
var
|
|
213
|
+
var wt = "cratis.stage.data-changed", Tt = e({
|
|
214
214
|
locale: "",
|
|
215
215
|
locales: [],
|
|
216
216
|
screen: "",
|
|
@@ -234,13 +234,13 @@ var Tt = "cratis.stage.data-changed", Et = e({
|
|
|
234
234
|
resolveArgument: () => void 0,
|
|
235
235
|
registerQueryResult: () => void 0,
|
|
236
236
|
refreshVersion: 0
|
|
237
|
-
}),
|
|
237
|
+
}), Et = [
|
|
238
238
|
500,
|
|
239
239
|
1500,
|
|
240
240
|
3e3
|
|
241
|
-
],
|
|
242
|
-
function
|
|
243
|
-
let [f, p] = c({}), [m, h] = c(0), [v, y] = c({}), [b, S] = c(), [C, w] = c({}), [T, ee] = c({}), [te, ne] = c({}), [E, re] = c({ version: 0 }), D = o(() =>
|
|
241
|
+
], Dt = {};
|
|
242
|
+
function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, locales: l, screen: u, children: d }) {
|
|
243
|
+
let [f, p] = c({}), [m, h] = c(0), [v, y] = c({}), [b, S] = c(), [C, w] = c({}), [T, ee] = c({}), [te, ne] = c({}), [E, re] = c({ version: 0 }), D = o(() => Pt(te), [te]), ie = n((e, t) => {
|
|
244
244
|
p((n) => {
|
|
245
245
|
if (!t) {
|
|
246
246
|
let { [e]: t, ...r } = n;
|
|
@@ -251,7 +251,7 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
251
251
|
[e]: t
|
|
252
252
|
};
|
|
253
253
|
});
|
|
254
|
-
}, []), O = r, k = o(() =>
|
|
254
|
+
}, []), O = r, k = o(() => Ct(), [m]), ae = o(() => ({
|
|
255
255
|
name: u,
|
|
256
256
|
keys: {
|
|
257
257
|
...k,
|
|
@@ -273,10 +273,10 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
273
273
|
})), S((t) => t === e ? void 0 : t);
|
|
274
274
|
}, []), ce = n((e, t, n) => {
|
|
275
275
|
ee((r) => {
|
|
276
|
-
let i =
|
|
276
|
+
let i = H(r[e]) ? r[e] : {};
|
|
277
277
|
return {
|
|
278
278
|
...r,
|
|
279
|
-
[e]:
|
|
279
|
+
[e]: Nt(i, t.split(".").filter(Boolean), n)
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}, []), A = n((e) => re((t) => ({
|
|
@@ -284,23 +284,23 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
284
284
|
version: t.version + 1
|
|
285
285
|
})), []), le = s([]), ue = n(() => {
|
|
286
286
|
h((e) => e + 1), A();
|
|
287
|
-
for (let e of
|
|
287
|
+
for (let e of Et) le.current.push(setTimeout(() => A(), e));
|
|
288
288
|
}, [A]);
|
|
289
289
|
i(() => () => le.current.forEach(clearTimeout), []), i(() => {
|
|
290
290
|
let e = () => A(), t = (e) => A(e.detail?.query);
|
|
291
|
-
return globalThis.addEventListener(
|
|
292
|
-
globalThis.removeEventListener(
|
|
291
|
+
return globalThis.addEventListener(wt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
|
|
292
|
+
globalThis.removeEventListener(wt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
|
|
293
293
|
};
|
|
294
294
|
}, [A]);
|
|
295
295
|
let j = b ? v[b] : void 0, de = n((e) => {
|
|
296
296
|
if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
|
|
297
|
-
if (typeof e == "string") return
|
|
298
|
-
let t =
|
|
297
|
+
if (typeof e == "string") return Ft(e, j, v, f, C, O, ae, a, l);
|
|
298
|
+
let t = At(j, f, C, {
|
|
299
299
|
...D,
|
|
300
300
|
...T
|
|
301
301
|
}, v);
|
|
302
302
|
if (!e.kind && e.path.startsWith("component.")) return _(e.path, t);
|
|
303
|
-
if (!e.kind) return
|
|
303
|
+
if (!e.kind) return Ft(e.path, j, v, f, C, O, ae, a, l);
|
|
304
304
|
let n = x(e, t);
|
|
305
305
|
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), g(t)(e);
|
|
306
306
|
}, [
|
|
@@ -314,7 +314,7 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
314
314
|
ae,
|
|
315
315
|
j,
|
|
316
316
|
v
|
|
317
|
-
]), M = n((e) => e ? _(e,
|
|
317
|
+
]), M = n((e) => e ? _(e, At(j, f, C, {
|
|
318
318
|
...D,
|
|
319
319
|
...T
|
|
320
320
|
}, v)) : void 0, [
|
|
@@ -331,7 +331,7 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
331
331
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
332
332
|
let n = { ...t };
|
|
333
333
|
return delete n[e], n;
|
|
334
|
-
}), []), me = o(() =>
|
|
334
|
+
}), []), me = o(() => At(void 0, f, {}, {}, {}).queryResults, [f]), he = o(() => ({
|
|
335
335
|
locale: a,
|
|
336
336
|
locales: l,
|
|
337
337
|
screen: u,
|
|
@@ -344,7 +344,7 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
344
344
|
selections: v,
|
|
345
345
|
selectRow: oe,
|
|
346
346
|
clearSelection: se,
|
|
347
|
-
setState: (e, t) => w((n) =>
|
|
347
|
+
setState: (e, t) => w((n) => Nt(n, e.split(".").filter(Boolean), t)),
|
|
348
348
|
setComponentOutput: ce,
|
|
349
349
|
publishComponentOutputs: fe,
|
|
350
350
|
withdrawComponentOutputs: pe,
|
|
@@ -381,14 +381,14 @@ function kt({ routes: e, routesReady: t = !0, parameters: r = Ot, locale: a, loc
|
|
|
381
381
|
v,
|
|
382
382
|
ce
|
|
383
383
|
]);
|
|
384
|
-
return /* @__PURE__ */ P(
|
|
384
|
+
return /* @__PURE__ */ P(Tt.Provider, {
|
|
385
385
|
value: he,
|
|
386
386
|
children: d
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
var
|
|
390
|
-
function
|
|
391
|
-
let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } =
|
|
389
|
+
var z = () => r(Tt);
|
|
390
|
+
function B(e) {
|
|
391
|
+
let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } = z(), l = r(Te), u = e.publish !== !1, d = n((e, t) => {
|
|
392
392
|
u && o(e, t);
|
|
393
393
|
}, [u, o]), [f, p] = c([]), [m, h] = c(""), [g, _] = c(!1), [v, y] = c(0), b = s(0), x = s(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
|
|
394
394
|
return i(() => {
|
|
@@ -398,21 +398,21 @@ function z(e) {
|
|
|
398
398
|
}
|
|
399
399
|
let t = b.current + 1;
|
|
400
400
|
b.current = t;
|
|
401
|
-
let n = new AbortController(), r = JSON.parse(w), i =
|
|
401
|
+
let n = new AbortController(), r = JSON.parse(w), i = rt(e.name ?? "", e.route);
|
|
402
402
|
_(!0), h("");
|
|
403
403
|
let a = (e) => {
|
|
404
404
|
b.current !== t || n.signal.aborted || (x.current = !1, p([]), h(e instanceof Error ? e.message : String(e)), _(!1));
|
|
405
405
|
}, o = [], s = (e) => {
|
|
406
406
|
if (b.current !== t || n.signal.aborted) return;
|
|
407
|
-
let r =
|
|
407
|
+
let r = Rt(e);
|
|
408
408
|
if (r) {
|
|
409
409
|
a(Error(r));
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
|
-
e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ?
|
|
412
|
+
e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? et(o, e.changeSet) : e.data, p(zt(o)), h(""), _(!1));
|
|
413
413
|
};
|
|
414
414
|
if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
|
|
415
|
-
let c = i.prototype instanceof Ee, u = () => Promise.resolve().then(() =>
|
|
415
|
+
let c = i.prototype instanceof Ee, u = () => Promise.resolve().then(() => ot(i, c ? {
|
|
416
416
|
...r,
|
|
417
417
|
waitForFirstResult: !0
|
|
418
418
|
} : r, l)).then(s).catch(a);
|
|
@@ -422,7 +422,7 @@ function z(e) {
|
|
|
422
422
|
b.current !== t || n.signal.aborted || (x.current = !1, f?.unsubscribe(), f = void 0, u());
|
|
423
423
|
}, 15e3);
|
|
424
424
|
try {
|
|
425
|
-
f =
|
|
425
|
+
f = st(i, r, l, (e) => {
|
|
426
426
|
e.isReady !== !1 && globalThis.clearTimeout(m), s(e);
|
|
427
427
|
});
|
|
428
428
|
} catch {
|
|
@@ -483,29 +483,29 @@ function z(e) {
|
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
globalThis.dispatchEvent(new CustomEvent(
|
|
486
|
+
function kt() {
|
|
487
|
+
globalThis.dispatchEvent(new CustomEvent(wt));
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function At(e, t, n, r, i) {
|
|
490
490
|
let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
|
|
491
491
|
return {
|
|
492
492
|
dataContext: e,
|
|
493
493
|
queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
|
|
494
|
-
let n = t.list ? t.rows :
|
|
494
|
+
let n = t.list ? t.rows : jt(t.rows);
|
|
495
495
|
return [
|
|
496
496
|
[e, n],
|
|
497
497
|
...t.name ? [[t.name, n]] : [],
|
|
498
498
|
...t.alias ? [[t.alias, n]] : []
|
|
499
499
|
];
|
|
500
500
|
})),
|
|
501
|
-
componentOutputs:
|
|
501
|
+
componentOutputs: Mt(r, i),
|
|
502
502
|
state: n
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function jt(e) {
|
|
506
506
|
return e.length === 1 ? e[0] : e;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Mt(e, t) {
|
|
509
509
|
let n = { ...e };
|
|
510
510
|
for (let [e, r] of Object.entries(t)) r && (n[e] = {
|
|
511
511
|
...r,
|
|
@@ -513,17 +513,17 @@ function Nt(e, t) {
|
|
|
513
513
|
});
|
|
514
514
|
return n;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Nt(e, t, n) {
|
|
517
517
|
let [r, ...i] = t;
|
|
518
518
|
return r ? i.length === 0 ? {
|
|
519
519
|
...e,
|
|
520
520
|
[r]: n
|
|
521
521
|
} : {
|
|
522
522
|
...e,
|
|
523
|
-
[r]:
|
|
523
|
+
[r]: Nt(H(e[r]) ? e[r] : {}, i, n)
|
|
524
524
|
} : e;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function Pt(e) {
|
|
527
527
|
let t = {};
|
|
528
528
|
for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
|
|
529
529
|
...t[e],
|
|
@@ -531,30 +531,30 @@ function Ft(e) {
|
|
|
531
531
|
};
|
|
532
532
|
return t;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Ft(e, t, n, r, i, a, o, s, c) {
|
|
535
535
|
if (!e) return;
|
|
536
536
|
let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
|
|
537
537
|
if (l.length !== 0) {
|
|
538
538
|
if (l[0] === "screen") {
|
|
539
539
|
if (l.length === 1) return { name: o.name };
|
|
540
|
-
let e =
|
|
541
|
-
return e === void 0 && l[1] === "keys" && l.length === 3 ?
|
|
540
|
+
let e = V(o, l.slice(1));
|
|
541
|
+
return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
|
|
542
542
|
}
|
|
543
|
-
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ?
|
|
543
|
+
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Lt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? It(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? Lt(r, void 0, l.join(".")) ?? V(i, l);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function It(e, t, n) {
|
|
547
547
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
548
|
-
return r.length > 0 && Object.hasOwn(n, r[0]) ?
|
|
548
|
+
return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Lt(e, t, n) {
|
|
551
551
|
let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
|
|
552
552
|
if (r.length === 0) return;
|
|
553
553
|
let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
|
|
554
|
-
return a.length === 0 ? i : i.length === 1 ?
|
|
554
|
+
return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
if (!
|
|
556
|
+
function Rt(e) {
|
|
557
|
+
if (!H(e)) return "";
|
|
558
558
|
if (e.isAuthorized === !1) return "The query answered 403.";
|
|
559
559
|
if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
|
|
560
560
|
let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
|
|
@@ -562,29 +562,29 @@ function zt(e) {
|
|
|
562
562
|
}
|
|
563
563
|
return "";
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
return Array.isArray(e) ? e.filter(
|
|
565
|
+
function zt(e) {
|
|
566
|
+
return Array.isArray(e) ? e.filter(H) : H(e) ? [e] : [];
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function V(e, t) {
|
|
569
569
|
let n = e;
|
|
570
570
|
for (let e of t) {
|
|
571
|
-
if (!
|
|
571
|
+
if (!H(n)) return;
|
|
572
572
|
n = n[e];
|
|
573
573
|
}
|
|
574
574
|
return n;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function H(e) {
|
|
577
577
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
578
578
|
}
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/stageComponentOutputs.ts
|
|
581
|
-
function
|
|
582
|
-
let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } =
|
|
581
|
+
function Bt() {
|
|
582
|
+
let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } = z();
|
|
583
583
|
return i(() => () => r(e), [e, r]), n((n) => t(e, n), [t, e]);
|
|
584
584
|
}
|
|
585
585
|
//#endregion
|
|
586
586
|
//#region src/commandExecutor.ts
|
|
587
|
-
function
|
|
587
|
+
function U(e, t, n) {
|
|
588
588
|
for (let r of [
|
|
589
589
|
t,
|
|
590
590
|
n?.replace(/^\//, ""),
|
|
@@ -592,13 +592,13 @@ function H(e, t, n) {
|
|
|
592
592
|
]) {
|
|
593
593
|
if (!r) continue;
|
|
594
594
|
let t = ke(r);
|
|
595
|
-
if (
|
|
595
|
+
if (Vt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
return typeof e == "function" && e.prototype instanceof
|
|
598
|
+
function Vt(e) {
|
|
599
|
+
return typeof e == "function" && e.prototype instanceof Ie;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function Ht() {
|
|
602
602
|
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
603
603
|
if (!e) return "";
|
|
604
604
|
try {
|
|
@@ -607,22 +607,22 @@ function Ut() {
|
|
|
607
607
|
return "";
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return e.setApiBasePath(t ||
|
|
610
|
+
function Ut(e, t) {
|
|
611
|
+
return e.setApiBasePath(t || Ht()), e;
|
|
612
612
|
}
|
|
613
|
-
async function
|
|
614
|
-
let r =
|
|
613
|
+
async function Wt(e, t, n) {
|
|
614
|
+
let r = U(e);
|
|
615
615
|
if (!r) return {
|
|
616
616
|
isSuccess: !1,
|
|
617
617
|
validationErrors: [],
|
|
618
618
|
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
619
619
|
};
|
|
620
620
|
let i = new r();
|
|
621
|
-
i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath ||
|
|
621
|
+
i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath || Ht()), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
622
622
|
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
623
|
-
return
|
|
623
|
+
return Gt(e, await i.execute());
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Gt(e, t) {
|
|
626
626
|
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) => ({
|
|
627
627
|
member: t,
|
|
628
628
|
message: e.message
|
|
@@ -638,53 +638,53 @@ function Kt(e, t) {
|
|
|
638
638
|
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Kt() {
|
|
642
642
|
let e = r(Te);
|
|
643
|
-
return n((t, n) =>
|
|
643
|
+
return n((t, n) => Wt(t, n, e), [e]);
|
|
644
644
|
}
|
|
645
645
|
//#endregion
|
|
646
646
|
//#region src/stageNavigation.ts
|
|
647
|
-
function
|
|
647
|
+
function qt(e, t = {}) {
|
|
648
648
|
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
649
649
|
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function W(e, t = {}) {
|
|
652
652
|
if (!globalThis.location) return;
|
|
653
|
-
let n =
|
|
653
|
+
let n = qt(e, t);
|
|
654
654
|
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
655
655
|
}
|
|
656
|
-
function
|
|
657
|
-
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof
|
|
656
|
+
function Jt(e) {
|
|
657
|
+
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof We)).map(([e, t]) => [e, String(t)]));
|
|
658
658
|
}
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region src/stageFormSchema.ts
|
|
661
|
-
var
|
|
662
|
-
function
|
|
661
|
+
var Yt = 8;
|
|
662
|
+
function Xt(e) {
|
|
663
663
|
if (!e) return [];
|
|
664
664
|
try {
|
|
665
|
-
return
|
|
665
|
+
return Zt(JSON.parse(e), 0);
|
|
666
666
|
} catch {
|
|
667
667
|
return [];
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
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 =
|
|
672
|
-
return Object.entries(i).map(([e, i]) =>
|
|
670
|
+
function Zt(e, t) {
|
|
671
|
+
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 = on(e.properties) ? e.properties : {};
|
|
672
|
+
return Object.entries(i).map(([e, i]) => Qt(e, i, !n || r.has(e), t));
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Qt(e, t, n, r) {
|
|
675
675
|
return {
|
|
676
676
|
name: e,
|
|
677
677
|
identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
678
678
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
679
679
|
required: n,
|
|
680
|
-
|
|
680
|
+
...$t(t, r)
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function $t(e, t) {
|
|
684
684
|
let n = e?.type;
|
|
685
685
|
if (Array.isArray(n)) {
|
|
686
686
|
let r = n.filter((e) => e !== "null");
|
|
687
|
-
return r.length === 1 ?
|
|
687
|
+
return r.length === 1 ? $t({
|
|
688
688
|
...e,
|
|
689
689
|
type: r[0]
|
|
690
690
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -695,8 +695,8 @@ function en(e, t) {
|
|
|
695
695
|
type: "date",
|
|
696
696
|
withTime: e.format === "date-time"
|
|
697
697
|
};
|
|
698
|
-
if (n === "array") return
|
|
699
|
-
if (n === "object") return
|
|
698
|
+
if (n === "array") return en(e, t);
|
|
699
|
+
if (n === "object") return tn(e, t);
|
|
700
700
|
if (n === void 0 || n === "string") {
|
|
701
701
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
702
702
|
return t.length > 0 ? {
|
|
@@ -706,56 +706,56 @@ function en(e, t) {
|
|
|
706
706
|
}
|
|
707
707
|
return { unsupportedReason: `type ${String(n)}` };
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function en(e, t) {
|
|
710
710
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
711
|
-
if (t >=
|
|
712
|
-
let r =
|
|
711
|
+
if (t >= Yt || e?.items === void 0) return n;
|
|
712
|
+
let r = Qt("", e.items, !0, t + 1);
|
|
713
713
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function tn(e, t) {
|
|
716
716
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
717
|
-
if (t >=
|
|
718
|
-
let r =
|
|
717
|
+
if (t >= Yt || !on(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
718
|
+
let r = Zt(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
719
719
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function G(e) {
|
|
722
722
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
|
723
723
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function nn(e, t, n) {
|
|
726
726
|
if (t != null) {
|
|
727
|
-
if (e.members &&
|
|
728
|
-
let e = t[r.name], i =
|
|
729
|
-
if (
|
|
727
|
+
if (e.members && on(t)) for (let r of e.members) {
|
|
728
|
+
let e = t[r.name], i = G(r.name);
|
|
729
|
+
if (rn(e)) {
|
|
730
730
|
if (r.required) return `${n}: ${i} is required`;
|
|
731
731
|
continue;
|
|
732
732
|
}
|
|
733
|
-
let a =
|
|
733
|
+
let a = nn(r, e, `${n} ${i.toLowerCase()}`);
|
|
734
734
|
if (a) return a;
|
|
735
735
|
}
|
|
736
736
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
737
|
-
let t =
|
|
737
|
+
let t = rn(i) ? `${n} ${r + 1} is required` : nn(e.item, i, `${n} ${r + 1}`);
|
|
738
738
|
if (t) return t;
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function rn(e) {
|
|
743
743
|
return e == null || e === "";
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
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 &&
|
|
745
|
+
function an(e, t) {
|
|
746
|
+
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 && on(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
747
747
|
let r = e.members?.find((e) => e.name === t);
|
|
748
|
-
return [t, r ?
|
|
749
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
748
|
+
return [t, r ? an(r, n) : n];
|
|
749
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => an(e.item, t)) : t;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function on(e) {
|
|
752
752
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
753
753
|
}
|
|
754
754
|
//#endregion
|
|
755
755
|
//#region src/StageValueFields.tsx
|
|
756
|
-
var sn =
|
|
756
|
+
var sn = Re((e) => /* @__PURE__ */ P(cn, {
|
|
757
757
|
descriptor: e.descriptor,
|
|
758
|
-
label: e.title ??
|
|
758
|
+
label: e.title ?? G(e.descriptor.name),
|
|
759
759
|
value: e.value,
|
|
760
760
|
onChange: e.onChange,
|
|
761
761
|
onBlur: e.onBlur,
|
|
@@ -792,7 +792,7 @@ function ln({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
792
792
|
"data-invalid": a ? "true" : void 0,
|
|
793
793
|
children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(cn, {
|
|
794
794
|
descriptor: e,
|
|
795
|
-
label:
|
|
795
|
+
label: G(e.name),
|
|
796
796
|
value: o[e.name],
|
|
797
797
|
onBlur: i,
|
|
798
798
|
onChange: (t) => r({
|
|
@@ -853,7 +853,7 @@ function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
853
853
|
children: ""
|
|
854
854
|
}), e.options.map((e) => /* @__PURE__ */ P("option", {
|
|
855
855
|
value: e,
|
|
856
|
-
children:
|
|
856
|
+
children: G(e)
|
|
857
857
|
}, e))]
|
|
858
858
|
})]
|
|
859
859
|
});
|
|
@@ -912,24 +912,25 @@ function mn(e) {
|
|
|
912
912
|
//#region src/StageCommandForm.tsx
|
|
913
913
|
var hn = e(void 0);
|
|
914
914
|
function gn({ element: e }) {
|
|
915
|
-
let t =
|
|
915
|
+
let t = z(), n = r(Te), i = r(hn), a = o(() => vn(e), [e]), s = o(() => Vn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? yn(a, s) : [], [a, s]), d = a ? U(a.command, q(e, "typeName"), q(e, "route")) : void 0, f = An(e, u, t.resolveArgument), p = On(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(() => ({
|
|
916
916
|
...h,
|
|
917
|
-
...Cn(u, s, t.parameters),
|
|
917
|
+
...Cn(u, s, t.parameters, g),
|
|
918
918
|
...Sn(u, t.parameters)
|
|
919
919
|
}), [
|
|
920
920
|
h,
|
|
921
921
|
u,
|
|
922
922
|
s,
|
|
923
|
-
t.parameters
|
|
924
|
-
|
|
923
|
+
t.parameters,
|
|
924
|
+
g
|
|
925
|
+
]), v = o(() => a ? bn(a, u, s) : void 0, [
|
|
925
926
|
a,
|
|
926
927
|
u,
|
|
927
928
|
s
|
|
928
|
-
]),
|
|
929
|
+
]), y = o(() => a ? zn(u, s) : [], [
|
|
929
930
|
a,
|
|
930
931
|
u,
|
|
931
932
|
s
|
|
932
|
-
]),
|
|
933
|
+
]), b = o(() => a ? Bn(a.layout, u) : [], [a, u]), [x, S] = c([]);
|
|
933
934
|
return a ? !d && !t.routesReady ? /* @__PURE__ */ F("p", {
|
|
934
935
|
className: "stage-note",
|
|
935
936
|
children: [
|
|
@@ -940,37 +941,37 @@ function gn({ element: e }) {
|
|
|
940
941
|
}) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(_n, {
|
|
941
942
|
form: a,
|
|
942
943
|
messages: [`The modeled command “${a.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
943
|
-
}) :
|
|
944
|
+
}) : y.length > 0 ? /* @__PURE__ */ P(_n, {
|
|
944
945
|
form: a,
|
|
945
|
-
messages:
|
|
946
|
+
messages: y
|
|
946
947
|
}) : /* @__PURE__ */ P("section", {
|
|
947
948
|
className: "stage-command-form",
|
|
948
949
|
"data-command": a.command,
|
|
949
950
|
"data-generation-mode": a.generationMode,
|
|
950
|
-
children: /* @__PURE__ */ F(
|
|
951
|
+
children: /* @__PURE__ */ F(Le, {
|
|
951
952
|
command: d,
|
|
952
|
-
initialValues:
|
|
953
|
+
initialValues: _,
|
|
953
954
|
currentValues: f,
|
|
954
955
|
validateOn: "both",
|
|
955
956
|
validateAllFieldsOnChange: !0,
|
|
956
|
-
onBeforeExecute: (e) =>
|
|
957
|
-
onFieldValidate: (e, t, n, r) =>
|
|
958
|
-
onValidationFailure: (e) =>
|
|
959
|
-
onException: (e) =>
|
|
960
|
-
onFailed: (e) =>
|
|
957
|
+
onBeforeExecute: (e) => Ut(e, n.apiBasePath),
|
|
958
|
+
onFieldValidate: (e, t, n, r) => Rn(u, s, t, r),
|
|
959
|
+
onValidationFailure: (e) => S(e.map((e) => e.message)),
|
|
960
|
+
onException: (e) => S(e),
|
|
961
|
+
onFailed: (e) => S(Gt(a.command, e).messages),
|
|
961
962
|
onSuccess: () => {
|
|
962
|
-
|
|
963
|
+
S([]), t.refreshAfterCommand();
|
|
963
964
|
let n = q(e, "navigateToScreen");
|
|
964
|
-
n &&
|
|
965
|
+
n && W(n, {}), i?.();
|
|
965
966
|
},
|
|
966
967
|
children: [
|
|
967
|
-
|
|
968
|
+
b.map((e) => /* @__PURE__ */ P("p", {
|
|
968
969
|
role: "alert",
|
|
969
970
|
className: "stage-form-error",
|
|
970
971
|
children: e
|
|
971
972
|
}, e)),
|
|
972
|
-
|
|
973
|
-
|
|
973
|
+
v,
|
|
974
|
+
x.map((e) => /* @__PURE__ */ P("p", {
|
|
974
975
|
role: "alert",
|
|
975
976
|
className: "stage-form-error",
|
|
976
977
|
children: e
|
|
@@ -1013,8 +1014,8 @@ function vn(e) {
|
|
|
1013
1014
|
command: t,
|
|
1014
1015
|
label: q(e, "label", t),
|
|
1015
1016
|
fields: n,
|
|
1016
|
-
generationMode:
|
|
1017
|
-
layout:
|
|
1017
|
+
generationMode: Mn(e.properties.generationMode),
|
|
1018
|
+
layout: Nn(e.properties.layout)
|
|
1018
1019
|
};
|
|
1019
1020
|
}
|
|
1020
1021
|
function yn(e, t) {
|
|
@@ -1024,10 +1025,10 @@ function yn(e, t) {
|
|
|
1024
1025
|
}));
|
|
1025
1026
|
}
|
|
1026
1027
|
function bn(e, t, n) {
|
|
1027
|
-
let r = e.layout, i = r ?
|
|
1028
|
+
let r = e.layout, i = r ? Pn(r, t) : [];
|
|
1028
1029
|
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => xn(e, n));
|
|
1029
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1030
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1030
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Fn(r, i), s = {
|
|
1031
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => In(t + 1, r.columns)).join(" "),
|
|
1031
1032
|
columnGap: K(r.columnGap),
|
|
1032
1033
|
rowGap: K(r.rowGap)
|
|
1033
1034
|
}, c = /* @__PURE__ */ new Set();
|
|
@@ -1045,9 +1046,9 @@ function xn(e, t, n) {
|
|
|
1045
1046
|
if (i?.options) {
|
|
1046
1047
|
let e = i.options.map((e) => ({
|
|
1047
1048
|
value: e,
|
|
1048
|
-
label:
|
|
1049
|
+
label: G(e)
|
|
1049
1050
|
}));
|
|
1050
|
-
return /* @__PURE__ */ P(
|
|
1051
|
+
return /* @__PURE__ */ P(Ve, {
|
|
1051
1052
|
value: o,
|
|
1052
1053
|
fieldName: r,
|
|
1053
1054
|
title: a,
|
|
@@ -1065,33 +1066,33 @@ function xn(e, t, n) {
|
|
|
1065
1066
|
descriptor: i
|
|
1066
1067
|
});
|
|
1067
1068
|
switch (i?.type ?? "text") {
|
|
1068
|
-
case "number": return /* @__PURE__ */ P(
|
|
1069
|
+
case "number": return /* @__PURE__ */ P(Ue, {
|
|
1069
1070
|
value: o,
|
|
1070
1071
|
fieldName: r,
|
|
1071
1072
|
title: a,
|
|
1072
1073
|
required: s
|
|
1073
1074
|
});
|
|
1074
|
-
case "boolean": return /* @__PURE__ */ P(
|
|
1075
|
+
case "boolean": return /* @__PURE__ */ P(Be, {
|
|
1075
1076
|
value: o,
|
|
1076
1077
|
fieldName: r,
|
|
1077
1078
|
label: a,
|
|
1078
1079
|
required: s
|
|
1079
1080
|
});
|
|
1080
|
-
case "date": return /* @__PURE__ */ P(
|
|
1081
|
+
case "date": return /* @__PURE__ */ P(ze, {
|
|
1081
1082
|
value: o,
|
|
1082
1083
|
fieldName: r,
|
|
1083
1084
|
title: a,
|
|
1084
1085
|
required: s,
|
|
1085
1086
|
showIcon: !0
|
|
1086
1087
|
});
|
|
1087
|
-
default: return /* @__PURE__ */ P(
|
|
1088
|
+
default: return /* @__PURE__ */ P(He, {
|
|
1088
1089
|
value: o,
|
|
1089
1090
|
fieldName: r,
|
|
1090
1091
|
title: a,
|
|
1091
1092
|
required: s
|
|
1092
1093
|
});
|
|
1093
1094
|
}
|
|
1094
|
-
})(), l =
|
|
1095
|
+
})(), l = Ln(n);
|
|
1095
1096
|
return /* @__PURE__ */ P("span", {
|
|
1096
1097
|
className: "stage-command-form__field",
|
|
1097
1098
|
"data-field": e.name,
|
|
@@ -1110,27 +1111,32 @@ function Sn(e, t) {
|
|
|
1110
1111
|
}
|
|
1111
1112
|
return n;
|
|
1112
1113
|
}
|
|
1113
|
-
function Cn(e, t, n) {
|
|
1114
|
-
let
|
|
1114
|
+
function Cn(e, t, n, r = []) {
|
|
1115
|
+
let i = new Set(e.map((e) => e.sourceProperty ?? e.name)), a = t.some((e) => e.identity), o = {};
|
|
1115
1116
|
for (let e of t) {
|
|
1116
|
-
if (!e.identifier || !e.required ||
|
|
1117
|
-
let t = Tn(e, n) ?? (e.identity || !
|
|
1118
|
-
t !== void 0 && (
|
|
1117
|
+
if (!e.identifier || !e.required || i.has(e.name)) continue;
|
|
1118
|
+
let t = Tn(e, n) ?? En(e, r) ?? (e.identity || !a ? St(e.identifier) : void 0);
|
|
1119
|
+
t !== void 0 && (o[e.name] = t);
|
|
1119
1120
|
}
|
|
1120
|
-
return
|
|
1121
|
+
return o;
|
|
1121
1122
|
}
|
|
1122
1123
|
function wn(e, t) {
|
|
1123
1124
|
return !e.identifier || !e.required ? !1 : e.identity === !0 || Tn(e, t) !== void 0;
|
|
1124
1125
|
}
|
|
1125
1126
|
function Tn(e, t) {
|
|
1126
|
-
if (e.identifier) return t[e.name] ||
|
|
1127
|
+
if (e.identifier) return t[e.name] || xt(e.identifier);
|
|
1128
|
+
}
|
|
1129
|
+
function En(e, t) {
|
|
1130
|
+
if (!e.identifier) return;
|
|
1131
|
+
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1132
|
+
return n.size === 1 ? [...n][0] : void 0;
|
|
1127
1133
|
}
|
|
1128
|
-
function
|
|
1134
|
+
function Dn(e) {
|
|
1129
1135
|
let t = e.properties.populateSource;
|
|
1130
1136
|
return J(t) ? t : void 0;
|
|
1131
1137
|
}
|
|
1132
|
-
function
|
|
1133
|
-
let r =
|
|
1138
|
+
function On(e, t, n) {
|
|
1139
|
+
let r = Dn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, kn(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 = B({
|
|
1134
1140
|
scope: `populate:${q(e, "command")}`,
|
|
1135
1141
|
name: i,
|
|
1136
1142
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
@@ -1143,58 +1149,58 @@ function Dn(e, t, n) {
|
|
|
1143
1149
|
let e = {};
|
|
1144
1150
|
for (let n of t) {
|
|
1145
1151
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1146
|
-
t != null && (e[n.name] =
|
|
1152
|
+
t != null && (e[n.name] = an(n, t));
|
|
1147
1153
|
}
|
|
1148
1154
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1149
1155
|
}, [d, t]);
|
|
1150
1156
|
}
|
|
1151
|
-
function
|
|
1157
|
+
function kn(e, t, n, r) {
|
|
1152
1158
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1153
1159
|
if (i) return i;
|
|
1154
1160
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
1155
|
-
if (a) return
|
|
1161
|
+
if (a) return St(a);
|
|
1156
1162
|
let o = r.resolveBinding({ path: t });
|
|
1157
1163
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1158
1164
|
}
|
|
1159
|
-
function
|
|
1160
|
-
let r = o(() =>
|
|
1165
|
+
function An(e, t, n) {
|
|
1166
|
+
let r = o(() => jn(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1161
1167
|
return o(() => {
|
|
1162
1168
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1163
1169
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1164
1170
|
}, [r, a]);
|
|
1165
1171
|
}
|
|
1166
|
-
function
|
|
1172
|
+
function jn(e, t) {
|
|
1167
1173
|
let n = e.properties.arguments;
|
|
1168
1174
|
if (!Array.isArray(n)) return [];
|
|
1169
1175
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1170
1176
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1171
1177
|
}
|
|
1172
|
-
function
|
|
1178
|
+
function Mn(e) {
|
|
1173
1179
|
return e === d.Manual ? d.Manual : d.Auto;
|
|
1174
1180
|
}
|
|
1175
|
-
function
|
|
1181
|
+
function Nn(e) {
|
|
1176
1182
|
if (!J(e)) return;
|
|
1177
1183
|
let t = e;
|
|
1178
1184
|
return {
|
|
1179
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1180
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1181
|
-
columnGap:
|
|
1182
|
-
rowGap:
|
|
1185
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(Hn) : [],
|
|
1186
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Un) : [],
|
|
1187
|
+
columnGap: Wn(t.columnGap) ? t.columnGap : void 0,
|
|
1188
|
+
rowGap: Wn(t.rowGap) ? t.rowGap : void 0
|
|
1183
1189
|
};
|
|
1184
1190
|
}
|
|
1185
|
-
function
|
|
1191
|
+
function Pn(e, t) {
|
|
1186
1192
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1187
|
-
for (let e of t) !n.has(e.name) &&
|
|
1193
|
+
for (let e of t) !n.has(e.name) && Un(e.placement) && n.set(e.name, e.placement);
|
|
1188
1194
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1189
1195
|
}
|
|
1190
|
-
function
|
|
1196
|
+
function Fn(e, t) {
|
|
1191
1197
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1192
1198
|
}
|
|
1193
|
-
function
|
|
1199
|
+
function In(e, t) {
|
|
1194
1200
|
let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
|
|
1195
1201
|
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";
|
|
1196
1202
|
}
|
|
1197
|
-
function
|
|
1203
|
+
function Ln(e) {
|
|
1198
1204
|
if (e) return {
|
|
1199
1205
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1200
1206
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
@@ -1209,36 +1215,36 @@ function K(e) {
|
|
|
1209
1215
|
case f.Auto: return "auto";
|
|
1210
1216
|
}
|
|
1211
1217
|
}
|
|
1212
|
-
function
|
|
1218
|
+
function Rn(e, t, n, r) {
|
|
1213
1219
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1214
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1220
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? nn(a, r, i?.label ?? n) : void 0;
|
|
1215
1221
|
}
|
|
1216
|
-
function
|
|
1222
|
+
function zn(e, t) {
|
|
1217
1223
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1218
1224
|
return e.flatMap((e) => {
|
|
1219
1225
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1220
1226
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1221
1227
|
});
|
|
1222
1228
|
}
|
|
1223
|
-
function
|
|
1229
|
+
function Bn(e, t) {
|
|
1224
1230
|
if (!e) return [];
|
|
1225
|
-
let n =
|
|
1231
|
+
let n = Pn(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.`);
|
|
1226
1232
|
return [...n, ...r];
|
|
1227
1233
|
}
|
|
1228
|
-
function
|
|
1229
|
-
return
|
|
1234
|
+
function Vn(e) {
|
|
1235
|
+
return Xt(q(e, "schema"));
|
|
1230
1236
|
}
|
|
1231
1237
|
function q(e, t, n = "") {
|
|
1232
1238
|
let r = e.properties[t];
|
|
1233
1239
|
return typeof r == "string" ? r : n;
|
|
1234
1240
|
}
|
|
1235
|
-
function
|
|
1241
|
+
function Hn(e) {
|
|
1236
1242
|
return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1237
1243
|
}
|
|
1238
|
-
function
|
|
1244
|
+
function Un(e) {
|
|
1239
1245
|
return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1240
1246
|
}
|
|
1241
|
-
function
|
|
1247
|
+
function Wn(e) {
|
|
1242
1248
|
return J(e) && Object.values(f).includes(e.unit);
|
|
1243
1249
|
}
|
|
1244
1250
|
function J(e) {
|
|
@@ -1246,23 +1252,23 @@ function J(e) {
|
|
|
1246
1252
|
}
|
|
1247
1253
|
//#endregion
|
|
1248
1254
|
//#region src/StageGuardedAction.tsx
|
|
1249
|
-
function
|
|
1255
|
+
function Gn(e) {
|
|
1250
1256
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1251
1257
|
}
|
|
1252
1258
|
function Y(e, t) {
|
|
1253
1259
|
let n = e.properties[t];
|
|
1254
1260
|
return typeof n == "string" ? n : "";
|
|
1255
1261
|
}
|
|
1256
|
-
function
|
|
1262
|
+
function Kn(e) {
|
|
1257
1263
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1258
1264
|
}
|
|
1259
|
-
function
|
|
1260
|
-
let t =
|
|
1265
|
+
function qn(e) {
|
|
1266
|
+
let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Y(e, "itemRoute"), i = Gn(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1261
1267
|
for (let [e, n] of Object.entries(i)) {
|
|
1262
|
-
let r =
|
|
1268
|
+
let r = Gn(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1263
1269
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1264
1270
|
}
|
|
1265
|
-
let s =
|
|
1271
|
+
let s = B({
|
|
1266
1272
|
scope: `${e.id}:item`,
|
|
1267
1273
|
name: n || void 0,
|
|
1268
1274
|
route: r || void 0,
|
|
@@ -1275,17 +1281,17 @@ function Kn(e) {
|
|
|
1275
1281
|
item: s.rows.length === 1 ? s.rows[0] : void 0
|
|
1276
1282
|
};
|
|
1277
1283
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e,
|
|
1284
|
+
function Jn(e, t) {
|
|
1285
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, yt(ct(n) ?? "", t)]));
|
|
1280
1286
|
}
|
|
1281
|
-
function
|
|
1282
|
-
let n =
|
|
1283
|
-
if (!
|
|
1284
|
-
let n = r.hasSource ? `${
|
|
1287
|
+
function Yn({ element: e, interactions: t }) {
|
|
1288
|
+
let n = z(), r = qn(e), i = Kt(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Gn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1289
|
+
if (!gt(m) || !h || !r.hasSource) {
|
|
1290
|
+
let n = r.hasSource ? `${lt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${lt}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1285
1291
|
return /* @__PURE__ */ F("div", {
|
|
1286
1292
|
className: "stage-guarded-action",
|
|
1287
1293
|
"data-scene-id": e.id,
|
|
1288
|
-
children: [/* @__PURE__ */ P(
|
|
1294
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1289
1295
|
type: "button",
|
|
1290
1296
|
disabled: !0,
|
|
1291
1297
|
title: n,
|
|
@@ -1299,22 +1305,22 @@ function Jn({ element: e, interactions: t }) {
|
|
|
1299
1305
|
});
|
|
1300
1306
|
}
|
|
1301
1307
|
if (!r.item) return null;
|
|
1302
|
-
let g =
|
|
1308
|
+
let g = _t(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1303
1309
|
if (!_?.command) return null;
|
|
1304
|
-
let v = _.command, y =
|
|
1310
|
+
let v = _.command, y = U(v), b = r.item, x = async () => {
|
|
1305
1311
|
if (!y) return;
|
|
1306
1312
|
u(!0);
|
|
1307
|
-
let t = await i(v,
|
|
1313
|
+
let t = await i(v, Jn(_, b));
|
|
1308
1314
|
if (u(!1), s(t.messages), !t.isSuccess) return;
|
|
1309
1315
|
n.refreshAfterCommand();
|
|
1310
|
-
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ?
|
|
1311
|
-
r &&
|
|
1316
|
+
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? yt(`item.${a}`, b) : void 0;
|
|
1317
|
+
r && W(r, a && o != null ? { [a]: String(o) } : {});
|
|
1312
1318
|
};
|
|
1313
1319
|
return /* @__PURE__ */ F("div", {
|
|
1314
1320
|
className: "stage-guarded-action",
|
|
1315
1321
|
"data-scene-id": e.id,
|
|
1316
1322
|
"data-command": v,
|
|
1317
|
-
children: [/* @__PURE__ */ P(
|
|
1323
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1318
1324
|
...t,
|
|
1319
1325
|
type: "button",
|
|
1320
1326
|
disabled: !y || l,
|
|
@@ -1328,12 +1334,12 @@ function Jn({ element: e, interactions: t }) {
|
|
|
1328
1334
|
}, e))]
|
|
1329
1335
|
});
|
|
1330
1336
|
}
|
|
1331
|
-
function
|
|
1337
|
+
function Xn(e) {
|
|
1332
1338
|
let t = ae(), r = s(void 0), a = o(() => v(re(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
|
|
1333
1339
|
i(() => () => clearTimeout(r.current), []);
|
|
1334
1340
|
let c = n((e) => {
|
|
1335
1341
|
if (clearTimeout(r.current), r.current = void 0, !t) return;
|
|
1336
|
-
let n = (n) => n.path === "$guard" ?
|
|
1342
|
+
let n = (n) => n.path === "$guard" ? vt(n.value, e) : n.path?.startsWith("item.") ? yt(n.path, e) : t.context.resolve(n);
|
|
1337
1343
|
b(a, t.dispatcher, {
|
|
1338
1344
|
...t.context,
|
|
1339
1345
|
resolve: n
|
|
@@ -1356,7 +1362,7 @@ function Yn(e) {
|
|
|
1356
1362
|
}
|
|
1357
1363
|
//#endregion
|
|
1358
1364
|
//#region src/stageComponents.tsx
|
|
1359
|
-
var
|
|
1365
|
+
var Zn = "Stage:commandForm";
|
|
1360
1366
|
function X(e, t, n = {}) {
|
|
1361
1367
|
return {
|
|
1362
1368
|
id: e,
|
|
@@ -1369,15 +1375,15 @@ function Z(e, t, n = "") {
|
|
|
1369
1375
|
let r = e.properties[t];
|
|
1370
1376
|
return typeof r == "string" ? r : n;
|
|
1371
1377
|
}
|
|
1372
|
-
function
|
|
1378
|
+
function Qn(e, t) {
|
|
1373
1379
|
let n = e.properties.queryArguments;
|
|
1374
|
-
if (!
|
|
1380
|
+
if (!nr(n)) return {
|
|
1375
1381
|
values: {},
|
|
1376
1382
|
ready: !0
|
|
1377
1383
|
};
|
|
1378
1384
|
let r = {}, i = !0;
|
|
1379
1385
|
for (let [e, a] of Object.entries(n)) {
|
|
1380
|
-
let n =
|
|
1386
|
+
let n = tr(a) ? t.resolveBinding(a) : a;
|
|
1381
1387
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1382
1388
|
}
|
|
1383
1389
|
return {
|
|
@@ -1385,7 +1391,7 @@ function Zn(e, t) {
|
|
|
1385
1391
|
ready: i
|
|
1386
1392
|
};
|
|
1387
1393
|
}
|
|
1388
|
-
function
|
|
1394
|
+
function $n(e, t) {
|
|
1389
1395
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1390
1396
|
let t = e.properties;
|
|
1391
1397
|
return {
|
|
@@ -1401,14 +1407,14 @@ function Qn(e, t) {
|
|
|
1401
1407
|
function Q(e, t) {
|
|
1402
1408
|
return e[t] ?? e.id ?? e.key;
|
|
1403
1409
|
}
|
|
1404
|
-
function
|
|
1405
|
-
let n =
|
|
1410
|
+
function er({ element: e, slots: t }) {
|
|
1411
|
+
let n = z(), 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(() => Qn(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
|
|
1406
1412
|
scope: e.id,
|
|
1407
1413
|
name: r,
|
|
1408
1414
|
route: a || void 0,
|
|
1409
1415
|
arguments: s.values,
|
|
1410
1416
|
ready: s.ready
|
|
1411
|
-
}), d =
|
|
1417
|
+
}), d = $n(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, _ = Xn(e);
|
|
1412
1418
|
i(() => {
|
|
1413
1419
|
if (!h) return;
|
|
1414
1420
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1449,12 +1455,12 @@ function $n({ element: e, slots: t }) {
|
|
|
1449
1455
|
...f && f !== n.screen ? {} : n.parameters,
|
|
1450
1456
|
[p]: String(r)
|
|
1451
1457
|
};
|
|
1452
|
-
(!f || f === n.screen) && n.selectRow(e.id, t),
|
|
1458
|
+
(!f || f === n.screen) && n.selectRow(e.id, t), W(f || n.screen, i);
|
|
1453
1459
|
return;
|
|
1454
1460
|
}
|
|
1455
1461
|
n.selectRow(e.id, t);
|
|
1456
1462
|
};
|
|
1457
|
-
return !Z(e, "query") && !a && !
|
|
1463
|
+
return !Z(e, "query") && !a && !rt(r) ? /* @__PURE__ */ F("section", {
|
|
1458
1464
|
className: "stage-table",
|
|
1459
1465
|
"data-scene-id": e.id,
|
|
1460
1466
|
children: [/* @__PURE__ */ F("p", {
|
|
@@ -1469,27 +1475,27 @@ function $n({ element: e, slots: t }) {
|
|
|
1469
1475
|
className: "stage-table",
|
|
1470
1476
|
"data-scene-id": e.id,
|
|
1471
1477
|
children: [
|
|
1472
|
-
u && /* @__PURE__ */ P(
|
|
1478
|
+
u && /* @__PURE__ */ P(Ne, {
|
|
1473
1479
|
element: X(`${e.id}-loading`, {
|
|
1474
1480
|
severity: "info",
|
|
1475
1481
|
text: "Loading…"
|
|
1476
1482
|
}),
|
|
1477
1483
|
slots: {}
|
|
1478
1484
|
}),
|
|
1479
|
-
l && /* @__PURE__ */ P(
|
|
1485
|
+
l && /* @__PURE__ */ P(Ne, {
|
|
1480
1486
|
element: X(`${e.id}-error`, {
|
|
1481
1487
|
severity: "error",
|
|
1482
1488
|
text: l
|
|
1483
1489
|
}),
|
|
1484
1490
|
slots: {}
|
|
1485
1491
|
}),
|
|
1486
|
-
h && /* @__PURE__ */ P(
|
|
1492
|
+
h && /* @__PURE__ */ P(I, {
|
|
1487
1493
|
type: "button",
|
|
1488
1494
|
size: "small",
|
|
1489
1495
|
onClick: () => {
|
|
1490
1496
|
if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
|
|
1491
1497
|
let { [p]: t, ...r } = n.parameters;
|
|
1492
|
-
|
|
1498
|
+
W(n.screen, r);
|
|
1493
1499
|
},
|
|
1494
1500
|
children: "Clear selection"
|
|
1495
1501
|
}),
|
|
@@ -1515,28 +1521,28 @@ function $n({ element: e, slots: t }) {
|
|
|
1515
1521
|
]
|
|
1516
1522
|
});
|
|
1517
1523
|
}
|
|
1518
|
-
function er(e) {
|
|
1519
|
-
return tr(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1520
|
-
}
|
|
1521
1524
|
function tr(e) {
|
|
1525
|
+
return nr(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1526
|
+
}
|
|
1527
|
+
function nr(e) {
|
|
1522
1528
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1523
1529
|
}
|
|
1524
|
-
function
|
|
1525
|
-
return
|
|
1530
|
+
function rr({ element: e, interactions: t, slots: n }) {
|
|
1531
|
+
return Kn(e) ? /* @__PURE__ */ P(Yn, {
|
|
1526
1532
|
element: e,
|
|
1527
1533
|
interactions: t
|
|
1528
|
-
}) : /* @__PURE__ */ P(
|
|
1534
|
+
}) : /* @__PURE__ */ P(ir, {
|
|
1529
1535
|
element: e,
|
|
1530
1536
|
interactions: t,
|
|
1531
1537
|
slots: n
|
|
1532
1538
|
});
|
|
1533
1539
|
}
|
|
1534
|
-
function
|
|
1540
|
+
function ir({ element: e, interactions: t }) {
|
|
1535
1541
|
let n = Z(e, "label", Z(e, "command"));
|
|
1536
|
-
return
|
|
1542
|
+
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(ar, {
|
|
1537
1543
|
element: e,
|
|
1538
1544
|
label: n
|
|
1539
|
-
}) : /* @__PURE__ */ P(
|
|
1545
|
+
}) : /* @__PURE__ */ P(I, {
|
|
1540
1546
|
type: "button",
|
|
1541
1547
|
"data-scene-id": e.id,
|
|
1542
1548
|
disabled: !0,
|
|
@@ -1545,7 +1551,7 @@ function rr({ element: e, interactions: t }) {
|
|
|
1545
1551
|
children: n
|
|
1546
1552
|
});
|
|
1547
1553
|
}
|
|
1548
|
-
function
|
|
1554
|
+
function ar({ element: e, label: t }) {
|
|
1549
1555
|
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(hn.Provider, {
|
|
1550
1556
|
value: a,
|
|
1551
1557
|
children: /* @__PURE__ */ P(gn, { element: e })
|
|
@@ -1553,7 +1559,7 @@ function ir({ element: e, label: t }) {
|
|
|
1553
1559
|
return /* @__PURE__ */ P("div", {
|
|
1554
1560
|
className: "stage-action",
|
|
1555
1561
|
"data-scene-id": e.id,
|
|
1556
|
-
children: /* @__PURE__ */ P(
|
|
1562
|
+
children: /* @__PURE__ */ P(Me, {
|
|
1557
1563
|
element: X(e.id, {
|
|
1558
1564
|
visible: !1,
|
|
1559
1565
|
header: t,
|
|
@@ -1563,8 +1569,8 @@ function ir({ element: e, label: t }) {
|
|
|
1563
1569
|
}, r)
|
|
1564
1570
|
});
|
|
1565
1571
|
}
|
|
1566
|
-
function
|
|
1567
|
-
let t = e.element ?? X("slice-dialog", {}), r = oe(), { routes: i, parameters: a } =
|
|
1572
|
+
function or(e) {
|
|
1573
|
+
let t = e.element ?? X("slice-dialog", {}), r = oe(), { routes: i, parameters: a } = z(), s = k(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() => Xt(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
|
|
1568
1574
|
if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
|
|
1569
1575
|
element: e.element,
|
|
1570
1576
|
slots: e.slots ?? {}
|
|
@@ -1575,7 +1581,7 @@ function ar(e) {
|
|
|
1575
1581
|
schema: u,
|
|
1576
1582
|
fields: p.map((e) => ({
|
|
1577
1583
|
name: e.name,
|
|
1578
|
-
label:
|
|
1584
|
+
label: G(e.name)
|
|
1579
1585
|
})),
|
|
1580
1586
|
generationMode: "manual"
|
|
1581
1587
|
});
|
|
@@ -1607,7 +1613,7 @@ function ar(e) {
|
|
|
1607
1613
|
]
|
|
1608
1614
|
});
|
|
1609
1615
|
}
|
|
1610
|
-
function
|
|
1616
|
+
function sr(e) {
|
|
1611
1617
|
let { element: t } = e;
|
|
1612
1618
|
if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
|
|
1613
1619
|
let n = Z(t, "name", t.id), r = {
|
|
@@ -1621,25 +1627,25 @@ function or(e) {
|
|
|
1621
1627
|
return /* @__PURE__ */ P("span", {
|
|
1622
1628
|
className: "stage-toolbar-action",
|
|
1623
1629
|
"data-scene-toolbar-item": n,
|
|
1624
|
-
children: /* @__PURE__ */ P(
|
|
1630
|
+
children: /* @__PURE__ */ P(rr, {
|
|
1625
1631
|
element: r,
|
|
1626
1632
|
interactions: e.interactions,
|
|
1627
1633
|
slots: e.slots
|
|
1628
1634
|
})
|
|
1629
1635
|
});
|
|
1630
1636
|
}
|
|
1631
|
-
var
|
|
1637
|
+
var cr = {
|
|
1632
1638
|
...D,
|
|
1633
|
-
"core:table":
|
|
1634
|
-
"core:action":
|
|
1635
|
-
"core:toolbarItem":
|
|
1636
|
-
"core:sliceDialog":
|
|
1637
|
-
[
|
|
1639
|
+
"core:table": er,
|
|
1640
|
+
"core:action": rr,
|
|
1641
|
+
"core:toolbarItem": sr,
|
|
1642
|
+
"core:sliceDialog": or,
|
|
1643
|
+
[Zn]: gn
|
|
1638
1644
|
};
|
|
1639
1645
|
//#endregion
|
|
1640
1646
|
//#region src/useStrings.ts
|
|
1641
|
-
function
|
|
1642
|
-
let e =
|
|
1647
|
+
function lr() {
|
|
1648
|
+
let e = Xe(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1643
1649
|
return i(() => {
|
|
1644
1650
|
let t = new AbortController();
|
|
1645
1651
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1656,11 +1662,11 @@ function cr() {
|
|
|
1656
1662
|
dictionary: o
|
|
1657
1663
|
};
|
|
1658
1664
|
}
|
|
1659
|
-
var
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1665
|
+
var ur = /* @__PURE__ */ new Set(["core:table"]);
|
|
1666
|
+
function dr(e) {
|
|
1667
|
+
return fr(e, /* @__PURE__ */ new Map(), void 0);
|
|
1662
1668
|
}
|
|
1663
|
-
function
|
|
1669
|
+
function fr(e, t, n) {
|
|
1664
1670
|
let r = e;
|
|
1665
1671
|
if (!r.slots) return e;
|
|
1666
1672
|
let i = !1, a = {};
|
|
@@ -1669,7 +1675,7 @@ function dr(e, t, n) {
|
|
|
1669
1675
|
a[e] = o.map((e) => {
|
|
1670
1676
|
let t = e, n = $(t, "typeName");
|
|
1671
1677
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1672
|
-
let a =
|
|
1678
|
+
let a = fr(mr(pr(t, r), s), r, s);
|
|
1673
1679
|
return a !== e && (i = !0), a;
|
|
1674
1680
|
});
|
|
1675
1681
|
}
|
|
@@ -1678,8 +1684,8 @@ function dr(e, t, n) {
|
|
|
1678
1684
|
slots: a
|
|
1679
1685
|
} : e;
|
|
1680
1686
|
}
|
|
1681
|
-
function
|
|
1682
|
-
if (!
|
|
1687
|
+
function pr(e, t) {
|
|
1688
|
+
if (!ur.has(e.componentName)) return e;
|
|
1683
1689
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1684
1690
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1685
1691
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -1688,7 +1694,7 @@ function fr(e, t) {
|
|
|
1688
1694
|
properties: a
|
|
1689
1695
|
};
|
|
1690
1696
|
}
|
|
1691
|
-
function
|
|
1697
|
+
function mr(e, t) {
|
|
1692
1698
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || t.properties?.isCollection === !0 || e.properties.itemQuery !== void 0) return e;
|
|
1693
1699
|
let n = { ...e.properties }, r = $(t, "query"), i = $(t, "by");
|
|
1694
1700
|
return r && (n.itemQuery = r), $(t, "route") && (n.itemRoute = t.properties.route), n.itemArguments = i ? { [i]: { path: `screen.keys.${i}` } } : {}, {
|
|
@@ -1702,7 +1708,7 @@ function $(e, t) {
|
|
|
1702
1708
|
}
|
|
1703
1709
|
//#endregion
|
|
1704
1710
|
//#region src/stageQueryBindings.tsx
|
|
1705
|
-
function
|
|
1711
|
+
function hr(e) {
|
|
1706
1712
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1707
1713
|
if (Array.isArray(e)) {
|
|
1708
1714
|
e.forEach(n);
|
|
@@ -1722,7 +1728,7 @@ function mr(e) {
|
|
|
1722
1728
|
};
|
|
1723
1729
|
return r(e), [...t];
|
|
1724
1730
|
}
|
|
1725
|
-
function
|
|
1731
|
+
function gr(e) {
|
|
1726
1732
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
1727
1733
|
let n = e.properties?.[t];
|
|
1728
1734
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -1741,8 +1747,8 @@ function hr(e) {
|
|
|
1741
1747
|
};
|
|
1742
1748
|
return r(e), [...t.values()];
|
|
1743
1749
|
}
|
|
1744
|
-
function
|
|
1745
|
-
let { routes: t, routesReady: n, parameters: r, session: i } =
|
|
1750
|
+
function _r({ source: e }) {
|
|
1751
|
+
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, s = o(() => e.by ? a ? { [e.by]: a } : {} : {
|
|
1746
1752
|
...i,
|
|
1747
1753
|
...r
|
|
1748
1754
|
}, [
|
|
@@ -1751,7 +1757,7 @@ function gr({ source: e }) {
|
|
|
1751
1757
|
i,
|
|
1752
1758
|
e.by
|
|
1753
1759
|
]);
|
|
1754
|
-
return
|
|
1760
|
+
return B({
|
|
1755
1761
|
scope: `data:${e.typeName}`,
|
|
1756
1762
|
name: e.query,
|
|
1757
1763
|
alias: e.typeName,
|
|
@@ -1761,12 +1767,12 @@ function gr({ source: e }) {
|
|
|
1761
1767
|
list: !0
|
|
1762
1768
|
}), null;
|
|
1763
1769
|
}
|
|
1764
|
-
function
|
|
1765
|
-
let { routes: t, routesReady: n, parameters: r, session: i } =
|
|
1770
|
+
function vr({ name: e }) {
|
|
1771
|
+
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
|
|
1766
1772
|
...i,
|
|
1767
1773
|
...r
|
|
1768
1774
|
}), [r, i]);
|
|
1769
|
-
return
|
|
1775
|
+
return B({
|
|
1770
1776
|
scope: `binding:${e}`,
|
|
1771
1777
|
name: e,
|
|
1772
1778
|
route: t?.queries?.[e],
|
|
@@ -1775,11 +1781,11 @@ function _r({ name: e }) {
|
|
|
1775
1781
|
list: !0
|
|
1776
1782
|
}), null;
|
|
1777
1783
|
}
|
|
1778
|
-
function
|
|
1779
|
-
let t = o(() =>
|
|
1780
|
-
return /* @__PURE__ */ F(je, { children: [t.map((e) => /* @__PURE__ */ P(
|
|
1784
|
+
function yr({ element: e }) {
|
|
1785
|
+
let t = o(() => hr(e), [e]), n = o(() => gr(e), [e]);
|
|
1786
|
+
return /* @__PURE__ */ F(je, { children: [t.map((e) => /* @__PURE__ */ P(vr, { name: e }, e)), n.map((e) => /* @__PURE__ */ P(_r, { source: e }, e.typeName))] });
|
|
1781
1787
|
}
|
|
1782
|
-
function
|
|
1788
|
+
function br(e) {
|
|
1783
1789
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1784
1790
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
1785
1791
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -1792,7 +1798,7 @@ function yr(e) {
|
|
|
1792
1798
|
]);
|
|
1793
1799
|
if (t.has(s)) continue;
|
|
1794
1800
|
t.add(s);
|
|
1795
|
-
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l =
|
|
1801
|
+
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = Cr(r.destination) ? r.destination : void 0;
|
|
1796
1802
|
n.push({
|
|
1797
1803
|
label: i,
|
|
1798
1804
|
targetScreen: a,
|
|
@@ -1800,7 +1806,7 @@ function yr(e) {
|
|
|
1800
1806
|
order: c,
|
|
1801
1807
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
1802
1808
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
1803
|
-
...l &&
|
|
1809
|
+
...l && wr(l) ? { destination: l } : {}
|
|
1804
1810
|
});
|
|
1805
1811
|
}
|
|
1806
1812
|
return n.map((e, t) => ({
|
|
@@ -1808,7 +1814,7 @@ function yr(e) {
|
|
|
1808
1814
|
index: t
|
|
1809
1815
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
1810
1816
|
}
|
|
1811
|
-
function
|
|
1817
|
+
function xr(e) {
|
|
1812
1818
|
let t = {
|
|
1813
1819
|
label: "",
|
|
1814
1820
|
children: []
|
|
@@ -1833,21 +1839,21 @@ function br(e) {
|
|
|
1833
1839
|
}
|
|
1834
1840
|
return t.children;
|
|
1835
1841
|
}
|
|
1836
|
-
function
|
|
1842
|
+
function Sr(e, t) {
|
|
1837
1843
|
for (let n of e) {
|
|
1838
1844
|
if (n.screen === t) return [n.label];
|
|
1839
|
-
let e =
|
|
1845
|
+
let e = Sr(n.children, t);
|
|
1840
1846
|
if (e.length > 0) return [n.label, ...e];
|
|
1841
1847
|
}
|
|
1842
1848
|
return [];
|
|
1843
1849
|
}
|
|
1844
|
-
function
|
|
1850
|
+
function Cr(e) {
|
|
1845
1851
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1846
1852
|
}
|
|
1847
|
-
function
|
|
1853
|
+
function wr(e) {
|
|
1848
1854
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
1849
1855
|
}
|
|
1850
|
-
function
|
|
1856
|
+
function Tr(e, t, n) {
|
|
1851
1857
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
1852
1858
|
label: e.name,
|
|
1853
1859
|
targetScreen: e.name,
|
|
@@ -1856,8 +1862,8 @@ function wr(e, t, n) {
|
|
|
1856
1862
|
}
|
|
1857
1863
|
//#endregion
|
|
1858
1864
|
//#region src/blueprint.ts
|
|
1859
|
-
var
|
|
1860
|
-
function
|
|
1865
|
+
var Er = "Stage:locale";
|
|
1866
|
+
function Dr(e) {
|
|
1861
1867
|
let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
|
|
1862
1868
|
return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
|
|
1863
1869
|
...t,
|
|
@@ -1865,27 +1871,27 @@ function Er(e) {
|
|
|
1865
1871
|
packages: n
|
|
1866
1872
|
};
|
|
1867
1873
|
}
|
|
1868
|
-
var
|
|
1874
|
+
var Or = {
|
|
1869
1875
|
...fe,
|
|
1870
|
-
PrimeReact:
|
|
1876
|
+
PrimeReact: Fe.components
|
|
1871
1877
|
};
|
|
1872
|
-
function
|
|
1878
|
+
function kr(e) {
|
|
1873
1879
|
return {
|
|
1874
1880
|
...D,
|
|
1875
|
-
...
|
|
1881
|
+
...Pe,
|
|
1876
1882
|
...me,
|
|
1877
1883
|
...Se,
|
|
1878
1884
|
...e
|
|
1879
1885
|
};
|
|
1880
1886
|
}
|
|
1881
|
-
function
|
|
1887
|
+
function Ar(e) {
|
|
1882
1888
|
return e ? {
|
|
1883
1889
|
...e,
|
|
1884
|
-
...
|
|
1885
|
-
} :
|
|
1890
|
+
...Or
|
|
1891
|
+
} : Or;
|
|
1886
1892
|
}
|
|
1887
|
-
var
|
|
1888
|
-
function
|
|
1893
|
+
var jr = "Stage:navigationTree";
|
|
1894
|
+
function Mr(e, t, n) {
|
|
1889
1895
|
return N(e, j.Logo, {
|
|
1890
1896
|
label: t,
|
|
1891
1897
|
initials: t.slice(0, 1).toUpperCase() || "S",
|
|
@@ -1893,31 +1899,31 @@ function jr(e, t, n) {
|
|
|
1893
1899
|
...n ? { lightImageUrl: n } : {}
|
|
1894
1900
|
});
|
|
1895
1901
|
}
|
|
1896
|
-
function
|
|
1897
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
1902
|
+
function Nr(e, t, n, r, i, a = !1, o = !0) {
|
|
1903
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = br(e), u = Tr(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = xr([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => xe({
|
|
1898
1904
|
label: e.name,
|
|
1899
1905
|
targetScreen: e.name,
|
|
1900
1906
|
icon: "pi pi-table",
|
|
1901
1907
|
group: "Screens",
|
|
1902
1908
|
order: n
|
|
1903
|
-
}, t)), p = xr(
|
|
1909
|
+
}, t)), p = Sr(xr(l), t), m = e.find((e) => e.name === t)?.path?.length ? Sr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", jr, {
|
|
1904
1910
|
nodes: d,
|
|
1905
1911
|
activeScreen: t
|
|
1906
1912
|
}) : N("menu-screens", j.Menu, {
|
|
1907
1913
|
title: "Screens",
|
|
1908
1914
|
label: "Screens"
|
|
1909
1915
|
}, { items: f }), _ = [];
|
|
1910
|
-
n.length > 1 && _.push(N("topbar-locale",
|
|
1916
|
+
n.length > 1 && _.push(N("topbar-locale", Er, {
|
|
1911
1917
|
locales: n,
|
|
1912
1918
|
locale: r
|
|
1913
1919
|
})), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
|
|
1914
1920
|
let v = { regionNavigation: a };
|
|
1915
1921
|
return {
|
|
1916
1922
|
[M.Topbar]: [N("topbar", j.Topbar, v, {
|
|
1917
|
-
logo: [
|
|
1923
|
+
logo: [Mr("topbar-logo", c, i?.image)],
|
|
1918
1924
|
end: _
|
|
1919
1925
|
})],
|
|
1920
|
-
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [
|
|
1926
|
+
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [Mr("sidebar-logo", c, i?.image)] })],
|
|
1921
1927
|
...a ? {} : { [M.Menu]: [g] },
|
|
1922
1928
|
[M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
|
|
1923
1929
|
homeTargetScreen: s,
|
|
@@ -1934,26 +1940,26 @@ function Mr(e, t, n, r, i, a = !1, o = !0) {
|
|
|
1934
1940
|
})]
|
|
1935
1941
|
};
|
|
1936
1942
|
}
|
|
1937
|
-
function
|
|
1943
|
+
function Pr(e) {
|
|
1938
1944
|
return `#/${encodeURIComponent(e)}`;
|
|
1939
1945
|
}
|
|
1940
1946
|
//#endregion
|
|
1941
1947
|
//#region src/StageChrome.tsx
|
|
1942
|
-
var
|
|
1948
|
+
var Fr = e({
|
|
1943
1949
|
locales: [],
|
|
1944
1950
|
locale: "",
|
|
1945
1951
|
setLocale: () => void 0,
|
|
1946
1952
|
activity: ""
|
|
1947
1953
|
});
|
|
1948
|
-
function
|
|
1949
|
-
return /* @__PURE__ */ P(
|
|
1954
|
+
function Ir({ state: e, children: t }) {
|
|
1955
|
+
return /* @__PURE__ */ P(Fr.Provider, {
|
|
1950
1956
|
value: e,
|
|
1951
1957
|
children: t
|
|
1952
1958
|
});
|
|
1953
1959
|
}
|
|
1954
|
-
var
|
|
1955
|
-
function
|
|
1956
|
-
let { locales: e, locale: t, setLocale: n } = r(
|
|
1960
|
+
var Lr = "Stage:activity";
|
|
1961
|
+
function Rr() {
|
|
1962
|
+
let { locales: e, locale: t, setLocale: n } = r(Fr);
|
|
1957
1963
|
return e.length < 2 ? null : /* @__PURE__ */ P("select", {
|
|
1958
1964
|
className: "stage-locale",
|
|
1959
1965
|
"aria-label": "Locale",
|
|
@@ -1965,19 +1971,19 @@ function Lr() {
|
|
|
1965
1971
|
}, e))
|
|
1966
1972
|
});
|
|
1967
1973
|
}
|
|
1968
|
-
function
|
|
1974
|
+
function zr({ element: e }) {
|
|
1969
1975
|
let t = e.properties ?? {};
|
|
1970
1976
|
return /* @__PURE__ */ P("nav", {
|
|
1971
1977
|
className: "stage-navigation-tree",
|
|
1972
1978
|
"aria-label": "Navigation",
|
|
1973
1979
|
"data-scene-id": e.id,
|
|
1974
|
-
children: /* @__PURE__ */ P(
|
|
1980
|
+
children: /* @__PURE__ */ P(Br, {
|
|
1975
1981
|
nodes: t.nodes ?? [],
|
|
1976
1982
|
activeScreen: t.activeScreen
|
|
1977
1983
|
})
|
|
1978
1984
|
});
|
|
1979
1985
|
}
|
|
1980
|
-
function
|
|
1986
|
+
function Br({ nodes: e, activeScreen: t }) {
|
|
1981
1987
|
return /* @__PURE__ */ P("ul", {
|
|
1982
1988
|
role: "tree",
|
|
1983
1989
|
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
|
|
@@ -1986,13 +1992,13 @@ function zr({ nodes: e, activeScreen: t }) {
|
|
|
1986
1992
|
children: [/* @__PURE__ */ P("span", {
|
|
1987
1993
|
className: "stage-navigation-group",
|
|
1988
1994
|
children: e.label
|
|
1989
|
-
}), /* @__PURE__ */ P(
|
|
1995
|
+
}), /* @__PURE__ */ P(Br, {
|
|
1990
1996
|
nodes: e.children,
|
|
1991
1997
|
activeScreen: t
|
|
1992
1998
|
})]
|
|
1993
1999
|
}, e.label) : /* @__PURE__ */ P("li", {
|
|
1994
2000
|
role: "treeitem",
|
|
1995
|
-
children: /* @__PURE__ */ P(
|
|
2001
|
+
children: /* @__PURE__ */ P(Vr, {
|
|
1996
2002
|
node: e,
|
|
1997
2003
|
screen: e.screen,
|
|
1998
2004
|
activeScreen: t
|
|
@@ -2000,12 +2006,12 @@ function zr({ nodes: e, activeScreen: t }) {
|
|
|
2000
2006
|
}, `${e.screen}:${e.label}`))
|
|
2001
2007
|
});
|
|
2002
2008
|
}
|
|
2003
|
-
function
|
|
2004
|
-
let i = r(ee), 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 &&
|
|
2009
|
+
function Vr({ node: e, screen: t, activeScreen: n }) {
|
|
2010
|
+
let i = r(ee), 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 && wr(o) ? (e) => {
|
|
2005
2011
|
e.preventDefault(), i.navigate(o);
|
|
2006
2012
|
} : void 0;
|
|
2007
2013
|
return /* @__PURE__ */ F("a", {
|
|
2008
|
-
href: s ? o.route :
|
|
2014
|
+
href: s ? o.route : Pr(t),
|
|
2009
2015
|
rel: s ? "noreferrer" : void 0,
|
|
2010
2016
|
"aria-current": t === n ? "page" : void 0,
|
|
2011
2017
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
@@ -2019,8 +2025,8 @@ function Br({ node: e, screen: t, activeScreen: n }) {
|
|
|
2019
2025
|
}), a !== "icon" && e.label]
|
|
2020
2026
|
});
|
|
2021
2027
|
}
|
|
2022
|
-
function
|
|
2023
|
-
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(ee), i = ce(), a =
|
|
2028
|
+
function Hr({ element: e }) {
|
|
2029
|
+
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(ee), i = ce(), a = z(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
|
|
2024
2030
|
return /* @__PURE__ */ F("div", {
|
|
2025
2031
|
"data-scene-outlet": t,
|
|
2026
2032
|
"data-scene-outlet-screen": o,
|
|
@@ -2040,15 +2046,15 @@ function Vr({ element: e }) {
|
|
|
2040
2046
|
})]
|
|
2041
2047
|
});
|
|
2042
2048
|
}
|
|
2043
|
-
function
|
|
2044
|
-
let { activity: e } = r(
|
|
2049
|
+
function Ur() {
|
|
2050
|
+
let { activity: e } = r(Fr);
|
|
2045
2051
|
return e ? /* @__PURE__ */ P("p", {
|
|
2046
2052
|
className: "stage-activity",
|
|
2047
2053
|
role: "status",
|
|
2048
2054
|
children: e
|
|
2049
2055
|
}) : null;
|
|
2050
2056
|
}
|
|
2051
|
-
function
|
|
2057
|
+
function Wr() {
|
|
2052
2058
|
let e = A(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2053
2059
|
return i(() => {
|
|
2054
2060
|
let r = e?.isDark ? "dark" : "light";
|
|
@@ -2059,25 +2065,25 @@ function Ur() {
|
|
|
2059
2065
|
n
|
|
2060
2066
|
]), null;
|
|
2061
2067
|
}
|
|
2062
|
-
var
|
|
2063
|
-
[
|
|
2064
|
-
[
|
|
2065
|
-
[
|
|
2066
|
-
"core:outlet":
|
|
2067
|
-
},
|
|
2068
|
+
var Gr = {
|
|
2069
|
+
[Er]: Rr,
|
|
2070
|
+
[jr]: zr,
|
|
2071
|
+
[Lr]: Ur,
|
|
2072
|
+
"core:outlet": Hr
|
|
2073
|
+
}, Kr = [
|
|
2068
2074
|
"navigationMode",
|
|
2069
2075
|
"menuTheme",
|
|
2070
2076
|
"showFooter"
|
|
2071
|
-
],
|
|
2072
|
-
function
|
|
2077
|
+
], qr = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2078
|
+
function Jr(e, t, n = !1) {
|
|
2073
2079
|
let r = [], i = t.options ?? {}, a = {
|
|
2074
2080
|
showFooter: !0,
|
|
2075
2081
|
followsSystem: !1,
|
|
2076
2082
|
problems: r
|
|
2077
2083
|
};
|
|
2078
2084
|
for (let [e, n] of Object.entries(i)) {
|
|
2079
|
-
if (!
|
|
2080
|
-
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${
|
|
2085
|
+
if (!Kr.includes(e)) {
|
|
2086
|
+
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Kr.join(", ")}.`);
|
|
2081
2087
|
continue;
|
|
2082
2088
|
}
|
|
2083
2089
|
if (e === "navigationMode") {
|
|
@@ -2094,9 +2100,9 @@ function qr(e, t, n = !1) {
|
|
|
2094
2100
|
let e = a.followsSystem ? n : o.colorScheme === l.Dark;
|
|
2095
2101
|
a.colorScheme = e ? ue.Dark : ue.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2096
2102
|
}
|
|
2097
|
-
return o?.accent !== void 0 && (
|
|
2103
|
+
return o?.accent !== void 0 && (qr.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
|
|
2098
2104
|
}
|
|
2099
|
-
function
|
|
2105
|
+
function Yr(e, t) {
|
|
2100
2106
|
if (e?.root === void 0) return [];
|
|
2101
2107
|
let n = /* @__PURE__ */ new Set([
|
|
2102
2108
|
m.RootTemplateUnknown,
|
|
@@ -2108,7 +2114,7 @@ function Jr(e, t) {
|
|
|
2108
2114
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2109
2115
|
return r.length === 0 && t.origin !== h.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;
|
|
2110
2116
|
}
|
|
2111
|
-
function
|
|
2117
|
+
function Xr(e) {
|
|
2112
2118
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2113
2119
|
0,
|
|
2114
2120
|
2,
|
|
@@ -2116,7 +2122,7 @@ function Yr(e) {
|
|
|
2116
2122
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2117
2123
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2118
2124
|
}
|
|
2119
|
-
function
|
|
2125
|
+
function Zr(e, t) {
|
|
2120
2126
|
if (t === void 0) return e;
|
|
2121
2127
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2122
2128
|
0,
|
|
@@ -2128,18 +2134,18 @@ function Xr(e, t) {
|
|
|
2128
2134
|
tokens: {
|
|
2129
2135
|
...e.tokens,
|
|
2130
2136
|
"primary.color": t,
|
|
2131
|
-
"primary.contrastColor":
|
|
2137
|
+
"primary.contrastColor": Xr(t),
|
|
2132
2138
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2133
2139
|
}
|
|
2134
2140
|
}));
|
|
2135
2141
|
}
|
|
2136
2142
|
//#endregion
|
|
2137
2143
|
//#region src/StageShellSettings.tsx
|
|
2138
|
-
var
|
|
2139
|
-
function
|
|
2144
|
+
var Qr = "(prefers-color-scheme: dark)";
|
|
2145
|
+
function $r() {
|
|
2140
2146
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2141
2147
|
}
|
|
2142
|
-
function
|
|
2148
|
+
function ei({ settings: e, onSystemSchemeChange: t }) {
|
|
2143
2149
|
let n = s(we());
|
|
2144
2150
|
n.current = we();
|
|
2145
2151
|
let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
|
|
@@ -2153,16 +2159,16 @@ function $r({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2153
2159
|
c
|
|
2154
2160
|
]), i(() => {
|
|
2155
2161
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2156
|
-
let n = globalThis.matchMedia(
|
|
2162
|
+
let n = globalThis.matchMedia(Qr), r = (e) => t(e.matches);
|
|
2157
2163
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2158
2164
|
}, [e.followsSystem, t]), null;
|
|
2159
2165
|
}
|
|
2160
2166
|
//#endregion
|
|
2161
2167
|
//#region src/stageNavigationModel.ts
|
|
2162
|
-
function
|
|
2168
|
+
function ti(e) {
|
|
2163
2169
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2164
2170
|
}
|
|
2165
|
-
function
|
|
2171
|
+
function ni(e) {
|
|
2166
2172
|
let t = /* @__PURE__ */ new Map();
|
|
2167
2173
|
for (let n of e) {
|
|
2168
2174
|
let e = (n.path ?? []).join(".");
|
|
@@ -2175,38 +2181,38 @@ function ti(e) {
|
|
|
2175
2181
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2176
2182
|
};
|
|
2177
2183
|
}
|
|
2178
|
-
function
|
|
2184
|
+
function ri(e) {
|
|
2179
2185
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2180
2186
|
}
|
|
2181
|
-
function
|
|
2187
|
+
function ii(e, t) {
|
|
2182
2188
|
return {
|
|
2183
2189
|
structure: e.structure ?? { modules: [] },
|
|
2184
2190
|
navigation: e.navigation ?? {
|
|
2185
2191
|
application: { regions: [] },
|
|
2186
2192
|
modules: []
|
|
2187
2193
|
},
|
|
2188
|
-
screenFor:
|
|
2189
|
-
moduleOf:
|
|
2194
|
+
screenFor: ni(e.screens),
|
|
2195
|
+
moduleOf: ri(e.screens),
|
|
2190
2196
|
...t ? { isVisible: t } : {}
|
|
2191
2197
|
};
|
|
2192
2198
|
}
|
|
2193
2199
|
//#endregion
|
|
2194
2200
|
//#region src/stageSlices.ts
|
|
2195
|
-
function
|
|
2196
|
-
return (t) =>
|
|
2201
|
+
function ai(e) {
|
|
2202
|
+
return (t) => Xt(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2197
2203
|
name: e.name,
|
|
2198
2204
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2199
|
-
label:
|
|
2205
|
+
label: oi(e.name),
|
|
2200
2206
|
required: e.required
|
|
2201
2207
|
}));
|
|
2202
2208
|
}
|
|
2203
|
-
function
|
|
2209
|
+
function oi(e) {
|
|
2204
2210
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2205
2211
|
}
|
|
2206
|
-
function
|
|
2212
|
+
function si(e, t, n) {
|
|
2207
2213
|
return { invoke: async (r, i, a) => {
|
|
2208
2214
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2209
|
-
if (!
|
|
2215
|
+
if (!U(o)) return {
|
|
2210
2216
|
succeeded: !1,
|
|
2211
2217
|
message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
|
|
2212
2218
|
};
|
|
@@ -2224,7 +2230,7 @@ function oi(e, t, n) {
|
|
|
2224
2230
|
}
|
|
2225
2231
|
//#endregion
|
|
2226
2232
|
//#region src/withoutSeededSlots.ts
|
|
2227
|
-
function
|
|
2233
|
+
function ci(e, t) {
|
|
2228
2234
|
let n = /* @__PURE__ */ new Map();
|
|
2229
2235
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2230
2236
|
return e.map((e) => {
|
|
@@ -2242,15 +2248,15 @@ function si(e, t) {
|
|
|
2242
2248
|
}
|
|
2243
2249
|
//#endregion
|
|
2244
2250
|
//#region src/App.tsx
|
|
2245
|
-
function
|
|
2246
|
-
return
|
|
2251
|
+
function li(e = {}) {
|
|
2252
|
+
return kr({
|
|
2247
2253
|
...e,
|
|
2248
|
-
...
|
|
2249
|
-
...
|
|
2254
|
+
...cr,
|
|
2255
|
+
...Gr
|
|
2250
2256
|
});
|
|
2251
2257
|
}
|
|
2252
|
-
function
|
|
2253
|
-
return N(`form-${e}-${t.name}`,
|
|
2258
|
+
function ui(e, t) {
|
|
2259
|
+
return N(`form-${e}-${t.name}`, Zn, {
|
|
2254
2260
|
command: t.forCommand,
|
|
2255
2261
|
label: t.name,
|
|
2256
2262
|
generationMode: t.generationMode,
|
|
@@ -2258,43 +2264,43 @@ function li(e, t) {
|
|
|
2258
2264
|
fields: t.fields
|
|
2259
2265
|
});
|
|
2260
2266
|
}
|
|
2261
|
-
function
|
|
2267
|
+
function di(e, t) {
|
|
2262
2268
|
let n = e.screens[0];
|
|
2263
2269
|
return _e(e, n, {
|
|
2264
|
-
profile:
|
|
2270
|
+
profile: Dr(e.uiProfiles),
|
|
2265
2271
|
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2266
2272
|
});
|
|
2267
2273
|
}
|
|
2268
|
-
function
|
|
2269
|
-
let s =
|
|
2274
|
+
function fi(e, t, n, r, i, a, o = !0) {
|
|
2275
|
+
let s = ti(e.navigation), c = e.navigation?.application.logo ? {
|
|
2270
2276
|
title: e.navigation.application.logo.title,
|
|
2271
2277
|
image: e.navigation.application.logo.image || void 0
|
|
2272
2278
|
} : void 0;
|
|
2273
2279
|
return {
|
|
2274
|
-
profile:
|
|
2275
|
-
catalog:
|
|
2280
|
+
profile: Dr(e.uiProfiles),
|
|
2281
|
+
catalog: Ar(r),
|
|
2276
2282
|
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
2277
|
-
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]:
|
|
2278
|
-
form:
|
|
2279
|
-
trailing: [N("activity",
|
|
2283
|
+
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Nr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Nr(e.screens, r.name, t, n, c, s, o),
|
|
2284
|
+
form: ui,
|
|
2285
|
+
trailing: [N("activity", Lr)],
|
|
2280
2286
|
decorate: (e) => {
|
|
2281
|
-
let t =
|
|
2287
|
+
let t = dr(e);
|
|
2282
2288
|
return i ? y(t, i) : t;
|
|
2283
2289
|
}
|
|
2284
2290
|
};
|
|
2285
2291
|
}
|
|
2286
|
-
function
|
|
2287
|
-
return pe(e, t,
|
|
2292
|
+
function pi(e, t, n, r, i, a) {
|
|
2293
|
+
return pe(e, t, fi(e, n, r, i, void 0, a)).element;
|
|
2288
2294
|
}
|
|
2289
|
-
function
|
|
2295
|
+
function mi() {
|
|
2290
2296
|
try {
|
|
2291
2297
|
return globalThis.localStorage ?? null;
|
|
2292
2298
|
} catch {
|
|
2293
2299
|
return null;
|
|
2294
2300
|
}
|
|
2295
2301
|
}
|
|
2296
|
-
function
|
|
2297
|
-
let s =
|
|
2302
|
+
function hi({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
|
|
2303
|
+
let s = Xe(), l = o(() => li(e), [e]), [u, d] = c(), [f, p] = c(""), m = Ze(), h = lr();
|
|
2298
2304
|
return i(() => {
|
|
2299
2305
|
let e = new AbortController();
|
|
2300
2306
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2306,7 +2312,7 @@ function mi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2306
2312
|
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2307
2313
|
className: "stage-message",
|
|
2308
2314
|
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2309
|
-
}) : u ? /* @__PURE__ */ P(
|
|
2315
|
+
}) : u ? /* @__PURE__ */ P(gi, {
|
|
2310
2316
|
scene: u,
|
|
2311
2317
|
registry: l,
|
|
2312
2318
|
routeState: m,
|
|
@@ -2319,16 +2325,16 @@ function mi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2319
2325
|
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2320
2326
|
});
|
|
2321
2327
|
}
|
|
2322
|
-
function
|
|
2323
|
-
let u = o(() => O(), []), [d, f] = c(
|
|
2328
|
+
function gi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
|
|
2329
|
+
let u = o(() => O(), []), [d, f] = c($r), p = e.screens[0]?.name ?? "", m = o(() => Dr(e.uiProfiles), [e]), h = o(() => p ? di(e, s) : void 0, [
|
|
2324
2330
|
e,
|
|
2325
2331
|
s,
|
|
2326
2332
|
p
|
|
2327
|
-
]), g = o(() => h ?
|
|
2333
|
+
]), g = o(() => h ? Yr(m, h) : [], [m, h]), _ = o(() => h ? Jr(m, h, d) : void 0, [
|
|
2328
2334
|
m,
|
|
2329
2335
|
h,
|
|
2330
2336
|
d
|
|
2331
|
-
]), v = o(() =>
|
|
2337
|
+
]), v = o(() => Zr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => fi(e, i.locales, i.locale, a, i.dictionary, s, y), [
|
|
2332
2338
|
e,
|
|
2333
2339
|
i.locales,
|
|
2334
2340
|
i.locale,
|
|
@@ -2336,9 +2342,9 @@ function hi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2336
2342
|
a,
|
|
2337
2343
|
s,
|
|
2338
2344
|
y
|
|
2339
|
-
]), x = n((e) => f(e), []), S = o(() =>
|
|
2345
|
+
]), x = n((e) => f(e), []), S = o(() => ii(e, l), [e, l]), C = o(() => ({
|
|
2340
2346
|
...e,
|
|
2341
|
-
screens:
|
|
2347
|
+
screens: ci(e.screens, [
|
|
2342
2348
|
...e.screenTemplates,
|
|
2343
2349
|
...e.dialogTemplates ?? [],
|
|
2344
2350
|
...ve,
|
|
@@ -2361,8 +2367,8 @@ function hi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2361
2367
|
registry: t,
|
|
2362
2368
|
initialScreen: p,
|
|
2363
2369
|
history: u,
|
|
2364
|
-
layoutConfigStorage:
|
|
2365
|
-
scope: (t, n) => /* @__PURE__ */ P(
|
|
2370
|
+
layoutConfigStorage: mi(),
|
|
2371
|
+
scope: (t, n) => /* @__PURE__ */ P(_i, {
|
|
2366
2372
|
scene: e,
|
|
2367
2373
|
routeState: r,
|
|
2368
2374
|
strings: i,
|
|
@@ -2372,13 +2378,13 @@ function hi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2372
2378
|
onSystemSchemeChange: x,
|
|
2373
2379
|
children: n
|
|
2374
2380
|
}),
|
|
2375
|
-
renderScreen: (e, n) => /* @__PURE__ */ P(
|
|
2381
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(yi, {
|
|
2376
2382
|
element: e,
|
|
2377
2383
|
configuration: n,
|
|
2378
2384
|
registry: t
|
|
2379
2385
|
}),
|
|
2380
|
-
renderDialog: () => /* @__PURE__ */ P(
|
|
2381
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(
|
|
2386
|
+
renderDialog: () => /* @__PURE__ */ P(or, {}),
|
|
2387
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(bi, {
|
|
2382
2388
|
template: e,
|
|
2383
2389
|
content: n,
|
|
2384
2390
|
registry: t,
|
|
@@ -2390,7 +2396,7 @@ function hi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2390
2396
|
children: [/* @__PURE__ */ P("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ P("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
2391
2397
|
});
|
|
2392
2398
|
}
|
|
2393
|
-
function
|
|
2399
|
+
function _i({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2394
2400
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2395
2401
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2396
2402
|
let e = (e) => {
|
|
@@ -2410,19 +2416,19 @@ function gi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2410
2416
|
}, [p, e]), /* @__PURE__ */ F(de, {
|
|
2411
2417
|
themes: a,
|
|
2412
2418
|
children: [
|
|
2413
|
-
o && /* @__PURE__ */ P(
|
|
2419
|
+
o && /* @__PURE__ */ P(ei, {
|
|
2414
2420
|
settings: o,
|
|
2415
2421
|
onSystemSchemeChange: s
|
|
2416
2422
|
}),
|
|
2417
|
-
/* @__PURE__ */ P(
|
|
2418
|
-
/* @__PURE__ */ P(
|
|
2423
|
+
/* @__PURE__ */ P(Wr, {}),
|
|
2424
|
+
/* @__PURE__ */ P(Ot, {
|
|
2419
2425
|
routes: t.routes,
|
|
2420
2426
|
routesReady: t.ready,
|
|
2421
2427
|
parameters: r.currentParameters,
|
|
2422
2428
|
locale: n.locale,
|
|
2423
2429
|
locales: n.locales,
|
|
2424
2430
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2425
|
-
children: /* @__PURE__ */ P(
|
|
2431
|
+
children: /* @__PURE__ */ P(vi, {
|
|
2426
2432
|
activity: d,
|
|
2427
2433
|
routesReady: t.ready,
|
|
2428
2434
|
scene: e,
|
|
@@ -2434,14 +2440,14 @@ function gi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2434
2440
|
]
|
|
2435
2441
|
});
|
|
2436
2442
|
}
|
|
2437
|
-
function
|
|
2438
|
-
let s =
|
|
2443
|
+
function vi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2444
|
+
let s = z(), c = se(), l = Kt(), d = o(() => si(l, t, s.refreshAfterCommand), [
|
|
2439
2445
|
l,
|
|
2440
2446
|
t,
|
|
2441
2447
|
s.refreshAfterCommand
|
|
2442
|
-
]), f = o(() =>
|
|
2448
|
+
]), f = o(() => ai(n.commandSchemas), [n.commandSchemas]), p = ie({
|
|
2443
2449
|
executeCommand: async (e, n) => {
|
|
2444
|
-
let i =
|
|
2450
|
+
let i = U(e);
|
|
2445
2451
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
2446
2452
|
isSuccess: !1,
|
|
2447
2453
|
validationErrors: []
|
|
@@ -2458,7 +2464,7 @@ function _i({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2458
2464
|
};
|
|
2459
2465
|
},
|
|
2460
2466
|
navigate: (e, t) => {
|
|
2461
|
-
n.screens.some((t) => t.name === e) ?
|
|
2467
|
+
n.screens.some((t) => t.name === e) ? W(e, Jt(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
2462
2468
|
},
|
|
2463
2469
|
navigateBack: () => globalThis.history?.back(),
|
|
2464
2470
|
openDialog: async (e) => {
|
|
@@ -2475,7 +2481,7 @@ function _i({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2475
2481
|
refreshQuery: async (e) => s.refreshQuery(e),
|
|
2476
2482
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
2477
2483
|
});
|
|
2478
|
-
return /* @__PURE__ */ P(
|
|
2484
|
+
return /* @__PURE__ */ P(Ir, {
|
|
2479
2485
|
state: {
|
|
2480
2486
|
locales: i.locales,
|
|
2481
2487
|
locale: i.locale,
|
|
@@ -2500,9 +2506,9 @@ function _i({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2500
2506
|
})
|
|
2501
2507
|
});
|
|
2502
2508
|
}
|
|
2503
|
-
function
|
|
2504
|
-
let r =
|
|
2505
|
-
return /* @__PURE__ */ F(je, { children: [/* @__PURE__ */ P(
|
|
2509
|
+
function yi({ element: e, configuration: t, registry: n }) {
|
|
2510
|
+
let r = z(), i = Bt();
|
|
2511
|
+
return /* @__PURE__ */ F(je, { children: [/* @__PURE__ */ P(yr, { element: e }), /* @__PURE__ */ P(T, {
|
|
2506
2512
|
element: e,
|
|
2507
2513
|
registry: n,
|
|
2508
2514
|
resolveBinding: r.resolveBinding,
|
|
@@ -2511,8 +2517,8 @@ function vi({ element: e, configuration: t, registry: n }) {
|
|
|
2511
2517
|
configuration: t
|
|
2512
2518
|
})] });
|
|
2513
2519
|
}
|
|
2514
|
-
function
|
|
2515
|
-
let o =
|
|
2520
|
+
function bi({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
2521
|
+
let o = z(), s = Bt(), c = y(t, r.dictionary);
|
|
2516
2522
|
return i(() => {
|
|
2517
2523
|
let e = (e) => {
|
|
2518
2524
|
e.key === "Escape" && a();
|
|
@@ -2541,9 +2547,9 @@ function yi({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2541
2547
|
}
|
|
2542
2548
|
//#endregion
|
|
2543
2549
|
//#region src/stageTheme.ts
|
|
2544
|
-
var
|
|
2545
|
-
preset:
|
|
2546
|
-
options: { darkModeSelector:
|
|
2550
|
+
var xi = "[data-scene-color-scheme='dark']", Si = {
|
|
2551
|
+
preset: Ge,
|
|
2552
|
+
options: { darkModeSelector: xi }
|
|
2547
2553
|
};
|
|
2548
2554
|
//#endregion
|
|
2549
|
-
export {
|
|
2555
|
+
export { hi as App, hi as StageApplication, gn as StageCommandForm, Ot as StageDataProvider, Yn as StageGuardedAction, Ye as StageSourceProvider, pi as composeStageScreen, si as createStageSliceInvoker, kt as dataChanged, Wt as executeRegisteredCommand, ot as performQuery, nt as registerQueryRouteResolver, U as registeredCommand, rt as registeredQuery, ai as sliceFieldsFrom, li as stageApplicationRegistry, fi as stageComposition, xi as stageDarkSelector, qe as stageEndpoints, di as stageShellOf, Si as stageTheme, Ke as staticStageSource, st as subscribeQuery, Kt as useStageCommandExecutor, z as useStageData, B as useStageQuery, Xe as useStageSource };
|