@cratis/stage.runtime 4.190.0 → 4.190.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/commandExecutor.d.ts +2 -6
- package/dist/src/hostedBasePath.d.ts +8 -0
- package/dist/src/index.js +452 -432
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -11,13 +11,13 @@ import { resolveCommand as ke, resolveExactQuery as Ae } from "@cratis/scene.com
|
|
|
11
11
|
import { Fragment as je, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
12
12
|
import { Button as I } from "primereact/button";
|
|
13
13
|
import { PrimeDialog as Me, PrimeMessage as Ne, primeReactComponents as Pe, primeReactPackageManifest as Fe } from "@cratis/scene.primereact";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
14
|
+
import { DateOnly as Ie, Guid as Le } from "@cratis/fundamentals";
|
|
15
|
+
import { Command as Re } from "@cratis/arc/commands";
|
|
16
|
+
import { CommandForm as ze, asCommandFormField as Be, withCommandFormFieldBinding as Ve } from "@cratis/arc.react/commands";
|
|
17
|
+
import { CalendarField as He, CheckboxField as Ue, DropdownField as We, InputTextField as Ge, NumberField as Ke } from "@cratis/components/CommandForm";
|
|
18
|
+
import qe from "@primeuix/themes/lara";
|
|
19
19
|
//#region src/stageSource.ts
|
|
20
|
-
function
|
|
20
|
+
function Je(e) {
|
|
21
21
|
return {
|
|
22
22
|
scene: async () => e.scene,
|
|
23
23
|
routes: async () => e.routes,
|
|
@@ -25,23 +25,23 @@ function Ke(e) {
|
|
|
25
25
|
strings: async (t) => e.strings[t] ?? {}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var Ye = {
|
|
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
|
+
}, Xe = e(void 0);
|
|
34
|
+
function Ze({ source: e, children: n }) {
|
|
35
|
+
return t(Xe.Provider, { value: e }, n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let e = r(
|
|
37
|
+
function Qe() {
|
|
38
|
+
let e = r(Xe);
|
|
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
|
+
Ye.routes;
|
|
43
|
+
function $e() {
|
|
44
|
+
let e = Qe(), [t, n] = c({
|
|
45
45
|
routes: void 0,
|
|
46
46
|
ready: !1
|
|
47
47
|
});
|
|
@@ -65,51 +65,65 @@ function Ze() {
|
|
|
65
65
|
function L(e) {
|
|
66
66
|
return typeof e == "object" && e && "id" in e ? e.id : void 0;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function et(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 tt(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) : et(e) === et(t);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
if (t.removed.length > 0 ? L(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) =>
|
|
76
|
+
function nt(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) => tt(L(e), L(t)))).map((e) => t.replaced.find((t) => tt(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
|
+
//#region src/hostedBasePath.ts
|
|
83
|
+
function rt() {
|
|
84
|
+
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
85
|
+
if (!e) return "";
|
|
86
|
+
try {
|
|
87
|
+
return new URL(".", e).pathname.replace(/\/+$/, "");
|
|
88
|
+
} catch {
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function it(e) {
|
|
93
|
+
return e || rt();
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
82
96
|
//#region src/queryExecutor.ts
|
|
83
|
-
var
|
|
84
|
-
function
|
|
85
|
-
|
|
97
|
+
var at;
|
|
98
|
+
function ot(e) {
|
|
99
|
+
at = e;
|
|
86
100
|
}
|
|
87
|
-
function
|
|
101
|
+
function st(e, t) {
|
|
88
102
|
let n = Ae(e);
|
|
89
|
-
return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)),
|
|
103
|
+
return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), ct(n) ? n : t ? at?.(t) : void 0;
|
|
90
104
|
}
|
|
91
|
-
function
|
|
105
|
+
function ct(e) {
|
|
92
106
|
return typeof e == "function" && (e.prototype instanceof Oe || e.prototype instanceof Ee);
|
|
93
107
|
}
|
|
94
|
-
function
|
|
95
|
-
e.setMicroservice(t.microservice), e.setApiBasePath(t.apiBasePath
|
|
108
|
+
function lt(e, t) {
|
|
109
|
+
e.setMicroservice(t.microservice), e.setApiBasePath(it(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = De.noPaging;
|
|
96
110
|
}
|
|
97
|
-
function
|
|
111
|
+
function ut(e, t, n) {
|
|
98
112
|
let r = new e();
|
|
99
|
-
return
|
|
113
|
+
return lt(r, n), r.perform(t);
|
|
100
114
|
}
|
|
101
|
-
function
|
|
115
|
+
function dt(e, t, n, r) {
|
|
102
116
|
let i = new e();
|
|
103
|
-
if (i instanceof Ee) return
|
|
117
|
+
if (i instanceof Ee) return lt(i, n), i.subscribe(r, t);
|
|
104
118
|
}
|
|
105
|
-
function
|
|
119
|
+
function ft(e) {
|
|
106
120
|
if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
107
121
|
}
|
|
108
|
-
var
|
|
122
|
+
var pt = "STAGE-SCENE-ACTION-001", mt = "item.";
|
|
109
123
|
function R(e) {
|
|
110
124
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
111
125
|
}
|
|
112
|
-
function
|
|
126
|
+
function ht(e, t) {
|
|
113
127
|
let n = e;
|
|
114
128
|
for (let e of t.split(".").filter(Boolean)) {
|
|
115
129
|
if (!R(n)) return;
|
|
@@ -117,20 +131,20 @@ function dt(e, t) {
|
|
|
117
131
|
}
|
|
118
132
|
return n;
|
|
119
133
|
}
|
|
120
|
-
function
|
|
134
|
+
function gt(e) {
|
|
121
135
|
return e === null || [
|
|
122
136
|
"string",
|
|
123
137
|
"number",
|
|
124
138
|
"boolean"
|
|
125
139
|
].includes(typeof e);
|
|
126
140
|
}
|
|
127
|
-
function
|
|
141
|
+
function _t(e, t) {
|
|
128
142
|
if (typeof e == "number") return t[e];
|
|
129
143
|
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
130
144
|
}
|
|
131
|
-
function
|
|
145
|
+
function vt(e, t, n, r) {
|
|
132
146
|
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
133
|
-
let i =
|
|
147
|
+
let i = _t(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
134
148
|
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
135
149
|
}
|
|
136
150
|
switch (t) {
|
|
@@ -145,57 +159,57 @@ function mt(e, t, n, r) {
|
|
|
145
159
|
default: return;
|
|
146
160
|
}
|
|
147
161
|
}
|
|
148
|
-
function
|
|
162
|
+
function yt(e, t) {
|
|
149
163
|
if (R(e)) {
|
|
150
164
|
if (e.kind === "comparison") {
|
|
151
|
-
let n =
|
|
152
|
-
if (typeof n != "string" || !n.startsWith(
|
|
165
|
+
let n = ft(e.left);
|
|
166
|
+
if (typeof n != "string" || !n.startsWith(mt) || typeof e.operator != "string" || !gt(e.right)) return;
|
|
153
167
|
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
154
|
-
return
|
|
168
|
+
return vt(ht(t, n.slice(5)), e.operator, e.right, r);
|
|
155
169
|
}
|
|
156
170
|
if (e.kind === "logical") {
|
|
157
|
-
let n =
|
|
171
|
+
let n = yt(e.left, t), r = yt(e.right, t);
|
|
158
172
|
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
159
173
|
}
|
|
160
174
|
}
|
|
161
175
|
}
|
|
162
|
-
function
|
|
163
|
-
return e.every((e) =>
|
|
176
|
+
function bt(e) {
|
|
177
|
+
return e.every((e) => yt(e, {}) !== void 0);
|
|
164
178
|
}
|
|
165
|
-
function
|
|
166
|
-
if (
|
|
179
|
+
function xt(e, t) {
|
|
180
|
+
if (bt(e)) return e.findIndex((e) => yt(e, t) === !0);
|
|
167
181
|
}
|
|
168
|
-
function
|
|
182
|
+
function St(e, t) {
|
|
169
183
|
if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
|
|
170
|
-
let n =
|
|
184
|
+
let n = xt(e.alternatives, t);
|
|
171
185
|
if (n !== void 0) {
|
|
172
186
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
173
187
|
if (e.kind === "otherwise") return n === -1;
|
|
174
188
|
}
|
|
175
189
|
}
|
|
176
|
-
function
|
|
177
|
-
if (e.startsWith(
|
|
190
|
+
function Ct(e, t) {
|
|
191
|
+
if (e.startsWith(mt) && R(t)) return ht(t, e.slice(5));
|
|
178
192
|
}
|
|
179
193
|
//#endregion
|
|
180
194
|
//#region src/stageSession.ts
|
|
181
|
-
var
|
|
182
|
-
function
|
|
195
|
+
var wt = "stage.session.";
|
|
196
|
+
function Tt(e) {
|
|
183
197
|
try {
|
|
184
198
|
return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
|
|
185
199
|
} catch {
|
|
186
200
|
return;
|
|
187
201
|
}
|
|
188
202
|
}
|
|
189
|
-
function
|
|
190
|
-
let t =
|
|
203
|
+
function Et(e) {
|
|
204
|
+
let t = Tt(e);
|
|
191
205
|
if (t) return t;
|
|
192
206
|
let n = globalThis.crypto.randomUUID();
|
|
193
207
|
try {
|
|
194
|
-
globalThis.localStorage?.setItem(`${
|
|
208
|
+
globalThis.localStorage?.setItem(`${wt}${e}`, n);
|
|
195
209
|
} catch {}
|
|
196
210
|
return n;
|
|
197
211
|
}
|
|
198
|
-
function
|
|
212
|
+
function Dt() {
|
|
199
213
|
let e = {};
|
|
200
214
|
try {
|
|
201
215
|
let t = globalThis.localStorage;
|
|
@@ -210,7 +224,7 @@ function Ct() {
|
|
|
210
224
|
}
|
|
211
225
|
//#endregion
|
|
212
226
|
//#region src/stageData.tsx
|
|
213
|
-
var
|
|
227
|
+
var Ot = "cratis.stage.data-changed", kt = e({
|
|
214
228
|
locale: "",
|
|
215
229
|
locales: [],
|
|
216
230
|
screen: "",
|
|
@@ -234,13 +248,13 @@ var wt = "cratis.stage.data-changed", Tt = e({
|
|
|
234
248
|
resolveArgument: () => void 0,
|
|
235
249
|
registerQueryResult: () => void 0,
|
|
236
250
|
refreshVersion: 0
|
|
237
|
-
}),
|
|
251
|
+
}), At = [
|
|
238
252
|
500,
|
|
239
253
|
1500,
|
|
240
254
|
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(() =>
|
|
255
|
+
], jt = {};
|
|
256
|
+
function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, locales: l, screen: u, children: d }) {
|
|
257
|
+
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(() => Rt(te), [te]), ie = n((e, t) => {
|
|
244
258
|
p((n) => {
|
|
245
259
|
if (!t) {
|
|
246
260
|
let { [e]: t, ...r } = n;
|
|
@@ -251,7 +265,7 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
251
265
|
[e]: t
|
|
252
266
|
};
|
|
253
267
|
});
|
|
254
|
-
}, []), O = r, k = o(() =>
|
|
268
|
+
}, []), O = r, k = o(() => Dt(), [m]), ae = o(() => ({
|
|
255
269
|
name: u,
|
|
256
270
|
keys: {
|
|
257
271
|
...k,
|
|
@@ -276,7 +290,7 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
276
290
|
let i = H(r[e]) ? r[e] : {};
|
|
277
291
|
return {
|
|
278
292
|
...r,
|
|
279
|
-
[e]:
|
|
293
|
+
[e]: Lt(i, t.split(".").filter(Boolean), n)
|
|
280
294
|
};
|
|
281
295
|
});
|
|
282
296
|
}, []), A = n((e) => re((t) => ({
|
|
@@ -284,23 +298,23 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
284
298
|
version: t.version + 1
|
|
285
299
|
})), []), le = s([]), ue = n(() => {
|
|
286
300
|
h((e) => e + 1), A();
|
|
287
|
-
for (let e of
|
|
301
|
+
for (let e of At) le.current.push(setTimeout(() => A(), e));
|
|
288
302
|
}, [A]);
|
|
289
303
|
i(() => () => le.current.forEach(clearTimeout), []), i(() => {
|
|
290
304
|
let e = () => A(), t = (e) => A(e.detail?.query);
|
|
291
|
-
return globalThis.addEventListener(
|
|
292
|
-
globalThis.removeEventListener(
|
|
305
|
+
return globalThis.addEventListener(Ot, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
|
|
306
|
+
globalThis.removeEventListener(Ot, e), globalThis.removeEventListener("cratis.scene.refresh", t);
|
|
293
307
|
};
|
|
294
308
|
}, [A]);
|
|
295
309
|
let j = b ? v[b] : void 0, de = n((e) => {
|
|
296
310
|
if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
|
|
297
|
-
if (typeof e == "string") return
|
|
298
|
-
let t =
|
|
311
|
+
if (typeof e == "string") return zt(e, j, v, f, C, O, ae, a, l);
|
|
312
|
+
let t = Pt(j, f, C, {
|
|
299
313
|
...D,
|
|
300
314
|
...T
|
|
301
315
|
}, v);
|
|
302
316
|
if (!e.kind && e.path.startsWith("component.")) return _(e.path, t);
|
|
303
|
-
if (!e.kind) return
|
|
317
|
+
if (!e.kind) return zt(e.path, j, v, f, C, O, ae, a, l);
|
|
304
318
|
let n = x(e, t);
|
|
305
319
|
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), g(t)(e);
|
|
306
320
|
}, [
|
|
@@ -314,7 +328,7 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
314
328
|
ae,
|
|
315
329
|
j,
|
|
316
330
|
v
|
|
317
|
-
]), M = n((e) => e ? _(e,
|
|
331
|
+
]), M = n((e) => e ? _(e, Pt(j, f, C, {
|
|
318
332
|
...D,
|
|
319
333
|
...T
|
|
320
334
|
}, v)) : void 0, [
|
|
@@ -331,7 +345,7 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
331
345
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
332
346
|
let n = { ...t };
|
|
333
347
|
return delete n[e], n;
|
|
334
|
-
}), []), me = o(() =>
|
|
348
|
+
}), []), me = o(() => Pt(void 0, f, {}, {}, {}).queryResults, [f]), he = o(() => ({
|
|
335
349
|
locale: a,
|
|
336
350
|
locales: l,
|
|
337
351
|
screen: u,
|
|
@@ -344,7 +358,7 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
344
358
|
selections: v,
|
|
345
359
|
selectRow: oe,
|
|
346
360
|
clearSelection: se,
|
|
347
|
-
setState: (e, t) => w((n) =>
|
|
361
|
+
setState: (e, t) => w((n) => Lt(n, e.split(".").filter(Boolean), t)),
|
|
348
362
|
setComponentOutput: ce,
|
|
349
363
|
publishComponentOutputs: fe,
|
|
350
364
|
withdrawComponentOutputs: pe,
|
|
@@ -381,12 +395,12 @@ function Ot({ routes: e, routesReady: t = !0, parameters: r = Dt, locale: a, loc
|
|
|
381
395
|
v,
|
|
382
396
|
ce
|
|
383
397
|
]);
|
|
384
|
-
return /* @__PURE__ */ P(
|
|
398
|
+
return /* @__PURE__ */ P(kt.Provider, {
|
|
385
399
|
value: he,
|
|
386
400
|
children: d
|
|
387
401
|
});
|
|
388
402
|
}
|
|
389
|
-
var z = () => r(
|
|
403
|
+
var z = () => r(kt);
|
|
390
404
|
function B(e) {
|
|
391
405
|
let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } = z(), l = r(Te), u = e.publish !== !1, d = n((e, t) => {
|
|
392
406
|
u && o(e, t);
|
|
@@ -398,21 +412,21 @@ function B(e) {
|
|
|
398
412
|
}
|
|
399
413
|
let t = b.current + 1;
|
|
400
414
|
b.current = t;
|
|
401
|
-
let n = new AbortController(), r = JSON.parse(w), i =
|
|
415
|
+
let n = new AbortController(), r = JSON.parse(w), i = st(e.name ?? "", e.route);
|
|
402
416
|
_(!0), h("");
|
|
403
417
|
let a = (e) => {
|
|
404
418
|
b.current !== t || n.signal.aborted || (x.current = !1, p([]), h(e instanceof Error ? e.message : String(e)), _(!1));
|
|
405
419
|
}, o = [], s = (e) => {
|
|
406
420
|
if (b.current !== t || n.signal.aborted) return;
|
|
407
|
-
let r =
|
|
421
|
+
let r = Ht(e);
|
|
408
422
|
if (r) {
|
|
409
423
|
a(Error(r));
|
|
410
424
|
return;
|
|
411
425
|
}
|
|
412
|
-
e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ?
|
|
426
|
+
e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? nt(o, e.changeSet) : e.data, p(Ut(o)), h(""), _(!1));
|
|
413
427
|
};
|
|
414
428
|
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(() =>
|
|
429
|
+
let c = i.prototype instanceof Ee, u = () => Promise.resolve().then(() => ut(i, c ? {
|
|
416
430
|
...r,
|
|
417
431
|
waitForFirstResult: !0
|
|
418
432
|
} : r, l)).then(s).catch(a);
|
|
@@ -422,7 +436,7 @@ function B(e) {
|
|
|
422
436
|
b.current !== t || n.signal.aborted || (x.current = !1, f?.unsubscribe(), f = void 0, u());
|
|
423
437
|
}, 15e3);
|
|
424
438
|
try {
|
|
425
|
-
f =
|
|
439
|
+
f = dt(i, r, l, (e) => {
|
|
426
440
|
e.isReady !== !1 && globalThis.clearTimeout(m), s(e);
|
|
427
441
|
});
|
|
428
442
|
} catch {
|
|
@@ -483,29 +497,29 @@ function B(e) {
|
|
|
483
497
|
}
|
|
484
498
|
};
|
|
485
499
|
}
|
|
486
|
-
function
|
|
487
|
-
globalThis.dispatchEvent(new CustomEvent(
|
|
500
|
+
function Nt() {
|
|
501
|
+
globalThis.dispatchEvent(new CustomEvent(Ot));
|
|
488
502
|
}
|
|
489
|
-
function
|
|
503
|
+
function Pt(e, t, n, r, i) {
|
|
490
504
|
let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
|
|
491
505
|
return {
|
|
492
506
|
dataContext: e,
|
|
493
507
|
queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
|
|
494
|
-
let n = t.list ? t.rows :
|
|
508
|
+
let n = t.list ? t.rows : Ft(t.rows);
|
|
495
509
|
return [
|
|
496
510
|
[e, n],
|
|
497
511
|
...t.name ? [[t.name, n]] : [],
|
|
498
512
|
...t.alias ? [[t.alias, n]] : []
|
|
499
513
|
];
|
|
500
514
|
})),
|
|
501
|
-
componentOutputs:
|
|
515
|
+
componentOutputs: It(r, i),
|
|
502
516
|
state: n
|
|
503
517
|
};
|
|
504
518
|
}
|
|
505
|
-
function
|
|
519
|
+
function Ft(e) {
|
|
506
520
|
return e.length === 1 ? e[0] : e;
|
|
507
521
|
}
|
|
508
|
-
function
|
|
522
|
+
function It(e, t) {
|
|
509
523
|
let n = { ...e };
|
|
510
524
|
for (let [e, r] of Object.entries(t)) r && (n[e] = {
|
|
511
525
|
...r,
|
|
@@ -513,17 +527,17 @@ function Mt(e, t) {
|
|
|
513
527
|
});
|
|
514
528
|
return n;
|
|
515
529
|
}
|
|
516
|
-
function
|
|
530
|
+
function Lt(e, t, n) {
|
|
517
531
|
let [r, ...i] = t;
|
|
518
532
|
return r ? i.length === 0 ? {
|
|
519
533
|
...e,
|
|
520
534
|
[r]: n
|
|
521
535
|
} : {
|
|
522
536
|
...e,
|
|
523
|
-
[r]:
|
|
537
|
+
[r]: Lt(H(e[r]) ? e[r] : {}, i, n)
|
|
524
538
|
} : e;
|
|
525
539
|
}
|
|
526
|
-
function
|
|
540
|
+
function Rt(e) {
|
|
527
541
|
let t = {};
|
|
528
542
|
for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
|
|
529
543
|
...t[e],
|
|
@@ -531,7 +545,7 @@ function Pt(e) {
|
|
|
531
545
|
};
|
|
532
546
|
return t;
|
|
533
547
|
}
|
|
534
|
-
function
|
|
548
|
+
function zt(e, t, n, r, i, a, o, s, c) {
|
|
535
549
|
if (!e) return;
|
|
536
550
|
let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
|
|
537
551
|
if (l.length !== 0) {
|
|
@@ -540,20 +554,20 @@ function Ft(e, t, n, r, i, a, o, s, c) {
|
|
|
540
554
|
let e = V(o, l.slice(1));
|
|
541
555
|
return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
|
|
542
556
|
}
|
|
543
|
-
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ?
|
|
557
|
+
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Vt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Bt(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) ?? Vt(r, void 0, l.join(".")) ?? V(i, l);
|
|
544
558
|
}
|
|
545
559
|
}
|
|
546
|
-
function
|
|
560
|
+
function Bt(e, t, n) {
|
|
547
561
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
548
562
|
return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
|
|
549
563
|
}
|
|
550
|
-
function
|
|
564
|
+
function Vt(e, t, n) {
|
|
551
565
|
let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
|
|
552
566
|
if (r.length === 0) return;
|
|
553
567
|
let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
|
|
554
568
|
return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
|
|
555
569
|
}
|
|
556
|
-
function
|
|
570
|
+
function Ht(e) {
|
|
557
571
|
if (!H(e)) return "";
|
|
558
572
|
if (e.isAuthorized === !1) return "The query answered 403.";
|
|
559
573
|
if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
|
|
@@ -562,7 +576,7 @@ function Rt(e) {
|
|
|
562
576
|
}
|
|
563
577
|
return "";
|
|
564
578
|
}
|
|
565
|
-
function
|
|
579
|
+
function Ut(e) {
|
|
566
580
|
return Array.isArray(e) ? e.filter(H) : H(e) ? [e] : [];
|
|
567
581
|
}
|
|
568
582
|
function V(e, t) {
|
|
@@ -578,7 +592,7 @@ function H(e) {
|
|
|
578
592
|
}
|
|
579
593
|
//#endregion
|
|
580
594
|
//#region src/stageComponentOutputs.ts
|
|
581
|
-
function
|
|
595
|
+
function Wt() {
|
|
582
596
|
let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } = z();
|
|
583
597
|
return i(() => () => r(e), [e, r]), n((n) => t(e, n), [t, e]);
|
|
584
598
|
}
|
|
@@ -592,25 +606,16 @@ function U(e, t, n) {
|
|
|
592
606
|
]) {
|
|
593
607
|
if (!r) continue;
|
|
594
608
|
let t = ke(r);
|
|
595
|
-
if (
|
|
609
|
+
if (Gt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
596
610
|
}
|
|
597
611
|
}
|
|
598
|
-
function
|
|
599
|
-
return typeof e == "function" && e.prototype instanceof
|
|
600
|
-
}
|
|
601
|
-
function Ht() {
|
|
602
|
-
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
603
|
-
if (!e) return "";
|
|
604
|
-
try {
|
|
605
|
-
return new URL(".", e).pathname.replace(/\/+$/, "");
|
|
606
|
-
} catch {
|
|
607
|
-
return "";
|
|
608
|
-
}
|
|
612
|
+
function Gt(e) {
|
|
613
|
+
return typeof e == "function" && e.prototype instanceof Re;
|
|
609
614
|
}
|
|
610
|
-
function
|
|
611
|
-
return e.setApiBasePath(t
|
|
615
|
+
function Kt(e, t) {
|
|
616
|
+
return e.setApiBasePath(it(t)), e;
|
|
612
617
|
}
|
|
613
|
-
async function
|
|
618
|
+
async function qt(e, t, n) {
|
|
614
619
|
let r = U(e);
|
|
615
620
|
if (!r) return {
|
|
616
621
|
isSuccess: !1,
|
|
@@ -618,11 +623,11 @@ async function Wt(e, t, n) {
|
|
|
618
623
|
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
619
624
|
};
|
|
620
625
|
let i = new r();
|
|
621
|
-
i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath
|
|
626
|
+
i.setMicroservice(n.microservice), i.setApiBasePath(it(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
622
627
|
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
623
|
-
return
|
|
628
|
+
return Jt(e, await i.execute());
|
|
624
629
|
}
|
|
625
|
-
function
|
|
630
|
+
function Jt(e, t) {
|
|
626
631
|
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
632
|
member: t,
|
|
628
633
|
message: e.message
|
|
@@ -638,53 +643,53 @@ function Gt(e, t) {
|
|
|
638
643
|
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
639
644
|
};
|
|
640
645
|
}
|
|
641
|
-
function
|
|
646
|
+
function Yt() {
|
|
642
647
|
let e = r(Te);
|
|
643
|
-
return n((t, n) =>
|
|
648
|
+
return n((t, n) => qt(t, n, e), [e]);
|
|
644
649
|
}
|
|
645
650
|
//#endregion
|
|
646
651
|
//#region src/stageNavigation.ts
|
|
647
|
-
function
|
|
652
|
+
function Xt(e, t = {}) {
|
|
648
653
|
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
649
654
|
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
650
655
|
}
|
|
651
656
|
function W(e, t = {}) {
|
|
652
657
|
if (!globalThis.location) return;
|
|
653
|
-
let n =
|
|
658
|
+
let n = Xt(e, t);
|
|
654
659
|
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
655
660
|
}
|
|
656
|
-
function
|
|
657
|
-
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof
|
|
661
|
+
function Zt(e) {
|
|
662
|
+
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Le)).map(([e, t]) => [e, String(t)]));
|
|
658
663
|
}
|
|
659
664
|
//#endregion
|
|
660
665
|
//#region src/stageFormSchema.ts
|
|
661
|
-
var
|
|
662
|
-
function
|
|
666
|
+
var Qt = 8;
|
|
667
|
+
function $t(e) {
|
|
663
668
|
if (!e) return [];
|
|
664
669
|
try {
|
|
665
|
-
return
|
|
670
|
+
return en(JSON.parse(e), 0);
|
|
666
671
|
} catch {
|
|
667
672
|
return [];
|
|
668
673
|
}
|
|
669
674
|
}
|
|
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]) =>
|
|
675
|
+
function en(e, t) {
|
|
676
|
+
let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = ln(e.properties) ? e.properties : {};
|
|
677
|
+
return Object.entries(i).map(([e, i]) => tn(e, i, !n || r.has(e), t));
|
|
673
678
|
}
|
|
674
|
-
function
|
|
679
|
+
function tn(e, t, n, r) {
|
|
675
680
|
return {
|
|
676
681
|
name: e,
|
|
677
682
|
identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
678
683
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
679
684
|
required: n,
|
|
680
|
-
|
|
685
|
+
...nn(t, r)
|
|
681
686
|
};
|
|
682
687
|
}
|
|
683
|
-
function
|
|
688
|
+
function nn(e, t) {
|
|
684
689
|
let n = e?.type;
|
|
685
690
|
if (Array.isArray(n)) {
|
|
686
691
|
let r = n.filter((e) => e !== "null");
|
|
687
|
-
return r.length === 1 ?
|
|
692
|
+
return r.length === 1 ? nn({
|
|
688
693
|
...e,
|
|
689
694
|
type: r[0]
|
|
690
695
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -695,8 +700,8 @@ function $t(e, t) {
|
|
|
695
700
|
type: "date",
|
|
696
701
|
withTime: e.format === "date-time"
|
|
697
702
|
};
|
|
698
|
-
if (n === "array") return
|
|
699
|
-
if (n === "object") return
|
|
703
|
+
if (n === "array") return rn(e, t);
|
|
704
|
+
if (n === "object") return an(e, t);
|
|
700
705
|
if (n === void 0 || n === "string") {
|
|
701
706
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
702
707
|
return t.length > 0 ? {
|
|
@@ -706,54 +711,54 @@ function $t(e, t) {
|
|
|
706
711
|
}
|
|
707
712
|
return { unsupportedReason: `type ${String(n)}` };
|
|
708
713
|
}
|
|
709
|
-
function
|
|
714
|
+
function rn(e, t) {
|
|
710
715
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
711
|
-
if (t >=
|
|
712
|
-
let r =
|
|
716
|
+
if (t >= Qt || e?.items === void 0) return n;
|
|
717
|
+
let r = tn("", e.items, !0, t + 1);
|
|
713
718
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
714
719
|
}
|
|
715
|
-
function
|
|
720
|
+
function an(e, t) {
|
|
716
721
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
717
|
-
if (t >=
|
|
718
|
-
let r =
|
|
722
|
+
if (t >= Qt || !ln(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
723
|
+
let r = en(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
719
724
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
720
725
|
}
|
|
721
726
|
function G(e) {
|
|
722
727
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
|
723
728
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
724
729
|
}
|
|
725
|
-
function
|
|
730
|
+
function on(e, t, n) {
|
|
726
731
|
if (t != null) {
|
|
727
|
-
if (e.members &&
|
|
732
|
+
if (e.members && ln(t)) for (let r of e.members) {
|
|
728
733
|
let e = t[r.name], i = G(r.name);
|
|
729
|
-
if (
|
|
734
|
+
if (sn(e)) {
|
|
730
735
|
if (r.required) return `${n}: ${i} is required`;
|
|
731
736
|
continue;
|
|
732
737
|
}
|
|
733
|
-
let a =
|
|
738
|
+
let a = on(r, e, `${n} ${i.toLowerCase()}`);
|
|
734
739
|
if (a) return a;
|
|
735
740
|
}
|
|
736
741
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
737
|
-
let t =
|
|
742
|
+
let t = sn(i) ? `${n} ${r + 1} is required` : on(e.item, i, `${n} ${r + 1}`);
|
|
738
743
|
if (t) return t;
|
|
739
744
|
}
|
|
740
745
|
}
|
|
741
746
|
}
|
|
742
|
-
function
|
|
747
|
+
function sn(e) {
|
|
743
748
|
return e == null || e === "";
|
|
744
749
|
}
|
|
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 &&
|
|
750
|
+
function cn(e, t) {
|
|
751
|
+
return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && ln(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
747
752
|
let r = e.members?.find((e) => e.name === t);
|
|
748
|
-
return [t, r ?
|
|
749
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
753
|
+
return [t, r ? cn(r, n) : n];
|
|
754
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => cn(e.item, t)) : t;
|
|
750
755
|
}
|
|
751
|
-
function
|
|
756
|
+
function ln(e) {
|
|
752
757
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
753
758
|
}
|
|
754
759
|
//#endregion
|
|
755
760
|
//#region src/StageValueFields.tsx
|
|
756
|
-
var
|
|
761
|
+
var un = Be((e) => /* @__PURE__ */ P(dn, {
|
|
757
762
|
descriptor: e.descriptor,
|
|
758
763
|
label: e.title ?? G(e.descriptor.name),
|
|
759
764
|
value: e.value,
|
|
@@ -761,22 +766,22 @@ var sn = Re((e) => /* @__PURE__ */ P(cn, {
|
|
|
761
766
|
onBlur: e.onBlur,
|
|
762
767
|
invalid: e.invalid
|
|
763
768
|
}), { defaultValue: void 0 });
|
|
764
|
-
function
|
|
765
|
-
return e.members ? /* @__PURE__ */ P(
|
|
769
|
+
function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
770
|
+
return e.members ? /* @__PURE__ */ P(fn, {
|
|
766
771
|
descriptor: e,
|
|
767
772
|
label: t,
|
|
768
773
|
value: n,
|
|
769
774
|
onChange: r,
|
|
770
775
|
onBlur: i,
|
|
771
776
|
invalid: a
|
|
772
|
-
}) : e.item ? /* @__PURE__ */ P(
|
|
777
|
+
}) : e.item ? /* @__PURE__ */ P(pn, {
|
|
773
778
|
descriptor: e,
|
|
774
779
|
label: t,
|
|
775
780
|
value: n,
|
|
776
781
|
onChange: r,
|
|
777
782
|
onBlur: i,
|
|
778
783
|
invalid: a
|
|
779
|
-
}) : /* @__PURE__ */ P(
|
|
784
|
+
}) : /* @__PURE__ */ P(mn, {
|
|
780
785
|
descriptor: e,
|
|
781
786
|
label: t,
|
|
782
787
|
value: n,
|
|
@@ -785,12 +790,12 @@ function cn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
785
790
|
invalid: a
|
|
786
791
|
});
|
|
787
792
|
}
|
|
788
|
-
function
|
|
789
|
-
let o =
|
|
793
|
+
function fn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
794
|
+
let o = _n(n) ? n : {};
|
|
790
795
|
return /* @__PURE__ */ F("fieldset", {
|
|
791
796
|
className: "stage-record-field",
|
|
792
797
|
"data-invalid": a ? "true" : void 0,
|
|
793
|
-
children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(
|
|
798
|
+
children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(dn, {
|
|
794
799
|
descriptor: e,
|
|
795
800
|
label: G(e.name),
|
|
796
801
|
value: o[e.name],
|
|
@@ -802,7 +807,7 @@ function ln({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
802
807
|
}, e.name))]
|
|
803
808
|
});
|
|
804
809
|
}
|
|
805
|
-
function
|
|
810
|
+
function pn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
806
811
|
let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
|
|
807
812
|
return /* @__PURE__ */ F("fieldset", {
|
|
808
813
|
className: "stage-list-field",
|
|
@@ -815,7 +820,7 @@ function un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
815
820
|
}),
|
|
816
821
|
s.map((e, n) => /* @__PURE__ */ F("div", {
|
|
817
822
|
className: "stage-list-field__row",
|
|
818
|
-
children: [/* @__PURE__ */ P(
|
|
823
|
+
children: [/* @__PURE__ */ P(dn, {
|
|
819
824
|
descriptor: o,
|
|
820
825
|
label: `${t} ${n + 1}`,
|
|
821
826
|
value: e,
|
|
@@ -831,13 +836,13 @@ function un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
831
836
|
/* @__PURE__ */ P("button", {
|
|
832
837
|
type: "button",
|
|
833
838
|
"aria-label": `Add ${t}`,
|
|
834
|
-
onClick: () => c([...s,
|
|
839
|
+
onClick: () => c([...s, hn(o)]),
|
|
835
840
|
children: "Add"
|
|
836
841
|
})
|
|
837
842
|
]
|
|
838
843
|
});
|
|
839
844
|
}
|
|
840
|
-
function
|
|
845
|
+
function mn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
841
846
|
let o = {
|
|
842
847
|
"aria-invalid": a ? !0 : void 0,
|
|
843
848
|
onBlur: i
|
|
@@ -883,7 +888,7 @@ function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
883
888
|
...o,
|
|
884
889
|
type: e.withTime ? "datetime-local" : "date",
|
|
885
890
|
value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
|
|
886
|
-
onChange: (t) => r(t.target.value === "" ? void 0 :
|
|
891
|
+
onChange: (t) => r(t.target.value === "" ? void 0 : gn(t.target.value, e.withTime === !0))
|
|
887
892
|
})]
|
|
888
893
|
});
|
|
889
894
|
default: return /* @__PURE__ */ F("label", {
|
|
@@ -897,40 +902,40 @@ function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
897
902
|
});
|
|
898
903
|
}
|
|
899
904
|
}
|
|
900
|
-
function
|
|
905
|
+
function hn(e) {
|
|
901
906
|
return e.members ? {} : void 0;
|
|
902
907
|
}
|
|
903
|
-
function
|
|
908
|
+
function gn(e, t) {
|
|
904
909
|
if (!t) return e;
|
|
905
910
|
let n = new Date(e);
|
|
906
911
|
return Number.isNaN(n.getTime()) ? e : n.toISOString();
|
|
907
912
|
}
|
|
908
|
-
function
|
|
913
|
+
function _n(e) {
|
|
909
914
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
910
915
|
}
|
|
911
916
|
//#endregion
|
|
912
917
|
//#region src/StageCommandForm.tsx
|
|
913
|
-
var
|
|
914
|
-
function
|
|
915
|
-
let t = z(), n = r(Te), i = r(
|
|
918
|
+
var vn = e(void 0);
|
|
919
|
+
function yn({ element: e }) {
|
|
920
|
+
let t = z(), n = r(Te), i = r(vn), a = o(() => xn(e), [e]), s = o(() => Kn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? Sn(a, s) : [], [a, s]), d = a ? U(a.command, q(e, "typeName"), q(e, "route")) : void 0, f = Fn(e, u, t.resolveArgument), p = Nn(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
921
|
...h,
|
|
917
|
-
...
|
|
918
|
-
...
|
|
922
|
+
...On(u, s, t.parameters, g),
|
|
923
|
+
...Dn(u, t.parameters)
|
|
919
924
|
}), [
|
|
920
925
|
h,
|
|
921
926
|
u,
|
|
922
927
|
s,
|
|
923
928
|
t.parameters,
|
|
924
929
|
g
|
|
925
|
-
]), v = o(() => a ?
|
|
930
|
+
]), v = o(() => a ? Cn(a, u, s) : void 0, [
|
|
926
931
|
a,
|
|
927
932
|
u,
|
|
928
933
|
s
|
|
929
|
-
]), y = o(() => a ?
|
|
934
|
+
]), y = o(() => a ? Wn(u, s) : [], [
|
|
930
935
|
a,
|
|
931
936
|
u,
|
|
932
937
|
s
|
|
933
|
-
]), b = o(() => a ?
|
|
938
|
+
]), b = o(() => a ? Gn(a.layout, u) : [], [a, u]), [x, S] = c([]);
|
|
934
939
|
return a ? !d && !t.routesReady ? /* @__PURE__ */ F("p", {
|
|
935
940
|
className: "stage-note",
|
|
936
941
|
children: [
|
|
@@ -938,27 +943,27 @@ function gn({ element: e }) {
|
|
|
938
943
|
a.command,
|
|
939
944
|
"” is waiting for Stage routes."
|
|
940
945
|
]
|
|
941
|
-
}) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(
|
|
946
|
+
}) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(bn, {
|
|
942
947
|
form: a,
|
|
943
948
|
messages: [`The modeled command “${a.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
944
|
-
}) : y.length > 0 ? /* @__PURE__ */ P(
|
|
949
|
+
}) : y.length > 0 ? /* @__PURE__ */ P(bn, {
|
|
945
950
|
form: a,
|
|
946
951
|
messages: y
|
|
947
952
|
}) : /* @__PURE__ */ P("section", {
|
|
948
953
|
className: "stage-command-form",
|
|
949
954
|
"data-command": a.command,
|
|
950
955
|
"data-generation-mode": a.generationMode,
|
|
951
|
-
children: /* @__PURE__ */ F(
|
|
956
|
+
children: /* @__PURE__ */ F(ze, {
|
|
952
957
|
command: d,
|
|
953
958
|
initialValues: _,
|
|
954
959
|
currentValues: f,
|
|
955
960
|
validateOn: "both",
|
|
956
961
|
validateAllFieldsOnChange: !0,
|
|
957
|
-
onBeforeExecute: (e) =>
|
|
958
|
-
onFieldValidate: (e, t, n, r) =>
|
|
962
|
+
onBeforeExecute: (e) => Kt(e, n.apiBasePath),
|
|
963
|
+
onFieldValidate: (e, t, n, r) => Un(u, s, t, r),
|
|
959
964
|
onValidationFailure: (e) => S(e.map((e) => e.message)),
|
|
960
965
|
onException: (e) => S(e),
|
|
961
|
-
onFailed: (e) => S(
|
|
966
|
+
onFailed: (e) => S(Jt(a.command, e).messages),
|
|
962
967
|
onSuccess: () => {
|
|
963
968
|
S([]), t.refreshAfterCommand();
|
|
964
969
|
let n = q(e, "navigateToScreen");
|
|
@@ -994,7 +999,7 @@ function gn({ element: e }) {
|
|
|
994
999
|
children: "This form is missing its command metadata."
|
|
995
1000
|
});
|
|
996
1001
|
}
|
|
997
|
-
function
|
|
1002
|
+
function bn({ form: e, messages: t }) {
|
|
998
1003
|
return /* @__PURE__ */ P("section", {
|
|
999
1004
|
className: "stage-command-form",
|
|
1000
1005
|
"data-command": e.command,
|
|
@@ -1006,7 +1011,7 @@ function _n({ form: e, messages: t }) {
|
|
|
1006
1011
|
}, e))
|
|
1007
1012
|
});
|
|
1008
1013
|
}
|
|
1009
|
-
function
|
|
1014
|
+
function xn(e) {
|
|
1010
1015
|
let t = q(e, "command");
|
|
1011
1016
|
if (!t) return;
|
|
1012
1017
|
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(J) : [];
|
|
@@ -1014,21 +1019,21 @@ function vn(e) {
|
|
|
1014
1019
|
command: t,
|
|
1015
1020
|
label: q(e, "label", t),
|
|
1016
1021
|
fields: n,
|
|
1017
|
-
generationMode:
|
|
1018
|
-
layout:
|
|
1022
|
+
generationMode: Ln(e.properties.generationMode),
|
|
1023
|
+
layout: Rn(e.properties.layout)
|
|
1019
1024
|
};
|
|
1020
1025
|
}
|
|
1021
|
-
function
|
|
1026
|
+
function Sn(e, t) {
|
|
1022
1027
|
return e.generationMode === d.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1023
1028
|
name: e.name,
|
|
1024
1029
|
label: e.name
|
|
1025
1030
|
}));
|
|
1026
1031
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let r = e.layout, i = r ?
|
|
1029
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
1030
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1031
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1032
|
+
function Cn(e, t, n) {
|
|
1033
|
+
let r = e.layout, i = r ? zn(r, t) : [];
|
|
1034
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => wn(e, n));
|
|
1035
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Bn(r, i), s = {
|
|
1036
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => Vn(t + 1, r.columns)).join(" "),
|
|
1032
1037
|
columnGap: K(r.columnGap),
|
|
1033
1038
|
rowGap: K(r.rowGap)
|
|
1034
1039
|
}, c = /* @__PURE__ */ new Set();
|
|
@@ -1037,18 +1042,18 @@ function bn(e, t, n) {
|
|
|
1037
1042
|
style: s,
|
|
1038
1043
|
children: [i.map((e) => {
|
|
1039
1044
|
let t = a.get(e.field);
|
|
1040
|
-
return t ? (c.add(t.name),
|
|
1041
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
1045
|
+
return t ? (c.add(t.name), wn(t, n, e)) : null;
|
|
1046
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => wn(e, n))]
|
|
1042
1047
|
});
|
|
1043
1048
|
}
|
|
1044
|
-
function
|
|
1049
|
+
function wn(e, t, n) {
|
|
1045
1050
|
let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
|
|
1046
1051
|
if (i?.options) {
|
|
1047
1052
|
let e = i.options.map((e) => ({
|
|
1048
1053
|
value: e,
|
|
1049
1054
|
label: G(e)
|
|
1050
1055
|
}));
|
|
1051
|
-
return /* @__PURE__ */ P(
|
|
1056
|
+
return /* @__PURE__ */ P(We, {
|
|
1052
1057
|
value: o,
|
|
1053
1058
|
fieldName: r,
|
|
1054
1059
|
title: a,
|
|
@@ -1058,7 +1063,7 @@ function xn(e, t, n) {
|
|
|
1058
1063
|
optionLabel: "label"
|
|
1059
1064
|
});
|
|
1060
1065
|
}
|
|
1061
|
-
if (i?.members || i?.item) return /* @__PURE__ */ P(
|
|
1066
|
+
if (i?.members || i?.item) return /* @__PURE__ */ P(un, {
|
|
1062
1067
|
value: o,
|
|
1063
1068
|
fieldName: r,
|
|
1064
1069
|
title: a,
|
|
@@ -1066,33 +1071,34 @@ function xn(e, t, n) {
|
|
|
1066
1071
|
descriptor: i
|
|
1067
1072
|
});
|
|
1068
1073
|
switch (i?.type ?? "text") {
|
|
1069
|
-
case "number": return /* @__PURE__ */ P(
|
|
1074
|
+
case "number": return /* @__PURE__ */ P(Ke, {
|
|
1070
1075
|
value: o,
|
|
1071
1076
|
fieldName: r,
|
|
1072
1077
|
title: a,
|
|
1073
1078
|
required: s
|
|
1074
1079
|
});
|
|
1075
|
-
case "boolean": return /* @__PURE__ */ P(
|
|
1080
|
+
case "boolean": return /* @__PURE__ */ P(Ue, {
|
|
1076
1081
|
value: o,
|
|
1077
1082
|
fieldName: r,
|
|
1078
1083
|
label: a,
|
|
1079
1084
|
required: s
|
|
1080
1085
|
});
|
|
1081
|
-
case "date": return /* @__PURE__ */ P(
|
|
1086
|
+
case "date": return /* @__PURE__ */ P(Tn, {
|
|
1082
1087
|
value: o,
|
|
1083
1088
|
fieldName: r,
|
|
1084
1089
|
title: a,
|
|
1085
1090
|
required: s,
|
|
1086
|
-
showIcon: !0
|
|
1091
|
+
showIcon: !0,
|
|
1092
|
+
showTime: i?.withTime
|
|
1087
1093
|
});
|
|
1088
|
-
default: return /* @__PURE__ */ P(
|
|
1094
|
+
default: return /* @__PURE__ */ P(Ge, {
|
|
1089
1095
|
value: o,
|
|
1090
1096
|
fieldName: r,
|
|
1091
1097
|
title: a,
|
|
1092
1098
|
required: s
|
|
1093
1099
|
});
|
|
1094
1100
|
}
|
|
1095
|
-
})(), l =
|
|
1101
|
+
})(), l = Hn(n);
|
|
1096
1102
|
return /* @__PURE__ */ P("span", {
|
|
1097
1103
|
className: "stage-command-form__field",
|
|
1098
1104
|
"data-field": e.name,
|
|
@@ -1103,7 +1109,21 @@ function xn(e, t, n) {
|
|
|
1103
1109
|
children: c
|
|
1104
1110
|
}, e.name);
|
|
1105
1111
|
}
|
|
1106
|
-
|
|
1112
|
+
var Tn = Ve((e) => /* @__PURE__ */ P(He, {
|
|
1113
|
+
...e,
|
|
1114
|
+
currentValue: e.showTime ? e.currentValue : En(e.currentValue),
|
|
1115
|
+
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ie.fromDate(t) : t)
|
|
1116
|
+
}));
|
|
1117
|
+
function En(e) {
|
|
1118
|
+
if (e instanceof Ie) return e.toDate();
|
|
1119
|
+
if (typeof e != "string") return e;
|
|
1120
|
+
try {
|
|
1121
|
+
return Ie.parse(e).toDate();
|
|
1122
|
+
} catch {
|
|
1123
|
+
return null;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
function Dn(e, t) {
|
|
1107
1127
|
let n = {};
|
|
1108
1128
|
for (let r of e) {
|
|
1109
1129
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1111,32 +1131,32 @@ function Sn(e, t) {
|
|
|
1111
1131
|
}
|
|
1112
1132
|
return n;
|
|
1113
1133
|
}
|
|
1114
|
-
function
|
|
1134
|
+
function On(e, t, n, r = []) {
|
|
1115
1135
|
let i = new Set(e.map((e) => e.sourceProperty ?? e.name)), a = t.some((e) => e.identity), o = {};
|
|
1116
1136
|
for (let e of t) {
|
|
1117
1137
|
if (!e.identifier || !e.required || i.has(e.name)) continue;
|
|
1118
|
-
let t =
|
|
1138
|
+
let t = An(e, n) ?? jn(e, r) ?? (e.identity || !a ? Et(e.identifier) : void 0);
|
|
1119
1139
|
t !== void 0 && (o[e.name] = t);
|
|
1120
1140
|
}
|
|
1121
1141
|
return o;
|
|
1122
1142
|
}
|
|
1123
|
-
function
|
|
1124
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 ||
|
|
1143
|
+
function kn(e, t) {
|
|
1144
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || An(e, t) !== void 0;
|
|
1125
1145
|
}
|
|
1126
|
-
function
|
|
1127
|
-
if (e.identifier) return t[e.name] ||
|
|
1146
|
+
function An(e, t) {
|
|
1147
|
+
if (e.identifier) return t[e.name] || Tt(e.identifier);
|
|
1128
1148
|
}
|
|
1129
|
-
function
|
|
1149
|
+
function jn(e, t) {
|
|
1130
1150
|
if (!e.identifier) return;
|
|
1131
1151
|
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1132
1152
|
return n.size === 1 ? [...n][0] : void 0;
|
|
1133
1153
|
}
|
|
1134
|
-
function
|
|
1154
|
+
function Mn(e) {
|
|
1135
1155
|
let t = e.properties.populateSource;
|
|
1136
1156
|
return J(t) ? t : void 0;
|
|
1137
1157
|
}
|
|
1138
|
-
function
|
|
1139
|
-
let r =
|
|
1158
|
+
function Nn(e, t, n) {
|
|
1159
|
+
let r = Mn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Pn(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({
|
|
1140
1160
|
scope: `populate:${q(e, "command")}`,
|
|
1141
1161
|
name: i,
|
|
1142
1162
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
@@ -1149,58 +1169,58 @@ function On(e, t, n) {
|
|
|
1149
1169
|
let e = {};
|
|
1150
1170
|
for (let n of t) {
|
|
1151
1171
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1152
|
-
t != null && (e[n.name] =
|
|
1172
|
+
t != null && (e[n.name] = cn(n, t));
|
|
1153
1173
|
}
|
|
1154
1174
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1155
1175
|
}, [d, t]);
|
|
1156
1176
|
}
|
|
1157
|
-
function
|
|
1177
|
+
function Pn(e, t, n, r) {
|
|
1158
1178
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1159
1179
|
if (i) return i;
|
|
1160
1180
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
1161
|
-
if (a) return
|
|
1181
|
+
if (a) return Et(a);
|
|
1162
1182
|
let o = r.resolveBinding({ path: t });
|
|
1163
1183
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1164
1184
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let r = o(() =>
|
|
1185
|
+
function Fn(e, t, n) {
|
|
1186
|
+
let r = o(() => In(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1167
1187
|
return o(() => {
|
|
1168
1188
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1169
1189
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1170
1190
|
}, [r, a]);
|
|
1171
1191
|
}
|
|
1172
|
-
function
|
|
1192
|
+
function In(e, t) {
|
|
1173
1193
|
let n = e.properties.arguments;
|
|
1174
1194
|
if (!Array.isArray(n)) return [];
|
|
1175
1195
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1176
1196
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1177
1197
|
}
|
|
1178
|
-
function
|
|
1198
|
+
function Ln(e) {
|
|
1179
1199
|
return e === d.Manual ? d.Manual : d.Auto;
|
|
1180
1200
|
}
|
|
1181
|
-
function
|
|
1201
|
+
function Rn(e) {
|
|
1182
1202
|
if (!J(e)) return;
|
|
1183
1203
|
let t = e;
|
|
1184
1204
|
return {
|
|
1185
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1186
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1187
|
-
columnGap:
|
|
1188
|
-
rowGap:
|
|
1205
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(qn) : [],
|
|
1206
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Jn) : [],
|
|
1207
|
+
columnGap: Yn(t.columnGap) ? t.columnGap : void 0,
|
|
1208
|
+
rowGap: Yn(t.rowGap) ? t.rowGap : void 0
|
|
1189
1209
|
};
|
|
1190
1210
|
}
|
|
1191
|
-
function
|
|
1211
|
+
function zn(e, t) {
|
|
1192
1212
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1193
|
-
for (let e of t) !n.has(e.name) &&
|
|
1213
|
+
for (let e of t) !n.has(e.name) && Jn(e.placement) && n.set(e.name, e.placement);
|
|
1194
1214
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1195
1215
|
}
|
|
1196
|
-
function
|
|
1216
|
+
function Bn(e, t) {
|
|
1197
1217
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1198
1218
|
}
|
|
1199
|
-
function
|
|
1219
|
+
function Vn(e, t) {
|
|
1200
1220
|
let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
|
|
1201
1221
|
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";
|
|
1202
1222
|
}
|
|
1203
|
-
function
|
|
1223
|
+
function Hn(e) {
|
|
1204
1224
|
if (e) return {
|
|
1205
1225
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1206
1226
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
@@ -1215,36 +1235,36 @@ function K(e) {
|
|
|
1215
1235
|
case f.Auto: return "auto";
|
|
1216
1236
|
}
|
|
1217
1237
|
}
|
|
1218
|
-
function
|
|
1238
|
+
function Un(e, t, n, r) {
|
|
1219
1239
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1220
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1240
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? on(a, r, i?.label ?? n) : void 0;
|
|
1221
1241
|
}
|
|
1222
|
-
function
|
|
1242
|
+
function Wn(e, t) {
|
|
1223
1243
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1224
1244
|
return e.flatMap((e) => {
|
|
1225
1245
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1226
1246
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1227
1247
|
});
|
|
1228
1248
|
}
|
|
1229
|
-
function
|
|
1249
|
+
function Gn(e, t) {
|
|
1230
1250
|
if (!e) return [];
|
|
1231
|
-
let n =
|
|
1251
|
+
let n = zn(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.`);
|
|
1232
1252
|
return [...n, ...r];
|
|
1233
1253
|
}
|
|
1234
|
-
function
|
|
1235
|
-
return
|
|
1254
|
+
function Kn(e) {
|
|
1255
|
+
return $t(q(e, "schema"));
|
|
1236
1256
|
}
|
|
1237
1257
|
function q(e, t, n = "") {
|
|
1238
1258
|
let r = e.properties[t];
|
|
1239
1259
|
return typeof r == "string" ? r : n;
|
|
1240
1260
|
}
|
|
1241
|
-
function
|
|
1261
|
+
function qn(e) {
|
|
1242
1262
|
return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1243
1263
|
}
|
|
1244
|
-
function
|
|
1264
|
+
function Jn(e) {
|
|
1245
1265
|
return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1246
1266
|
}
|
|
1247
|
-
function
|
|
1267
|
+
function Yn(e) {
|
|
1248
1268
|
return J(e) && Object.values(f).includes(e.unit);
|
|
1249
1269
|
}
|
|
1250
1270
|
function J(e) {
|
|
@@ -1252,20 +1272,20 @@ function J(e) {
|
|
|
1252
1272
|
}
|
|
1253
1273
|
//#endregion
|
|
1254
1274
|
//#region src/StageGuardedAction.tsx
|
|
1255
|
-
function
|
|
1275
|
+
function Xn(e) {
|
|
1256
1276
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1257
1277
|
}
|
|
1258
1278
|
function Y(e, t) {
|
|
1259
1279
|
let n = e.properties[t];
|
|
1260
1280
|
return typeof n == "string" ? n : "";
|
|
1261
1281
|
}
|
|
1262
|
-
function
|
|
1282
|
+
function Zn(e) {
|
|
1263
1283
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1264
1284
|
}
|
|
1265
|
-
function
|
|
1266
|
-
let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Y(e, "itemRoute"), i =
|
|
1285
|
+
function Qn(e) {
|
|
1286
|
+
let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Y(e, "itemRoute"), i = Xn(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1267
1287
|
for (let [e, n] of Object.entries(i)) {
|
|
1268
|
-
let r =
|
|
1288
|
+
let r = Xn(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1269
1289
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1270
1290
|
}
|
|
1271
1291
|
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
|
|
@@ -1284,13 +1304,13 @@ function qn(e) {
|
|
|
1284
1304
|
item: l.rows.length === 1 ? l.rows[0] : void 0
|
|
1285
1305
|
};
|
|
1286
1306
|
}
|
|
1287
|
-
function
|
|
1288
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e,
|
|
1307
|
+
function $n(e, t) {
|
|
1308
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Ct(ft(n) ?? "", t)]));
|
|
1289
1309
|
}
|
|
1290
|
-
function
|
|
1291
|
-
let n = z(), r =
|
|
1292
|
-
if (!
|
|
1293
|
-
let n = r.hasSource ? `${
|
|
1310
|
+
function er({ element: e, interactions: t }) {
|
|
1311
|
+
let n = z(), r = Qn(e), i = Yt(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Xn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1312
|
+
if (!bt(m) || !h || !r.hasSource) {
|
|
1313
|
+
let n = r.hasSource ? `${pt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${pt}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1294
1314
|
return /* @__PURE__ */ F("div", {
|
|
1295
1315
|
className: "stage-guarded-action",
|
|
1296
1316
|
"data-scene-id": e.id,
|
|
@@ -1308,15 +1328,15 @@ function Yn({ element: e, interactions: t }) {
|
|
|
1308
1328
|
});
|
|
1309
1329
|
}
|
|
1310
1330
|
if (!r.item) return null;
|
|
1311
|
-
let g =
|
|
1331
|
+
let g = xt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1312
1332
|
if (!_?.command) return null;
|
|
1313
1333
|
let v = _.command, y = U(v), b = r.item, x = async () => {
|
|
1314
1334
|
if (!y) return;
|
|
1315
1335
|
u(!0);
|
|
1316
|
-
let t = await i(v,
|
|
1336
|
+
let t = await i(v, $n(_, b));
|
|
1317
1337
|
if (u(!1), s(t.messages), !t.isSuccess) return;
|
|
1318
1338
|
n.refreshAfterCommand();
|
|
1319
|
-
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ?
|
|
1339
|
+
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? Ct(`item.${a}`, b) : void 0;
|
|
1320
1340
|
r && W(r, a && o != null ? { [a]: String(o) } : {});
|
|
1321
1341
|
};
|
|
1322
1342
|
return /* @__PURE__ */ F("div", {
|
|
@@ -1337,12 +1357,12 @@ function Yn({ element: e, interactions: t }) {
|
|
|
1337
1357
|
}, e))]
|
|
1338
1358
|
});
|
|
1339
1359
|
}
|
|
1340
|
-
function
|
|
1360
|
+
function tr(e) {
|
|
1341
1361
|
let t = ae(), r = s(void 0), a = o(() => v(re(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
|
|
1342
1362
|
i(() => () => clearTimeout(r.current), []);
|
|
1343
1363
|
let c = n((e) => {
|
|
1344
1364
|
if (clearTimeout(r.current), r.current = void 0, !t) return;
|
|
1345
|
-
let n = (n) => n.path === "$guard" ?
|
|
1365
|
+
let n = (n) => n.path === "$guard" ? St(n.value, e) : n.path?.startsWith("item.") ? Ct(n.path, e) : t.context.resolve(n);
|
|
1346
1366
|
b(a, t.dispatcher, {
|
|
1347
1367
|
...t.context,
|
|
1348
1368
|
resolve: n
|
|
@@ -1365,7 +1385,7 @@ function Xn(e) {
|
|
|
1365
1385
|
}
|
|
1366
1386
|
//#endregion
|
|
1367
1387
|
//#region src/stageComponents.tsx
|
|
1368
|
-
var
|
|
1388
|
+
var nr = "Stage:commandForm";
|
|
1369
1389
|
function X(e, t, n = {}) {
|
|
1370
1390
|
return {
|
|
1371
1391
|
id: e,
|
|
@@ -1378,15 +1398,15 @@ function Z(e, t, n = "") {
|
|
|
1378
1398
|
let r = e.properties[t];
|
|
1379
1399
|
return typeof r == "string" ? r : n;
|
|
1380
1400
|
}
|
|
1381
|
-
function
|
|
1401
|
+
function rr(e, t) {
|
|
1382
1402
|
let n = e.properties.queryArguments;
|
|
1383
|
-
if (!
|
|
1403
|
+
if (!sr(n)) return {
|
|
1384
1404
|
values: {},
|
|
1385
1405
|
ready: !0
|
|
1386
1406
|
};
|
|
1387
1407
|
let r = {}, i = !0;
|
|
1388
1408
|
for (let [e, a] of Object.entries(n)) {
|
|
1389
|
-
let n =
|
|
1409
|
+
let n = or(a) ? t.resolveBinding(a) : a;
|
|
1390
1410
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1391
1411
|
}
|
|
1392
1412
|
return {
|
|
@@ -1394,7 +1414,7 @@ function Qn(e, t) {
|
|
|
1394
1414
|
ready: i
|
|
1395
1415
|
};
|
|
1396
1416
|
}
|
|
1397
|
-
function
|
|
1417
|
+
function ir(e, t) {
|
|
1398
1418
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1399
1419
|
let t = e.properties;
|
|
1400
1420
|
return {
|
|
@@ -1410,14 +1430,14 @@ function $n(e, t) {
|
|
|
1410
1430
|
function Q(e, t) {
|
|
1411
1431
|
return e[t] ?? e.id ?? e.key;
|
|
1412
1432
|
}
|
|
1413
|
-
function
|
|
1414
|
-
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(() =>
|
|
1433
|
+
function ar({ element: e, slots: t }) {
|
|
1434
|
+
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(() => rr(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
|
|
1415
1435
|
scope: e.id,
|
|
1416
1436
|
name: r,
|
|
1417
1437
|
route: a || void 0,
|
|
1418
1438
|
arguments: s.values,
|
|
1419
1439
|
ready: s.ready
|
|
1420
|
-
}), d =
|
|
1440
|
+
}), d = ir(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, _ = tr(e);
|
|
1421
1441
|
i(() => {
|
|
1422
1442
|
if (!h) return;
|
|
1423
1443
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1463,7 +1483,7 @@ function er({ element: e, slots: t }) {
|
|
|
1463
1483
|
}
|
|
1464
1484
|
n.selectRow(e.id, t);
|
|
1465
1485
|
};
|
|
1466
|
-
return !Z(e, "query") && !a && !
|
|
1486
|
+
return !Z(e, "query") && !a && !st(r) ? /* @__PURE__ */ F("section", {
|
|
1467
1487
|
className: "stage-table",
|
|
1468
1488
|
"data-scene-id": e.id,
|
|
1469
1489
|
children: [/* @__PURE__ */ F("p", {
|
|
@@ -1524,25 +1544,25 @@ function er({ element: e, slots: t }) {
|
|
|
1524
1544
|
]
|
|
1525
1545
|
});
|
|
1526
1546
|
}
|
|
1527
|
-
function
|
|
1528
|
-
return
|
|
1547
|
+
function or(e) {
|
|
1548
|
+
return sr(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1529
1549
|
}
|
|
1530
|
-
function
|
|
1550
|
+
function sr(e) {
|
|
1531
1551
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1532
1552
|
}
|
|
1533
|
-
function
|
|
1534
|
-
return
|
|
1553
|
+
function cr({ element: e, interactions: t, slots: n }) {
|
|
1554
|
+
return Zn(e) ? /* @__PURE__ */ P(er, {
|
|
1535
1555
|
element: e,
|
|
1536
1556
|
interactions: t
|
|
1537
|
-
}) : /* @__PURE__ */ P(
|
|
1557
|
+
}) : /* @__PURE__ */ P(lr, {
|
|
1538
1558
|
element: e,
|
|
1539
1559
|
interactions: t,
|
|
1540
1560
|
slots: n
|
|
1541
1561
|
});
|
|
1542
1562
|
}
|
|
1543
|
-
function
|
|
1563
|
+
function lr({ element: e, interactions: t }) {
|
|
1544
1564
|
let n = Z(e, "label", Z(e, "command"));
|
|
1545
|
-
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(
|
|
1565
|
+
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(ur, {
|
|
1546
1566
|
element: e,
|
|
1547
1567
|
label: n
|
|
1548
1568
|
}) : /* @__PURE__ */ P(I, {
|
|
@@ -1554,10 +1574,10 @@ function ir({ element: e, interactions: t }) {
|
|
|
1554
1574
|
children: n
|
|
1555
1575
|
});
|
|
1556
1576
|
}
|
|
1557
|
-
function
|
|
1558
|
-
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(
|
|
1577
|
+
function ur({ element: e, label: t }) {
|
|
1578
|
+
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(vn.Provider, {
|
|
1559
1579
|
value: a,
|
|
1560
|
-
children: /* @__PURE__ */ P(
|
|
1580
|
+
children: /* @__PURE__ */ P(yn, { element: e })
|
|
1561
1581
|
});
|
|
1562
1582
|
return /* @__PURE__ */ P("div", {
|
|
1563
1583
|
className: "stage-action",
|
|
@@ -1572,13 +1592,13 @@ function ar({ element: e, label: t }) {
|
|
|
1572
1592
|
}, r)
|
|
1573
1593
|
});
|
|
1574
1594
|
}
|
|
1575
|
-
function
|
|
1576
|
-
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(() =>
|
|
1595
|
+
function dr(e) {
|
|
1596
|
+
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(() => $t(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
|
|
1577
1597
|
if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
|
|
1578
1598
|
element: e.element,
|
|
1579
1599
|
slots: e.slots ?? {}
|
|
1580
1600
|
}) : /* @__PURE__ */ P(ne, {});
|
|
1581
|
-
let p = d.filter((e) => !
|
|
1601
|
+
let p = d.filter((e) => !kn(e, a)), m = X(`slice-dialog-${c}`, {
|
|
1582
1602
|
command: c,
|
|
1583
1603
|
label: l,
|
|
1584
1604
|
schema: u,
|
|
@@ -1600,9 +1620,9 @@ function or(e) {
|
|
|
1600
1620
|
children: l
|
|
1601
1621
|
})
|
|
1602
1622
|
}),
|
|
1603
|
-
/* @__PURE__ */ P(
|
|
1623
|
+
/* @__PURE__ */ P(vn.Provider, {
|
|
1604
1624
|
value: f,
|
|
1605
|
-
children: /* @__PURE__ */ P(
|
|
1625
|
+
children: /* @__PURE__ */ P(yn, { element: m })
|
|
1606
1626
|
}),
|
|
1607
1627
|
/* @__PURE__ */ P("footer", {
|
|
1608
1628
|
className: "scene-slice-dialog-footer",
|
|
@@ -1616,7 +1636,7 @@ function or(e) {
|
|
|
1616
1636
|
]
|
|
1617
1637
|
});
|
|
1618
1638
|
}
|
|
1619
|
-
function
|
|
1639
|
+
function fr(e) {
|
|
1620
1640
|
let { element: t } = e;
|
|
1621
1641
|
if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
|
|
1622
1642
|
let n = Z(t, "name", t.id), r = {
|
|
@@ -1630,25 +1650,25 @@ function sr(e) {
|
|
|
1630
1650
|
return /* @__PURE__ */ P("span", {
|
|
1631
1651
|
className: "stage-toolbar-action",
|
|
1632
1652
|
"data-scene-toolbar-item": n,
|
|
1633
|
-
children: /* @__PURE__ */ P(
|
|
1653
|
+
children: /* @__PURE__ */ P(cr, {
|
|
1634
1654
|
element: r,
|
|
1635
1655
|
interactions: e.interactions,
|
|
1636
1656
|
slots: e.slots
|
|
1637
1657
|
})
|
|
1638
1658
|
});
|
|
1639
1659
|
}
|
|
1640
|
-
var
|
|
1660
|
+
var pr = {
|
|
1641
1661
|
...D,
|
|
1642
|
-
"core:table":
|
|
1643
|
-
"core:action":
|
|
1644
|
-
"core:toolbarItem":
|
|
1645
|
-
"core:sliceDialog":
|
|
1646
|
-
[
|
|
1662
|
+
"core:table": ar,
|
|
1663
|
+
"core:action": cr,
|
|
1664
|
+
"core:toolbarItem": fr,
|
|
1665
|
+
"core:sliceDialog": dr,
|
|
1666
|
+
[nr]: yn
|
|
1647
1667
|
};
|
|
1648
1668
|
//#endregion
|
|
1649
1669
|
//#region src/useStrings.ts
|
|
1650
|
-
function
|
|
1651
|
-
let e =
|
|
1670
|
+
function mr() {
|
|
1671
|
+
let e = Qe(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1652
1672
|
return i(() => {
|
|
1653
1673
|
let t = new AbortController();
|
|
1654
1674
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1665,11 +1685,11 @@ function lr() {
|
|
|
1665
1685
|
dictionary: o
|
|
1666
1686
|
};
|
|
1667
1687
|
}
|
|
1668
|
-
var
|
|
1669
|
-
function
|
|
1670
|
-
return
|
|
1688
|
+
var hr = /* @__PURE__ */ new Set(["core:table"]);
|
|
1689
|
+
function gr(e) {
|
|
1690
|
+
return _r(e, /* @__PURE__ */ new Map(), void 0);
|
|
1671
1691
|
}
|
|
1672
|
-
function
|
|
1692
|
+
function _r(e, t, n) {
|
|
1673
1693
|
let r = e;
|
|
1674
1694
|
if (!r.slots) return e;
|
|
1675
1695
|
let i = !1, a = {};
|
|
@@ -1678,7 +1698,7 @@ function fr(e, t, n) {
|
|
|
1678
1698
|
a[e] = o.map((e) => {
|
|
1679
1699
|
let t = e, n = $(t, "typeName");
|
|
1680
1700
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1681
|
-
let a =
|
|
1701
|
+
let a = _r(yr(vr(t, r), s), r, s);
|
|
1682
1702
|
return a !== e && (i = !0), a;
|
|
1683
1703
|
});
|
|
1684
1704
|
}
|
|
@@ -1687,8 +1707,8 @@ function fr(e, t, n) {
|
|
|
1687
1707
|
slots: a
|
|
1688
1708
|
} : e;
|
|
1689
1709
|
}
|
|
1690
|
-
function
|
|
1691
|
-
if (!
|
|
1710
|
+
function vr(e, t) {
|
|
1711
|
+
if (!hr.has(e.componentName)) return e;
|
|
1692
1712
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1693
1713
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1694
1714
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -1697,7 +1717,7 @@ function pr(e, t) {
|
|
|
1697
1717
|
properties: a
|
|
1698
1718
|
};
|
|
1699
1719
|
}
|
|
1700
|
-
function
|
|
1720
|
+
function yr(e, t) {
|
|
1701
1721
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
|
|
1702
1722
|
let n = { ...e.properties };
|
|
1703
1723
|
if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
|
|
@@ -1716,7 +1736,7 @@ function $(e, t) {
|
|
|
1716
1736
|
}
|
|
1717
1737
|
//#endregion
|
|
1718
1738
|
//#region src/stageQueryBindings.tsx
|
|
1719
|
-
function
|
|
1739
|
+
function br(e) {
|
|
1720
1740
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1721
1741
|
if (Array.isArray(e)) {
|
|
1722
1742
|
e.forEach(n);
|
|
@@ -1736,7 +1756,7 @@ function hr(e) {
|
|
|
1736
1756
|
};
|
|
1737
1757
|
return r(e), [...t];
|
|
1738
1758
|
}
|
|
1739
|
-
function
|
|
1759
|
+
function xr(e) {
|
|
1740
1760
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
1741
1761
|
let n = e.properties?.[t];
|
|
1742
1762
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -1755,7 +1775,7 @@ function gr(e) {
|
|
|
1755
1775
|
};
|
|
1756
1776
|
return r(e), [...t.values()];
|
|
1757
1777
|
}
|
|
1758
|
-
function
|
|
1778
|
+
function Sr({ source: e }) {
|
|
1759
1779
|
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 } : {} : {
|
|
1760
1780
|
...i,
|
|
1761
1781
|
...r
|
|
@@ -1775,7 +1795,7 @@ function _r({ source: e }) {
|
|
|
1775
1795
|
list: !0
|
|
1776
1796
|
}), null;
|
|
1777
1797
|
}
|
|
1778
|
-
function
|
|
1798
|
+
function Cr({ name: e }) {
|
|
1779
1799
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
|
|
1780
1800
|
...i,
|
|
1781
1801
|
...r
|
|
@@ -1789,11 +1809,11 @@ function vr({ name: e }) {
|
|
|
1789
1809
|
list: !0
|
|
1790
1810
|
}), null;
|
|
1791
1811
|
}
|
|
1792
|
-
function
|
|
1793
|
-
let t = o(() =>
|
|
1794
|
-
return /* @__PURE__ */ F(je, { children: [t.map((e) => /* @__PURE__ */ P(
|
|
1812
|
+
function wr({ element: e }) {
|
|
1813
|
+
let t = o(() => br(e), [e]), n = o(() => xr(e), [e]);
|
|
1814
|
+
return /* @__PURE__ */ F(je, { children: [t.map((e) => /* @__PURE__ */ P(Cr, { name: e }, e)), n.map((e) => /* @__PURE__ */ P(Sr, { source: e }, e.typeName))] });
|
|
1795
1815
|
}
|
|
1796
|
-
function
|
|
1816
|
+
function Tr(e) {
|
|
1797
1817
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1798
1818
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
1799
1819
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -1806,7 +1826,7 @@ function br(e) {
|
|
|
1806
1826
|
]);
|
|
1807
1827
|
if (t.has(s)) continue;
|
|
1808
1828
|
t.add(s);
|
|
1809
|
-
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l =
|
|
1829
|
+
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = Or(r.destination) ? r.destination : void 0;
|
|
1810
1830
|
n.push({
|
|
1811
1831
|
label: i,
|
|
1812
1832
|
targetScreen: a,
|
|
@@ -1814,7 +1834,7 @@ function br(e) {
|
|
|
1814
1834
|
order: c,
|
|
1815
1835
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
1816
1836
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
1817
|
-
...l &&
|
|
1837
|
+
...l && kr(l) ? { destination: l } : {}
|
|
1818
1838
|
});
|
|
1819
1839
|
}
|
|
1820
1840
|
return n.map((e, t) => ({
|
|
@@ -1822,7 +1842,7 @@ function br(e) {
|
|
|
1822
1842
|
index: t
|
|
1823
1843
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
1824
1844
|
}
|
|
1825
|
-
function
|
|
1845
|
+
function Er(e) {
|
|
1826
1846
|
let t = {
|
|
1827
1847
|
label: "",
|
|
1828
1848
|
children: []
|
|
@@ -1847,21 +1867,21 @@ function xr(e) {
|
|
|
1847
1867
|
}
|
|
1848
1868
|
return t.children;
|
|
1849
1869
|
}
|
|
1850
|
-
function
|
|
1870
|
+
function Dr(e, t) {
|
|
1851
1871
|
for (let n of e) {
|
|
1852
1872
|
if (n.screen === t) return [n.label];
|
|
1853
|
-
let e =
|
|
1873
|
+
let e = Dr(n.children, t);
|
|
1854
1874
|
if (e.length > 0) return [n.label, ...e];
|
|
1855
1875
|
}
|
|
1856
1876
|
return [];
|
|
1857
1877
|
}
|
|
1858
|
-
function
|
|
1878
|
+
function Or(e) {
|
|
1859
1879
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1860
1880
|
}
|
|
1861
|
-
function
|
|
1881
|
+
function kr(e) {
|
|
1862
1882
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
1863
1883
|
}
|
|
1864
|
-
function
|
|
1884
|
+
function Ar(e, t, n) {
|
|
1865
1885
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
1866
1886
|
label: e.name,
|
|
1867
1887
|
targetScreen: e.name,
|
|
@@ -1870,8 +1890,8 @@ function Tr(e, t, n) {
|
|
|
1870
1890
|
}
|
|
1871
1891
|
//#endregion
|
|
1872
1892
|
//#region src/blueprint.ts
|
|
1873
|
-
var
|
|
1874
|
-
function
|
|
1893
|
+
var jr = "Stage:locale";
|
|
1894
|
+
function Mr(e) {
|
|
1875
1895
|
let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
|
|
1876
1896
|
return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
|
|
1877
1897
|
...t,
|
|
@@ -1879,11 +1899,11 @@ function Dr(e) {
|
|
|
1879
1899
|
packages: n
|
|
1880
1900
|
};
|
|
1881
1901
|
}
|
|
1882
|
-
var
|
|
1902
|
+
var Nr = {
|
|
1883
1903
|
...fe,
|
|
1884
1904
|
PrimeReact: Fe.components
|
|
1885
1905
|
};
|
|
1886
|
-
function
|
|
1906
|
+
function Pr(e) {
|
|
1887
1907
|
return {
|
|
1888
1908
|
...D,
|
|
1889
1909
|
...Pe,
|
|
@@ -1892,14 +1912,14 @@ function kr(e) {
|
|
|
1892
1912
|
...e
|
|
1893
1913
|
};
|
|
1894
1914
|
}
|
|
1895
|
-
function
|
|
1915
|
+
function Fr(e) {
|
|
1896
1916
|
return e ? {
|
|
1897
1917
|
...e,
|
|
1898
|
-
...
|
|
1899
|
-
} :
|
|
1918
|
+
...Nr
|
|
1919
|
+
} : Nr;
|
|
1900
1920
|
}
|
|
1901
|
-
var
|
|
1902
|
-
function
|
|
1921
|
+
var Ir = "Stage:navigationTree";
|
|
1922
|
+
function Lr(e, t, n) {
|
|
1903
1923
|
return N(e, j.Logo, {
|
|
1904
1924
|
label: t,
|
|
1905
1925
|
initials: t.slice(0, 1).toUpperCase() || "S",
|
|
@@ -1907,31 +1927,31 @@ function Mr(e, t, n) {
|
|
|
1907
1927
|
...n ? { lightImageUrl: n } : {}
|
|
1908
1928
|
});
|
|
1909
1929
|
}
|
|
1910
|
-
function
|
|
1911
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
1930
|
+
function Rr(e, t, n, r, i, a = !1, o = !0) {
|
|
1931
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Tr(e), u = Ar(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Er([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => xe({
|
|
1912
1932
|
label: e.name,
|
|
1913
1933
|
targetScreen: e.name,
|
|
1914
1934
|
icon: "pi pi-table",
|
|
1915
1935
|
group: "Screens",
|
|
1916
1936
|
order: n
|
|
1917
|
-
}, t)), p =
|
|
1937
|
+
}, t)), p = Dr(Er(l), t), m = e.find((e) => e.name === t)?.path?.length ? Dr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", Ir, {
|
|
1918
1938
|
nodes: d,
|
|
1919
1939
|
activeScreen: t
|
|
1920
1940
|
}) : N("menu-screens", j.Menu, {
|
|
1921
1941
|
title: "Screens",
|
|
1922
1942
|
label: "Screens"
|
|
1923
1943
|
}, { items: f }), _ = [];
|
|
1924
|
-
n.length > 1 && _.push(N("topbar-locale",
|
|
1944
|
+
n.length > 1 && _.push(N("topbar-locale", jr, {
|
|
1925
1945
|
locales: n,
|
|
1926
1946
|
locale: r
|
|
1927
1947
|
})), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
|
|
1928
1948
|
let v = { regionNavigation: a };
|
|
1929
1949
|
return {
|
|
1930
1950
|
[M.Topbar]: [N("topbar", j.Topbar, v, {
|
|
1931
|
-
logo: [
|
|
1951
|
+
logo: [Lr("topbar-logo", c, i?.image)],
|
|
1932
1952
|
end: _
|
|
1933
1953
|
})],
|
|
1934
|
-
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [
|
|
1954
|
+
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [Lr("sidebar-logo", c, i?.image)] })],
|
|
1935
1955
|
...a ? {} : { [M.Menu]: [g] },
|
|
1936
1956
|
[M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
|
|
1937
1957
|
homeTargetScreen: s,
|
|
@@ -1948,26 +1968,26 @@ function Nr(e, t, n, r, i, a = !1, o = !0) {
|
|
|
1948
1968
|
})]
|
|
1949
1969
|
};
|
|
1950
1970
|
}
|
|
1951
|
-
function
|
|
1971
|
+
function zr(e) {
|
|
1952
1972
|
return `#/${encodeURIComponent(e)}`;
|
|
1953
1973
|
}
|
|
1954
1974
|
//#endregion
|
|
1955
1975
|
//#region src/StageChrome.tsx
|
|
1956
|
-
var
|
|
1976
|
+
var Br = e({
|
|
1957
1977
|
locales: [],
|
|
1958
1978
|
locale: "",
|
|
1959
1979
|
setLocale: () => void 0,
|
|
1960
1980
|
activity: ""
|
|
1961
1981
|
});
|
|
1962
|
-
function
|
|
1963
|
-
return /* @__PURE__ */ P(
|
|
1982
|
+
function Vr({ state: e, children: t }) {
|
|
1983
|
+
return /* @__PURE__ */ P(Br.Provider, {
|
|
1964
1984
|
value: e,
|
|
1965
1985
|
children: t
|
|
1966
1986
|
});
|
|
1967
1987
|
}
|
|
1968
|
-
var
|
|
1969
|
-
function
|
|
1970
|
-
let { locales: e, locale: t, setLocale: n } = r(
|
|
1988
|
+
var Hr = "Stage:activity";
|
|
1989
|
+
function Ur() {
|
|
1990
|
+
let { locales: e, locale: t, setLocale: n } = r(Br);
|
|
1971
1991
|
return e.length < 2 ? null : /* @__PURE__ */ P("select", {
|
|
1972
1992
|
className: "stage-locale",
|
|
1973
1993
|
"aria-label": "Locale",
|
|
@@ -1979,19 +1999,19 @@ function Rr() {
|
|
|
1979
1999
|
}, e))
|
|
1980
2000
|
});
|
|
1981
2001
|
}
|
|
1982
|
-
function
|
|
2002
|
+
function Wr({ element: e }) {
|
|
1983
2003
|
let t = e.properties ?? {};
|
|
1984
2004
|
return /* @__PURE__ */ P("nav", {
|
|
1985
2005
|
className: "stage-navigation-tree",
|
|
1986
2006
|
"aria-label": "Navigation",
|
|
1987
2007
|
"data-scene-id": e.id,
|
|
1988
|
-
children: /* @__PURE__ */ P(
|
|
2008
|
+
children: /* @__PURE__ */ P(Gr, {
|
|
1989
2009
|
nodes: t.nodes ?? [],
|
|
1990
2010
|
activeScreen: t.activeScreen
|
|
1991
2011
|
})
|
|
1992
2012
|
});
|
|
1993
2013
|
}
|
|
1994
|
-
function
|
|
2014
|
+
function Gr({ nodes: e, activeScreen: t }) {
|
|
1995
2015
|
return /* @__PURE__ */ P("ul", {
|
|
1996
2016
|
role: "tree",
|
|
1997
2017
|
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
|
|
@@ -2000,13 +2020,13 @@ function Br({ nodes: e, activeScreen: t }) {
|
|
|
2000
2020
|
children: [/* @__PURE__ */ P("span", {
|
|
2001
2021
|
className: "stage-navigation-group",
|
|
2002
2022
|
children: e.label
|
|
2003
|
-
}), /* @__PURE__ */ P(
|
|
2023
|
+
}), /* @__PURE__ */ P(Gr, {
|
|
2004
2024
|
nodes: e.children,
|
|
2005
2025
|
activeScreen: t
|
|
2006
2026
|
})]
|
|
2007
2027
|
}, e.label) : /* @__PURE__ */ P("li", {
|
|
2008
2028
|
role: "treeitem",
|
|
2009
|
-
children: /* @__PURE__ */ P(
|
|
2029
|
+
children: /* @__PURE__ */ P(Kr, {
|
|
2010
2030
|
node: e,
|
|
2011
2031
|
screen: e.screen,
|
|
2012
2032
|
activeScreen: t
|
|
@@ -2014,12 +2034,12 @@ function Br({ nodes: e, activeScreen: t }) {
|
|
|
2014
2034
|
}, `${e.screen}:${e.label}`))
|
|
2015
2035
|
});
|
|
2016
2036
|
}
|
|
2017
|
-
function
|
|
2018
|
-
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 &&
|
|
2037
|
+
function Kr({ node: e, screen: t, activeScreen: n }) {
|
|
2038
|
+
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 && kr(o) ? (e) => {
|
|
2019
2039
|
e.preventDefault(), i.navigate(o);
|
|
2020
2040
|
} : void 0;
|
|
2021
2041
|
return /* @__PURE__ */ F("a", {
|
|
2022
|
-
href: s ? o.route :
|
|
2042
|
+
href: s ? o.route : zr(t),
|
|
2023
2043
|
rel: s ? "noreferrer" : void 0,
|
|
2024
2044
|
"aria-current": t === n ? "page" : void 0,
|
|
2025
2045
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
@@ -2033,7 +2053,7 @@ function Vr({ node: e, screen: t, activeScreen: n }) {
|
|
|
2033
2053
|
}), a !== "icon" && e.label]
|
|
2034
2054
|
});
|
|
2035
2055
|
}
|
|
2036
|
-
function
|
|
2056
|
+
function qr({ element: e }) {
|
|
2037
2057
|
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;
|
|
2038
2058
|
return /* @__PURE__ */ F("div", {
|
|
2039
2059
|
"data-scene-outlet": t,
|
|
@@ -2054,15 +2074,15 @@ function Hr({ element: e }) {
|
|
|
2054
2074
|
})]
|
|
2055
2075
|
});
|
|
2056
2076
|
}
|
|
2057
|
-
function
|
|
2058
|
-
let { activity: e } = r(
|
|
2077
|
+
function Jr() {
|
|
2078
|
+
let { activity: e } = r(Br);
|
|
2059
2079
|
return e ? /* @__PURE__ */ P("p", {
|
|
2060
2080
|
className: "stage-activity",
|
|
2061
2081
|
role: "status",
|
|
2062
2082
|
children: e
|
|
2063
2083
|
}) : null;
|
|
2064
2084
|
}
|
|
2065
|
-
function
|
|
2085
|
+
function Yr() {
|
|
2066
2086
|
let e = A(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2067
2087
|
return i(() => {
|
|
2068
2088
|
let r = e?.isDark ? "dark" : "light";
|
|
@@ -2073,25 +2093,25 @@ function Wr() {
|
|
|
2073
2093
|
n
|
|
2074
2094
|
]), null;
|
|
2075
2095
|
}
|
|
2076
|
-
var
|
|
2077
|
-
[
|
|
2078
|
-
[
|
|
2079
|
-
[
|
|
2080
|
-
"core:outlet":
|
|
2081
|
-
},
|
|
2096
|
+
var Xr = {
|
|
2097
|
+
[jr]: Ur,
|
|
2098
|
+
[Ir]: Wr,
|
|
2099
|
+
[Hr]: Jr,
|
|
2100
|
+
"core:outlet": qr
|
|
2101
|
+
}, Zr = [
|
|
2082
2102
|
"navigationMode",
|
|
2083
2103
|
"menuTheme",
|
|
2084
2104
|
"showFooter"
|
|
2085
|
-
],
|
|
2086
|
-
function
|
|
2105
|
+
], Qr = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2106
|
+
function $r(e, t, n = !1) {
|
|
2087
2107
|
let r = [], i = t.options ?? {}, a = {
|
|
2088
2108
|
showFooter: !0,
|
|
2089
2109
|
followsSystem: !1,
|
|
2090
2110
|
problems: r
|
|
2091
2111
|
};
|
|
2092
2112
|
for (let [e, n] of Object.entries(i)) {
|
|
2093
|
-
if (!
|
|
2094
|
-
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${
|
|
2113
|
+
if (!Zr.includes(e)) {
|
|
2114
|
+
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Zr.join(", ")}.`);
|
|
2095
2115
|
continue;
|
|
2096
2116
|
}
|
|
2097
2117
|
if (e === "navigationMode") {
|
|
@@ -2108,9 +2128,9 @@ function Jr(e, t, n = !1) {
|
|
|
2108
2128
|
let e = a.followsSystem ? n : o.colorScheme === l.Dark;
|
|
2109
2129
|
a.colorScheme = e ? ue.Dark : ue.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2110
2130
|
}
|
|
2111
|
-
return o?.accent !== void 0 && (
|
|
2131
|
+
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;
|
|
2112
2132
|
}
|
|
2113
|
-
function
|
|
2133
|
+
function ei(e, t) {
|
|
2114
2134
|
if (e?.root === void 0) return [];
|
|
2115
2135
|
let n = /* @__PURE__ */ new Set([
|
|
2116
2136
|
m.RootTemplateUnknown,
|
|
@@ -2122,7 +2142,7 @@ function Yr(e, t) {
|
|
|
2122
2142
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2123
2143
|
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;
|
|
2124
2144
|
}
|
|
2125
|
-
function
|
|
2145
|
+
function ti(e) {
|
|
2126
2146
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2127
2147
|
0,
|
|
2128
2148
|
2,
|
|
@@ -2130,7 +2150,7 @@ function Xr(e) {
|
|
|
2130
2150
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2131
2151
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2132
2152
|
}
|
|
2133
|
-
function
|
|
2153
|
+
function ni(e, t) {
|
|
2134
2154
|
if (t === void 0) return e;
|
|
2135
2155
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2136
2156
|
0,
|
|
@@ -2142,18 +2162,18 @@ function Zr(e, t) {
|
|
|
2142
2162
|
tokens: {
|
|
2143
2163
|
...e.tokens,
|
|
2144
2164
|
"primary.color": t,
|
|
2145
|
-
"primary.contrastColor":
|
|
2165
|
+
"primary.contrastColor": ti(t),
|
|
2146
2166
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2147
2167
|
}
|
|
2148
2168
|
}));
|
|
2149
2169
|
}
|
|
2150
2170
|
//#endregion
|
|
2151
2171
|
//#region src/StageShellSettings.tsx
|
|
2152
|
-
var
|
|
2153
|
-
function
|
|
2172
|
+
var ri = "(prefers-color-scheme: dark)";
|
|
2173
|
+
function ii() {
|
|
2154
2174
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2155
2175
|
}
|
|
2156
|
-
function
|
|
2176
|
+
function ai({ settings: e, onSystemSchemeChange: t }) {
|
|
2157
2177
|
let n = s(we());
|
|
2158
2178
|
n.current = we();
|
|
2159
2179
|
let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
|
|
@@ -2167,16 +2187,16 @@ function ei({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2167
2187
|
c
|
|
2168
2188
|
]), i(() => {
|
|
2169
2189
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2170
|
-
let n = globalThis.matchMedia(
|
|
2190
|
+
let n = globalThis.matchMedia(ri), r = (e) => t(e.matches);
|
|
2171
2191
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2172
2192
|
}, [e.followsSystem, t]), null;
|
|
2173
2193
|
}
|
|
2174
2194
|
//#endregion
|
|
2175
2195
|
//#region src/stageNavigationModel.ts
|
|
2176
|
-
function
|
|
2196
|
+
function oi(e) {
|
|
2177
2197
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2178
2198
|
}
|
|
2179
|
-
function
|
|
2199
|
+
function si(e) {
|
|
2180
2200
|
let t = /* @__PURE__ */ new Map();
|
|
2181
2201
|
for (let n of e) {
|
|
2182
2202
|
let e = (n.path ?? []).join(".");
|
|
@@ -2189,35 +2209,35 @@ function ni(e) {
|
|
|
2189
2209
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2190
2210
|
};
|
|
2191
2211
|
}
|
|
2192
|
-
function
|
|
2212
|
+
function ci(e) {
|
|
2193
2213
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2194
2214
|
}
|
|
2195
|
-
function
|
|
2215
|
+
function li(e, t) {
|
|
2196
2216
|
return {
|
|
2197
2217
|
structure: e.structure ?? { modules: [] },
|
|
2198
2218
|
navigation: e.navigation ?? {
|
|
2199
2219
|
application: { regions: [] },
|
|
2200
2220
|
modules: []
|
|
2201
2221
|
},
|
|
2202
|
-
screenFor:
|
|
2203
|
-
moduleOf:
|
|
2222
|
+
screenFor: si(e.screens),
|
|
2223
|
+
moduleOf: ci(e.screens),
|
|
2204
2224
|
...t ? { isVisible: t } : {}
|
|
2205
2225
|
};
|
|
2206
2226
|
}
|
|
2207
2227
|
//#endregion
|
|
2208
2228
|
//#region src/stageSlices.ts
|
|
2209
|
-
function
|
|
2210
|
-
return (t) =>
|
|
2229
|
+
function ui(e) {
|
|
2230
|
+
return (t) => $t(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2211
2231
|
name: e.name,
|
|
2212
2232
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2213
|
-
label:
|
|
2233
|
+
label: di(e.name),
|
|
2214
2234
|
required: e.required
|
|
2215
2235
|
}));
|
|
2216
2236
|
}
|
|
2217
|
-
function
|
|
2237
|
+
function di(e) {
|
|
2218
2238
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2219
2239
|
}
|
|
2220
|
-
function
|
|
2240
|
+
function fi(e, t, n) {
|
|
2221
2241
|
return { invoke: async (r, i, a) => {
|
|
2222
2242
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2223
2243
|
if (!U(o)) return {
|
|
@@ -2238,7 +2258,7 @@ function si(e, t, n) {
|
|
|
2238
2258
|
}
|
|
2239
2259
|
//#endregion
|
|
2240
2260
|
//#region src/withoutSeededSlots.ts
|
|
2241
|
-
function
|
|
2261
|
+
function pi(e, t) {
|
|
2242
2262
|
let n = /* @__PURE__ */ new Map();
|
|
2243
2263
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2244
2264
|
return e.map((e) => {
|
|
@@ -2256,15 +2276,15 @@ function ci(e, t) {
|
|
|
2256
2276
|
}
|
|
2257
2277
|
//#endregion
|
|
2258
2278
|
//#region src/App.tsx
|
|
2259
|
-
function
|
|
2260
|
-
return
|
|
2279
|
+
function mi(e = {}) {
|
|
2280
|
+
return Pr({
|
|
2261
2281
|
...e,
|
|
2262
|
-
...
|
|
2263
|
-
...
|
|
2282
|
+
...pr,
|
|
2283
|
+
...Xr
|
|
2264
2284
|
});
|
|
2265
2285
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return N(`form-${e}-${t.name}`,
|
|
2286
|
+
function hi(e, t) {
|
|
2287
|
+
return N(`form-${e}-${t.name}`, nr, {
|
|
2268
2288
|
command: t.forCommand,
|
|
2269
2289
|
label: t.name,
|
|
2270
2290
|
generationMode: t.generationMode,
|
|
@@ -2272,43 +2292,43 @@ function ui(e, t) {
|
|
|
2272
2292
|
fields: t.fields
|
|
2273
2293
|
});
|
|
2274
2294
|
}
|
|
2275
|
-
function
|
|
2295
|
+
function gi(e, t) {
|
|
2276
2296
|
let n = e.screens[0];
|
|
2277
2297
|
return _e(e, n, {
|
|
2278
|
-
profile:
|
|
2298
|
+
profile: Mr(e.uiProfiles),
|
|
2279
2299
|
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2280
2300
|
});
|
|
2281
2301
|
}
|
|
2282
|
-
function
|
|
2283
|
-
let s =
|
|
2302
|
+
function _i(e, t, n, r, i, a, o = !0) {
|
|
2303
|
+
let s = oi(e.navigation), c = e.navigation?.application.logo ? {
|
|
2284
2304
|
title: e.navigation.application.logo.title,
|
|
2285
2305
|
image: e.navigation.application.logo.image || void 0
|
|
2286
2306
|
} : void 0;
|
|
2287
2307
|
return {
|
|
2288
|
-
profile:
|
|
2289
|
-
catalog:
|
|
2308
|
+
profile: Mr(e.uiProfiles),
|
|
2309
|
+
catalog: Fr(r),
|
|
2290
2310
|
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
2291
|
-
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]:
|
|
2292
|
-
form:
|
|
2293
|
-
trailing: [N("activity",
|
|
2311
|
+
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Rr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Rr(e.screens, r.name, t, n, c, s, o),
|
|
2312
|
+
form: hi,
|
|
2313
|
+
trailing: [N("activity", Hr)],
|
|
2294
2314
|
decorate: (e) => {
|
|
2295
|
-
let t =
|
|
2315
|
+
let t = gr(e);
|
|
2296
2316
|
return i ? y(t, i) : t;
|
|
2297
2317
|
}
|
|
2298
2318
|
};
|
|
2299
2319
|
}
|
|
2300
|
-
function
|
|
2301
|
-
return pe(e, t,
|
|
2320
|
+
function vi(e, t, n, r, i, a) {
|
|
2321
|
+
return pe(e, t, _i(e, n, r, i, void 0, a)).element;
|
|
2302
2322
|
}
|
|
2303
|
-
function
|
|
2323
|
+
function yi() {
|
|
2304
2324
|
try {
|
|
2305
2325
|
return globalThis.localStorage ?? null;
|
|
2306
2326
|
} catch {
|
|
2307
2327
|
return null;
|
|
2308
2328
|
}
|
|
2309
2329
|
}
|
|
2310
|
-
function
|
|
2311
|
-
let s =
|
|
2330
|
+
function bi({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
|
|
2331
|
+
let s = Qe(), l = o(() => mi(e), [e]), [u, d] = c(), [f, p] = c(""), m = $e(), h = mr();
|
|
2312
2332
|
return i(() => {
|
|
2313
2333
|
let e = new AbortController();
|
|
2314
2334
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2320,7 +2340,7 @@ function hi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2320
2340
|
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2321
2341
|
className: "stage-message",
|
|
2322
2342
|
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2323
|
-
}) : u ? /* @__PURE__ */ P(
|
|
2343
|
+
}) : u ? /* @__PURE__ */ P(xi, {
|
|
2324
2344
|
scene: u,
|
|
2325
2345
|
registry: l,
|
|
2326
2346
|
routeState: m,
|
|
@@ -2333,16 +2353,16 @@ function hi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2333
2353
|
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2334
2354
|
});
|
|
2335
2355
|
}
|
|
2336
|
-
function
|
|
2337
|
-
let u = o(() => O(), []), [d, f] = c(
|
|
2356
|
+
function xi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
|
|
2357
|
+
let u = o(() => O(), []), [d, f] = c(ii), p = e.screens[0]?.name ?? "", m = o(() => Mr(e.uiProfiles), [e]), h = o(() => p ? gi(e, s) : void 0, [
|
|
2338
2358
|
e,
|
|
2339
2359
|
s,
|
|
2340
2360
|
p
|
|
2341
|
-
]), g = o(() => h ?
|
|
2361
|
+
]), g = o(() => h ? ei(m, h) : [], [m, h]), _ = o(() => h ? $r(m, h, d) : void 0, [
|
|
2342
2362
|
m,
|
|
2343
2363
|
h,
|
|
2344
2364
|
d
|
|
2345
|
-
]), v = o(() =>
|
|
2365
|
+
]), v = o(() => ni(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => _i(e, i.locales, i.locale, a, i.dictionary, s, y), [
|
|
2346
2366
|
e,
|
|
2347
2367
|
i.locales,
|
|
2348
2368
|
i.locale,
|
|
@@ -2350,9 +2370,9 @@ function gi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2350
2370
|
a,
|
|
2351
2371
|
s,
|
|
2352
2372
|
y
|
|
2353
|
-
]), x = n((e) => f(e), []), S = o(() =>
|
|
2373
|
+
]), x = n((e) => f(e), []), S = o(() => li(e, l), [e, l]), C = o(() => ({
|
|
2354
2374
|
...e,
|
|
2355
|
-
screens:
|
|
2375
|
+
screens: pi(e.screens, [
|
|
2356
2376
|
...e.screenTemplates,
|
|
2357
2377
|
...e.dialogTemplates ?? [],
|
|
2358
2378
|
...ve,
|
|
@@ -2375,8 +2395,8 @@ function gi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2375
2395
|
registry: t,
|
|
2376
2396
|
initialScreen: p,
|
|
2377
2397
|
history: u,
|
|
2378
|
-
layoutConfigStorage:
|
|
2379
|
-
scope: (t, n) => /* @__PURE__ */ P(
|
|
2398
|
+
layoutConfigStorage: yi(),
|
|
2399
|
+
scope: (t, n) => /* @__PURE__ */ P(Si, {
|
|
2380
2400
|
scene: e,
|
|
2381
2401
|
routeState: r,
|
|
2382
2402
|
strings: i,
|
|
@@ -2386,13 +2406,13 @@ function gi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2386
2406
|
onSystemSchemeChange: x,
|
|
2387
2407
|
children: n
|
|
2388
2408
|
}),
|
|
2389
|
-
renderScreen: (e, n) => /* @__PURE__ */ P(
|
|
2409
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(wi, {
|
|
2390
2410
|
element: e,
|
|
2391
2411
|
configuration: n,
|
|
2392
2412
|
registry: t
|
|
2393
2413
|
}),
|
|
2394
|
-
renderDialog: () => /* @__PURE__ */ P(
|
|
2395
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(
|
|
2414
|
+
renderDialog: () => /* @__PURE__ */ P(dr, {}),
|
|
2415
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(Ti, {
|
|
2396
2416
|
template: e,
|
|
2397
2417
|
content: n,
|
|
2398
2418
|
registry: t,
|
|
@@ -2404,7 +2424,7 @@ function gi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2404
2424
|
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." })]
|
|
2405
2425
|
});
|
|
2406
2426
|
}
|
|
2407
|
-
function
|
|
2427
|
+
function Si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2408
2428
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2409
2429
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2410
2430
|
let e = (e) => {
|
|
@@ -2424,19 +2444,19 @@ function _i({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2424
2444
|
}, [p, e]), /* @__PURE__ */ F(de, {
|
|
2425
2445
|
themes: a,
|
|
2426
2446
|
children: [
|
|
2427
|
-
o && /* @__PURE__ */ P(
|
|
2447
|
+
o && /* @__PURE__ */ P(ai, {
|
|
2428
2448
|
settings: o,
|
|
2429
2449
|
onSystemSchemeChange: s
|
|
2430
2450
|
}),
|
|
2431
|
-
/* @__PURE__ */ P(
|
|
2432
|
-
/* @__PURE__ */ P(
|
|
2451
|
+
/* @__PURE__ */ P(Yr, {}),
|
|
2452
|
+
/* @__PURE__ */ P(Mt, {
|
|
2433
2453
|
routes: t.routes,
|
|
2434
2454
|
routesReady: t.ready,
|
|
2435
2455
|
parameters: r.currentParameters,
|
|
2436
2456
|
locale: n.locale,
|
|
2437
2457
|
locales: n.locales,
|
|
2438
2458
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2439
|
-
children: /* @__PURE__ */ P(
|
|
2459
|
+
children: /* @__PURE__ */ P(Ci, {
|
|
2440
2460
|
activity: d,
|
|
2441
2461
|
routesReady: t.ready,
|
|
2442
2462
|
scene: e,
|
|
@@ -2448,12 +2468,12 @@ function _i({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2448
2468
|
]
|
|
2449
2469
|
});
|
|
2450
2470
|
}
|
|
2451
|
-
function
|
|
2452
|
-
let s = z(), c = se(), l =
|
|
2471
|
+
function Ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2472
|
+
let s = z(), c = se(), l = Yt(), d = o(() => fi(l, t, s.refreshAfterCommand), [
|
|
2453
2473
|
l,
|
|
2454
2474
|
t,
|
|
2455
2475
|
s.refreshAfterCommand
|
|
2456
|
-
]), f = o(() =>
|
|
2476
|
+
]), f = o(() => ui(n.commandSchemas), [n.commandSchemas]), p = ie({
|
|
2457
2477
|
executeCommand: async (e, n) => {
|
|
2458
2478
|
let i = U(e);
|
|
2459
2479
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
@@ -2472,7 +2492,7 @@ function vi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2472
2492
|
};
|
|
2473
2493
|
},
|
|
2474
2494
|
navigate: (e, t) => {
|
|
2475
|
-
n.screens.some((t) => t.name === e) ? W(e,
|
|
2495
|
+
n.screens.some((t) => t.name === e) ? W(e, Zt(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
2476
2496
|
},
|
|
2477
2497
|
navigateBack: () => globalThis.history?.back(),
|
|
2478
2498
|
openDialog: async (e) => {
|
|
@@ -2489,7 +2509,7 @@ function vi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2489
2509
|
refreshQuery: async (e) => s.refreshQuery(e),
|
|
2490
2510
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
2491
2511
|
});
|
|
2492
|
-
return /* @__PURE__ */ P(
|
|
2512
|
+
return /* @__PURE__ */ P(Vr, {
|
|
2493
2513
|
state: {
|
|
2494
2514
|
locales: i.locales,
|
|
2495
2515
|
locale: i.locale,
|
|
@@ -2514,9 +2534,9 @@ function vi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2514
2534
|
})
|
|
2515
2535
|
});
|
|
2516
2536
|
}
|
|
2517
|
-
function
|
|
2518
|
-
let r = z(), i =
|
|
2519
|
-
return /* @__PURE__ */ F(je, { children: [/* @__PURE__ */ P(
|
|
2537
|
+
function wi({ element: e, configuration: t, registry: n }) {
|
|
2538
|
+
let r = z(), i = Wt();
|
|
2539
|
+
return /* @__PURE__ */ F(je, { children: [/* @__PURE__ */ P(wr, { element: e }), /* @__PURE__ */ P(T, {
|
|
2520
2540
|
element: e,
|
|
2521
2541
|
registry: n,
|
|
2522
2542
|
resolveBinding: r.resolveBinding,
|
|
@@ -2525,8 +2545,8 @@ function yi({ element: e, configuration: t, registry: n }) {
|
|
|
2525
2545
|
configuration: t
|
|
2526
2546
|
})] });
|
|
2527
2547
|
}
|
|
2528
|
-
function
|
|
2529
|
-
let o = z(), s =
|
|
2548
|
+
function Ti({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
2549
|
+
let o = z(), s = Wt(), c = y(t, r.dictionary);
|
|
2530
2550
|
return i(() => {
|
|
2531
2551
|
let e = (e) => {
|
|
2532
2552
|
e.key === "Escape" && a();
|
|
@@ -2555,9 +2575,9 @@ function bi({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2555
2575
|
}
|
|
2556
2576
|
//#endregion
|
|
2557
2577
|
//#region src/stageTheme.ts
|
|
2558
|
-
var
|
|
2559
|
-
preset:
|
|
2560
|
-
options: { darkModeSelector:
|
|
2578
|
+
var Ei = "[data-scene-color-scheme='dark']", Di = {
|
|
2579
|
+
preset: qe,
|
|
2580
|
+
options: { darkModeSelector: Ei }
|
|
2561
2581
|
};
|
|
2562
2582
|
//#endregion
|
|
2563
|
-
export {
|
|
2583
|
+
export { bi as App, bi as StageApplication, yn as StageCommandForm, Mt as StageDataProvider, er as StageGuardedAction, Ze as StageSourceProvider, vi as composeStageScreen, fi as createStageSliceInvoker, Nt as dataChanged, qt as executeRegisteredCommand, ut as performQuery, ot as registerQueryRouteResolver, U as registeredCommand, st as registeredQuery, ui as sliceFieldsFrom, mi as stageApplicationRegistry, _i as stageComposition, Ei as stageDarkSelector, Ye as stageEndpoints, gi as stageShellOf, Di as stageTheme, Je as staticStageSource, dt as subscribeQuery, Yt as useStageCommandExecutor, z as useStageData, B as useStageQuery, Qe as useStageSource };
|