@cratis/stage.runtime 4.190.1 → 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 +560 -555
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import { createContext as e, createElement as t, useCallback as n, useContext as
|
|
|
3
3
|
import { ColorScheme as l, DestinationKind as u, FormGenerationMode as d, FormWidthUnit as f, InteractionTriggerKind as p } from "@cratis/scene.model";
|
|
4
4
|
import { ShellDiagnosticCode as m, ShellOrigin as h, createBindingResolver as g, resolveArgumentSource as _, resolveBehaviors as v, resolveStringsInElement as y, runBindings as b, validateBindingExpression as x } from "@cratis/scene.engine";
|
|
5
5
|
import { CoreSliceDialog as S, CoreToolbarItem as C, InteractionScope as w, SceneElementView as T, SceneNavigationContextInternal as ee, SliceCommandFieldsProvider as te, SliceDialogView as ne, SliceInvokerProvider as E, attachmentFor as re, coreComponents as D, createBrowserDispatcher as ie, createHashSceneHistory as O, sliceDialogParameters as k, useInteractionScope as ae, useOptionalSceneNavigation as oe, useSceneNavigation as se, useSceneOutlets as ce, useSceneTheme as A } from "@cratis/scene.react";
|
|
6
|
-
import { ApplicationHost as le, ColorScheme as
|
|
6
|
+
import { ApplicationHost as le, ColorScheme as ue, ComponentName as j, LayoutThemeProvider as de, SlotName as M, blueprintPackageCatalog as fe, composeApplicationScreen as pe, defaultBlueprintComponents as me, defaultBlueprintName as he, defaultBlueprintThemes as ge, effectiveShellOf as _e, externalComponent as N, galleryScreenTemplates as ve, layoutModes as ye, menuThemes as be, navigationElement as xe, previewComponents as Se, previewProfile as Ce, useLayoutConfig as we } from "@cratis/scene.blueprint.default";
|
|
7
7
|
import "@cratis/scene.blueprint.default/styles.css";
|
|
8
|
-
import { ArcContext as
|
|
9
|
-
import { ObservableQueryFor as
|
|
10
|
-
import { resolveCommand as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { Button as
|
|
8
|
+
import { ArcContext as Te } from "@cratis/arc.react";
|
|
9
|
+
import { ObservableQueryFor as Ee, Paging as De, QueryFor as Oe } from "@cratis/arc/queries";
|
|
10
|
+
import { resolveCommand as ke, resolveExactQuery as Ae } from "@cratis/scene.components";
|
|
11
|
+
import { Fragment as je, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
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
14
|
import { DateOnly as Ie, Guid as Le } from "@cratis/fundamentals";
|
|
15
15
|
import { Command as Re } from "@cratis/arc/commands";
|
|
@@ -79,37 +79,51 @@ function nt(e, t) {
|
|
|
79
79
|
return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region src/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
}
|
|
86
91
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
return n === "ambiguous" && t && (n = ke(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), ot(n) ? n : t ? rt?.(t) : void 0;
|
|
92
|
+
function it(e) {
|
|
93
|
+
return e || rt();
|
|
90
94
|
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/queryExecutor.ts
|
|
97
|
+
var at;
|
|
91
98
|
function ot(e) {
|
|
92
|
-
|
|
99
|
+
at = e;
|
|
93
100
|
}
|
|
94
101
|
function st(e, t) {
|
|
95
|
-
|
|
102
|
+
let n = Ae(e);
|
|
103
|
+
return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), ct(n) ? n : t ? at?.(t) : void 0;
|
|
96
104
|
}
|
|
97
|
-
function ct(e
|
|
105
|
+
function ct(e) {
|
|
106
|
+
return typeof e == "function" && (e.prototype instanceof Oe || e.prototype instanceof Ee);
|
|
107
|
+
}
|
|
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;
|
|
110
|
+
}
|
|
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
|
|
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 pt(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 gt(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 Tt() {
|
|
|
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 Et = "cratis.stage.data-changed", Dt = 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 At({ routes: e, routesReady: t = !0, parameters: r = kt, 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,31 +290,31 @@ function At({ routes: e, routesReady: t = !0, parameters: r = kt, 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) => ({
|
|
283
297
|
query: e,
|
|
284
298
|
version: t.version + 1
|
|
285
|
-
})), []), le = s([]),
|
|
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
|
-
let
|
|
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
|
}, [
|
|
@@ -312,9 +326,9 @@ function At({ routes: e, routesReady: t = !0, parameters: r = kt, locale: a, loc
|
|
|
312
326
|
D,
|
|
313
327
|
f,
|
|
314
328
|
ae,
|
|
315
|
-
|
|
329
|
+
j,
|
|
316
330
|
v
|
|
317
|
-
]),
|
|
331
|
+
]), M = n((e) => e ? _(e, Pt(j, f, C, {
|
|
318
332
|
...D,
|
|
319
333
|
...T
|
|
320
334
|
}, v)) : void 0, [
|
|
@@ -322,16 +336,16 @@ function At({ routes: e, routesReady: t = !0, parameters: r = kt, locale: a, loc
|
|
|
322
336
|
C,
|
|
323
337
|
D,
|
|
324
338
|
f,
|
|
325
|
-
|
|
339
|
+
j,
|
|
326
340
|
v
|
|
327
|
-
]),
|
|
341
|
+
]), fe = n((e, t) => ne((n) => ({
|
|
328
342
|
...n,
|
|
329
343
|
[e]: t
|
|
330
|
-
})), []),
|
|
344
|
+
})), []), pe = n((e) => ne((t) => {
|
|
331
345
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
332
346
|
let n = { ...t };
|
|
333
347
|
return delete n[e], n;
|
|
334
|
-
}), []),
|
|
348
|
+
}), []), me = o(() => Pt(void 0, f, {}, {}, {}).queryResults, [f]), he = o(() => ({
|
|
335
349
|
locale: a,
|
|
336
350
|
locales: l,
|
|
337
351
|
screen: u,
|
|
@@ -340,19 +354,19 @@ function At({ routes: e, routesReady: t = !0, parameters: r = kt, locale: a, loc
|
|
|
340
354
|
parameters: O,
|
|
341
355
|
session: k,
|
|
342
356
|
queries: f,
|
|
343
|
-
selected:
|
|
357
|
+
selected: j,
|
|
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
|
-
publishComponentOutputs:
|
|
350
|
-
withdrawComponentOutputs:
|
|
351
|
-
queryResults:
|
|
363
|
+
publishComponentOutputs: fe,
|
|
364
|
+
withdrawComponentOutputs: pe,
|
|
365
|
+
queryResults: me,
|
|
352
366
|
refreshQuery: A,
|
|
353
|
-
refreshAfterCommand:
|
|
354
|
-
resolveBinding:
|
|
355
|
-
resolveArgument:
|
|
367
|
+
refreshAfterCommand: ue,
|
|
368
|
+
resolveBinding: de,
|
|
369
|
+
resolveArgument: M,
|
|
356
370
|
registerQueryResult: ie,
|
|
357
371
|
refreshVersion: E.version,
|
|
358
372
|
refreshQueryName: E.query
|
|
@@ -361,34 +375,34 @@ function At({ routes: e, routesReady: t = !0, parameters: r = kt, locale: a, loc
|
|
|
361
375
|
a,
|
|
362
376
|
l,
|
|
363
377
|
f,
|
|
364
|
-
|
|
378
|
+
ue,
|
|
365
379
|
A,
|
|
366
380
|
E.query,
|
|
367
381
|
E.version,
|
|
368
382
|
ie,
|
|
369
|
-
de,
|
|
370
383
|
fe,
|
|
371
384
|
pe,
|
|
372
|
-
|
|
373
|
-
|
|
385
|
+
me,
|
|
386
|
+
M,
|
|
387
|
+
de,
|
|
374
388
|
e,
|
|
375
389
|
t,
|
|
376
390
|
O,
|
|
377
391
|
k,
|
|
378
392
|
u,
|
|
379
393
|
oe,
|
|
380
|
-
|
|
394
|
+
j,
|
|
381
395
|
v,
|
|
382
396
|
ce
|
|
383
397
|
]);
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
value:
|
|
398
|
+
return /* @__PURE__ */ P(kt.Provider, {
|
|
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
|
-
let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } = z(), l = r(
|
|
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);
|
|
393
407
|
}, [u, o]), [f, p] = c([]), [m, h] = c(""), [g, _] = c(!1), [v, y] = c(0), b = s(0), x = s(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
|
|
394
408
|
return i(() => {
|
|
@@ -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) ? nt(o, e.changeSet) : e.data, p(
|
|
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
|
|
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 Pt(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 It(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 Lt(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 Bt(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
|
}
|
|
@@ -591,26 +605,17 @@ function U(e, t, n) {
|
|
|
591
605
|
e
|
|
592
606
|
]) {
|
|
593
607
|
if (!r) continue;
|
|
594
|
-
let t =
|
|
595
|
-
if (
|
|
608
|
+
let t = ke(r);
|
|
609
|
+
if (Gt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
596
610
|
}
|
|
597
611
|
}
|
|
598
|
-
function
|
|
612
|
+
function Gt(e) {
|
|
599
613
|
return typeof e == "function" && e.prototype instanceof Re;
|
|
600
614
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
if (!e) return "";
|
|
604
|
-
try {
|
|
605
|
-
return new URL(".", e).pathname.replace(/\/+$/, "");
|
|
606
|
-
} catch {
|
|
607
|
-
return "";
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
function Gt(e, t) {
|
|
611
|
-
return e.setApiBasePath(t || Wt()), e;
|
|
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 Kt(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 qt(e, t) {
|
|
|
638
643
|
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
639
644
|
};
|
|
640
645
|
}
|
|
641
|
-
function
|
|
642
|
-
let e = r(
|
|
643
|
-
return n((t, n) =>
|
|
646
|
+
function Yt() {
|
|
647
|
+
let e = r(Te);
|
|
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
|
|
661
|
+
function Zt(e) {
|
|
657
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 tn(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 tn(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 ln = Be((e) => /* @__PURE__ */ F(un, {
|
|
|
761
766
|
onBlur: e.onBlur,
|
|
762
767
|
invalid: e.invalid
|
|
763
768
|
}), { defaultValue: void 0 });
|
|
764
|
-
function
|
|
765
|
-
return e.members ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
784
|
+
}) : /* @__PURE__ */ P(mn, {
|
|
780
785
|
descriptor: e,
|
|
781
786
|
label: t,
|
|
782
787
|
value: n,
|
|
@@ -785,12 +790,12 @@ function un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
785
790
|
invalid: a
|
|
786
791
|
});
|
|
787
792
|
}
|
|
788
|
-
function
|
|
789
|
-
let o =
|
|
790
|
-
return /* @__PURE__ */
|
|
793
|
+
function fn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
794
|
+
let o = _n(n) ? n : {};
|
|
795
|
+
return /* @__PURE__ */ F("fieldset", {
|
|
791
796
|
className: "stage-record-field",
|
|
792
797
|
"data-invalid": a ? "true" : void 0,
|
|
793
|
-
children: [/* @__PURE__ */
|
|
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,74 +807,74 @@ function dn({ 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
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ F("fieldset", {
|
|
808
813
|
className: "stage-list-field",
|
|
809
814
|
"data-invalid": a ? "true" : void 0,
|
|
810
815
|
children: [
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
s.length === 0 && /* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ P("legend", { children: t }),
|
|
817
|
+
s.length === 0 && /* @__PURE__ */ P("p", {
|
|
813
818
|
className: "stage-note",
|
|
814
819
|
children: "Nothing added yet."
|
|
815
820
|
}),
|
|
816
|
-
s.map((e, n) => /* @__PURE__ */
|
|
821
|
+
s.map((e, n) => /* @__PURE__ */ F("div", {
|
|
817
822
|
className: "stage-list-field__row",
|
|
818
|
-
children: [/* @__PURE__ */
|
|
823
|
+
children: [/* @__PURE__ */ P(dn, {
|
|
819
824
|
descriptor: o,
|
|
820
825
|
label: `${t} ${n + 1}`,
|
|
821
826
|
value: e,
|
|
822
827
|
onBlur: i,
|
|
823
828
|
onChange: (e) => c(s.map((t, r) => r === n ? e : t))
|
|
824
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ P("button", {
|
|
825
830
|
type: "button",
|
|
826
831
|
"aria-label": `Remove ${t} ${n + 1}`,
|
|
827
832
|
onClick: () => c(s.filter((e, t) => t !== n)),
|
|
828
833
|
children: "Remove"
|
|
829
834
|
})]
|
|
830
835
|
}, n)),
|
|
831
|
-
/* @__PURE__ */
|
|
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
|
|
844
849
|
};
|
|
845
|
-
if (e.options) return /* @__PURE__ */
|
|
850
|
+
if (e.options) return /* @__PURE__ */ F("label", {
|
|
846
851
|
className: "stage-value-field",
|
|
847
|
-
children: [/* @__PURE__ */
|
|
852
|
+
children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ F("select", {
|
|
848
853
|
...o,
|
|
849
854
|
value: typeof n == "string" ? n : "",
|
|
850
855
|
onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
|
|
851
|
-
children: [/* @__PURE__ */
|
|
856
|
+
children: [/* @__PURE__ */ P("option", {
|
|
852
857
|
value: "",
|
|
853
858
|
children: ""
|
|
854
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
859
|
+
}), e.options.map((e) => /* @__PURE__ */ P("option", {
|
|
855
860
|
value: e,
|
|
856
861
|
children: G(e)
|
|
857
862
|
}, e))]
|
|
858
863
|
})]
|
|
859
864
|
});
|
|
860
865
|
switch (e.type) {
|
|
861
|
-
case "boolean": return /* @__PURE__ */
|
|
866
|
+
case "boolean": return /* @__PURE__ */ F("label", {
|
|
862
867
|
className: "stage-value-field stage-value-field--check",
|
|
863
|
-
children: [/* @__PURE__ */
|
|
868
|
+
children: [/* @__PURE__ */ P("input", {
|
|
864
869
|
...o,
|
|
865
870
|
type: "checkbox",
|
|
866
871
|
checked: n === !0,
|
|
867
872
|
onChange: (e) => r(e.target.checked)
|
|
868
|
-
}), /* @__PURE__ */
|
|
873
|
+
}), /* @__PURE__ */ P("span", { children: t })]
|
|
869
874
|
});
|
|
870
|
-
case "number": return /* @__PURE__ */
|
|
875
|
+
case "number": return /* @__PURE__ */ F("label", {
|
|
871
876
|
className: "stage-value-field",
|
|
872
|
-
children: [/* @__PURE__ */
|
|
877
|
+
children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
|
|
873
878
|
...o,
|
|
874
879
|
type: "number",
|
|
875
880
|
step: "any",
|
|
@@ -877,18 +882,18 @@ function pn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
877
882
|
onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
|
|
878
883
|
})]
|
|
879
884
|
});
|
|
880
|
-
case "date": return /* @__PURE__ */
|
|
885
|
+
case "date": return /* @__PURE__ */ F("label", {
|
|
881
886
|
className: "stage-value-field",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
887
|
+
children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
|
|
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
|
-
default: return /* @__PURE__ */
|
|
894
|
+
default: return /* @__PURE__ */ F("label", {
|
|
890
895
|
className: "stage-value-field",
|
|
891
|
-
children: [/* @__PURE__ */
|
|
896
|
+
children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
|
|
892
897
|
...o,
|
|
893
898
|
type: "text",
|
|
894
899
|
value: typeof n == "string" ? n : "",
|
|
@@ -897,116 +902,116 @@ function pn({ 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(
|
|
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 ?
|
|
934
|
-
return a ? !d && !t.routesReady ? /* @__PURE__ */
|
|
938
|
+
]), b = o(() => a ? Gn(a.layout, u) : [], [a, u]), [x, S] = c([]);
|
|
939
|
+
return a ? !d && !t.routesReady ? /* @__PURE__ */ F("p", {
|
|
935
940
|
className: "stage-note",
|
|
936
941
|
children: [
|
|
937
942
|
"The modeled command “",
|
|
938
943
|
a.command,
|
|
939
944
|
"” is waiting for Stage routes."
|
|
940
945
|
]
|
|
941
|
-
}) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */
|
|
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__ */
|
|
949
|
+
}) : y.length > 0 ? /* @__PURE__ */ P(bn, {
|
|
945
950
|
form: a,
|
|
946
951
|
messages: y
|
|
947
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
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");
|
|
965
970
|
n && W(n, {}), i?.();
|
|
966
971
|
},
|
|
967
972
|
children: [
|
|
968
|
-
b.map((e) => /* @__PURE__ */
|
|
973
|
+
b.map((e) => /* @__PURE__ */ P("p", {
|
|
969
974
|
role: "alert",
|
|
970
975
|
className: "stage-form-error",
|
|
971
976
|
children: e
|
|
972
977
|
}, e)),
|
|
973
978
|
v,
|
|
974
|
-
x.map((e) => /* @__PURE__ */
|
|
979
|
+
x.map((e) => /* @__PURE__ */ P("p", {
|
|
975
980
|
role: "alert",
|
|
976
981
|
className: "stage-form-error",
|
|
977
982
|
children: e
|
|
978
983
|
}, e)),
|
|
979
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ F("button", {
|
|
980
985
|
type: "submit",
|
|
981
986
|
children: ["Execute ", a.label]
|
|
982
987
|
})
|
|
983
988
|
]
|
|
984
989
|
}, m)
|
|
985
|
-
}) : /* @__PURE__ */
|
|
990
|
+
}) : /* @__PURE__ */ F("p", {
|
|
986
991
|
className: "stage-note",
|
|
987
992
|
children: [
|
|
988
993
|
"The modeled command “",
|
|
989
994
|
a.command,
|
|
990
995
|
"” is not registered by this Stage."
|
|
991
996
|
]
|
|
992
|
-
}) : /* @__PURE__ */
|
|
997
|
+
}) : /* @__PURE__ */ P("p", {
|
|
993
998
|
className: "stage-note",
|
|
994
999
|
children: "This form is missing its command metadata."
|
|
995
1000
|
});
|
|
996
1001
|
}
|
|
997
|
-
function
|
|
998
|
-
return /* @__PURE__ */
|
|
1002
|
+
function bn({ form: e, messages: t }) {
|
|
1003
|
+
return /* @__PURE__ */ P("section", {
|
|
999
1004
|
className: "stage-command-form",
|
|
1000
1005
|
"data-command": e.command,
|
|
1001
1006
|
"data-generation-mode": e.generationMode,
|
|
1002
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1007
|
+
children: t.map((e) => /* @__PURE__ */ P("p", {
|
|
1003
1008
|
role: "alert",
|
|
1004
1009
|
className: "stage-form-error",
|
|
1005
1010
|
children: e
|
|
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,41 +1019,41 @@ function bn(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();
|
|
1035
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ F("div", {
|
|
1036
1041
|
className: "stage-command-form__layout",
|
|
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__ */
|
|
1056
|
+
return /* @__PURE__ */ P(We, {
|
|
1052
1057
|
value: o,
|
|
1053
1058
|
fieldName: r,
|
|
1054
1059
|
title: a,
|
|
@@ -1058,7 +1063,7 @@ function Cn(e, t, n) {
|
|
|
1058
1063
|
optionLabel: "label"
|
|
1059
1064
|
});
|
|
1060
1065
|
}
|
|
1061
|
-
if (i?.members || i?.item) return /* @__PURE__ */
|
|
1066
|
+
if (i?.members || i?.item) return /* @__PURE__ */ P(un, {
|
|
1062
1067
|
value: o,
|
|
1063
1068
|
fieldName: r,
|
|
1064
1069
|
title: a,
|
|
@@ -1066,19 +1071,19 @@ function Cn(e, t, n) {
|
|
|
1066
1071
|
descriptor: i
|
|
1067
1072
|
});
|
|
1068
1073
|
switch (i?.type ?? "text") {
|
|
1069
|
-
case "number": return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1086
|
+
case "date": return /* @__PURE__ */ P(Tn, {
|
|
1082
1087
|
value: o,
|
|
1083
1088
|
fieldName: r,
|
|
1084
1089
|
title: a,
|
|
@@ -1086,15 +1091,15 @@ function Cn(e, t, n) {
|
|
|
1086
1091
|
showIcon: !0,
|
|
1087
1092
|
showTime: i?.withTime
|
|
1088
1093
|
});
|
|
1089
|
-
default: return /* @__PURE__ */
|
|
1094
|
+
default: return /* @__PURE__ */ P(Ge, {
|
|
1090
1095
|
value: o,
|
|
1091
1096
|
fieldName: r,
|
|
1092
1097
|
title: a,
|
|
1093
1098
|
required: s
|
|
1094
1099
|
});
|
|
1095
1100
|
}
|
|
1096
|
-
})(), l =
|
|
1097
|
-
return /* @__PURE__ */
|
|
1101
|
+
})(), l = Hn(n);
|
|
1102
|
+
return /* @__PURE__ */ P("span", {
|
|
1098
1103
|
className: "stage-command-form__field",
|
|
1099
1104
|
"data-field": e.name,
|
|
1100
1105
|
"data-row": n?.row,
|
|
@@ -1104,12 +1109,12 @@ function Cn(e, t, n) {
|
|
|
1104
1109
|
children: c
|
|
1105
1110
|
}, e.name);
|
|
1106
1111
|
}
|
|
1107
|
-
var
|
|
1112
|
+
var Tn = Ve((e) => /* @__PURE__ */ P(He, {
|
|
1108
1113
|
...e,
|
|
1109
|
-
currentValue: e.showTime ? e.currentValue :
|
|
1114
|
+
currentValue: e.showTime ? e.currentValue : En(e.currentValue),
|
|
1110
1115
|
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ie.fromDate(t) : t)
|
|
1111
1116
|
}));
|
|
1112
|
-
function
|
|
1117
|
+
function En(e) {
|
|
1113
1118
|
if (e instanceof Ie) return e.toDate();
|
|
1114
1119
|
if (typeof e != "string") return e;
|
|
1115
1120
|
try {
|
|
@@ -1118,7 +1123,7 @@ function Tn(e) {
|
|
|
1118
1123
|
return null;
|
|
1119
1124
|
}
|
|
1120
1125
|
}
|
|
1121
|
-
function
|
|
1126
|
+
function Dn(e, t) {
|
|
1122
1127
|
let n = {};
|
|
1123
1128
|
for (let r of e) {
|
|
1124
1129
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1126,32 +1131,32 @@ function En(e, t) {
|
|
|
1126
1131
|
}
|
|
1127
1132
|
return n;
|
|
1128
1133
|
}
|
|
1129
|
-
function
|
|
1134
|
+
function On(e, t, n, r = []) {
|
|
1130
1135
|
let i = new Set(e.map((e) => e.sourceProperty ?? e.name)), a = t.some((e) => e.identity), o = {};
|
|
1131
1136
|
for (let e of t) {
|
|
1132
1137
|
if (!e.identifier || !e.required || i.has(e.name)) continue;
|
|
1133
|
-
let t =
|
|
1138
|
+
let t = An(e, n) ?? jn(e, r) ?? (e.identity || !a ? Et(e.identifier) : void 0);
|
|
1134
1139
|
t !== void 0 && (o[e.name] = t);
|
|
1135
1140
|
}
|
|
1136
1141
|
return o;
|
|
1137
1142
|
}
|
|
1138
|
-
function On(e, t) {
|
|
1139
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 || kn(e, t) !== void 0;
|
|
1140
|
-
}
|
|
1141
1143
|
function kn(e, t) {
|
|
1142
|
-
|
|
1144
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || An(e, t) !== void 0;
|
|
1143
1145
|
}
|
|
1144
1146
|
function An(e, t) {
|
|
1147
|
+
if (e.identifier) return t[e.name] || Tt(e.identifier);
|
|
1148
|
+
}
|
|
1149
|
+
function jn(e, t) {
|
|
1145
1150
|
if (!e.identifier) return;
|
|
1146
1151
|
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1147
1152
|
return n.size === 1 ? [...n][0] : void 0;
|
|
1148
1153
|
}
|
|
1149
|
-
function
|
|
1154
|
+
function Mn(e) {
|
|
1150
1155
|
let t = e.properties.populateSource;
|
|
1151
1156
|
return J(t) ? t : void 0;
|
|
1152
1157
|
}
|
|
1153
|
-
function
|
|
1154
|
-
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({
|
|
1155
1160
|
scope: `populate:${q(e, "command")}`,
|
|
1156
1161
|
name: i,
|
|
1157
1162
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
@@ -1164,58 +1169,58 @@ function Mn(e, t, n) {
|
|
|
1164
1169
|
let e = {};
|
|
1165
1170
|
for (let n of t) {
|
|
1166
1171
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1167
|
-
t != null && (e[n.name] =
|
|
1172
|
+
t != null && (e[n.name] = cn(n, t));
|
|
1168
1173
|
}
|
|
1169
1174
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1170
1175
|
}, [d, t]);
|
|
1171
1176
|
}
|
|
1172
|
-
function
|
|
1177
|
+
function Pn(e, t, n, r) {
|
|
1173
1178
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1174
1179
|
if (i) return i;
|
|
1175
1180
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
1176
|
-
if (a) return
|
|
1181
|
+
if (a) return Et(a);
|
|
1177
1182
|
let o = r.resolveBinding({ path: t });
|
|
1178
1183
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1179
1184
|
}
|
|
1180
|
-
function
|
|
1181
|
-
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);
|
|
1182
1187
|
return o(() => {
|
|
1183
1188
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1184
1189
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1185
1190
|
}, [r, a]);
|
|
1186
1191
|
}
|
|
1187
|
-
function
|
|
1192
|
+
function In(e, t) {
|
|
1188
1193
|
let n = e.properties.arguments;
|
|
1189
1194
|
if (!Array.isArray(n)) return [];
|
|
1190
1195
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1191
1196
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1192
1197
|
}
|
|
1193
|
-
function
|
|
1198
|
+
function Ln(e) {
|
|
1194
1199
|
return e === d.Manual ? d.Manual : d.Auto;
|
|
1195
1200
|
}
|
|
1196
|
-
function
|
|
1201
|
+
function Rn(e) {
|
|
1197
1202
|
if (!J(e)) return;
|
|
1198
1203
|
let t = e;
|
|
1199
1204
|
return {
|
|
1200
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1201
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1202
|
-
columnGap:
|
|
1203
|
-
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
|
|
1204
1209
|
};
|
|
1205
1210
|
}
|
|
1206
|
-
function
|
|
1211
|
+
function zn(e, t) {
|
|
1207
1212
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1208
|
-
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);
|
|
1209
1214
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1210
1215
|
}
|
|
1211
|
-
function
|
|
1216
|
+
function Bn(e, t) {
|
|
1212
1217
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1213
1218
|
}
|
|
1214
|
-
function
|
|
1219
|
+
function Vn(e, t) {
|
|
1215
1220
|
let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
|
|
1216
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";
|
|
1217
1222
|
}
|
|
1218
|
-
function
|
|
1223
|
+
function Hn(e) {
|
|
1219
1224
|
if (e) return {
|
|
1220
1225
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1221
1226
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
@@ -1230,36 +1235,36 @@ function K(e) {
|
|
|
1230
1235
|
case f.Auto: return "auto";
|
|
1231
1236
|
}
|
|
1232
1237
|
}
|
|
1233
|
-
function
|
|
1238
|
+
function Un(e, t, n, r) {
|
|
1234
1239
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1235
|
-
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;
|
|
1236
1241
|
}
|
|
1237
|
-
function
|
|
1242
|
+
function Wn(e, t) {
|
|
1238
1243
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1239
1244
|
return e.flatMap((e) => {
|
|
1240
1245
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1241
1246
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1242
1247
|
});
|
|
1243
1248
|
}
|
|
1244
|
-
function
|
|
1249
|
+
function Gn(e, t) {
|
|
1245
1250
|
if (!e) return [];
|
|
1246
|
-
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.`);
|
|
1247
1252
|
return [...n, ...r];
|
|
1248
1253
|
}
|
|
1249
|
-
function
|
|
1250
|
-
return
|
|
1254
|
+
function Kn(e) {
|
|
1255
|
+
return $t(q(e, "schema"));
|
|
1251
1256
|
}
|
|
1252
1257
|
function q(e, t, n = "") {
|
|
1253
1258
|
let r = e.properties[t];
|
|
1254
1259
|
return typeof r == "string" ? r : n;
|
|
1255
1260
|
}
|
|
1256
|
-
function
|
|
1261
|
+
function qn(e) {
|
|
1257
1262
|
return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1258
1263
|
}
|
|
1259
|
-
function
|
|
1264
|
+
function Jn(e) {
|
|
1260
1265
|
return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1261
1266
|
}
|
|
1262
|
-
function
|
|
1267
|
+
function Yn(e) {
|
|
1263
1268
|
return J(e) && Object.values(f).includes(e.unit);
|
|
1264
1269
|
}
|
|
1265
1270
|
function J(e) {
|
|
@@ -1267,20 +1272,20 @@ function J(e) {
|
|
|
1267
1272
|
}
|
|
1268
1273
|
//#endregion
|
|
1269
1274
|
//#region src/StageGuardedAction.tsx
|
|
1270
|
-
function
|
|
1275
|
+
function Xn(e) {
|
|
1271
1276
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1272
1277
|
}
|
|
1273
1278
|
function Y(e, t) {
|
|
1274
1279
|
let n = e.properties[t];
|
|
1275
1280
|
return typeof n == "string" ? n : "";
|
|
1276
1281
|
}
|
|
1277
|
-
function
|
|
1282
|
+
function Zn(e) {
|
|
1278
1283
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1279
1284
|
}
|
|
1280
|
-
function
|
|
1281
|
-
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;
|
|
1282
1287
|
for (let [e, n] of Object.entries(i)) {
|
|
1283
|
-
let r =
|
|
1288
|
+
let r = Xn(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1284
1289
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1285
1290
|
}
|
|
1286
1291
|
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
|
|
@@ -1299,23 +1304,23 @@ function Zn(e) {
|
|
|
1299
1304
|
item: l.rows.length === 1 ? l.rows[0] : void 0
|
|
1300
1305
|
};
|
|
1301
1306
|
}
|
|
1302
|
-
function
|
|
1303
|
-
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)]));
|
|
1304
1309
|
}
|
|
1305
|
-
function
|
|
1306
|
-
let n = z(), r =
|
|
1307
|
-
if (!
|
|
1308
|
-
let n = r.hasSource ? `${
|
|
1309
|
-
return /* @__PURE__ */
|
|
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.`;
|
|
1314
|
+
return /* @__PURE__ */ F("div", {
|
|
1310
1315
|
className: "stage-guarded-action",
|
|
1311
1316
|
"data-scene-id": e.id,
|
|
1312
|
-
children: [/* @__PURE__ */
|
|
1317
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1313
1318
|
type: "button",
|
|
1314
1319
|
disabled: !0,
|
|
1315
1320
|
title: n,
|
|
1316
1321
|
...t,
|
|
1317
1322
|
children: d
|
|
1318
|
-
}), /* @__PURE__ */
|
|
1323
|
+
}), /* @__PURE__ */ P("p", {
|
|
1319
1324
|
role: "alert",
|
|
1320
1325
|
className: "stage-form-error",
|
|
1321
1326
|
children: n
|
|
@@ -1323,41 +1328,41 @@ function $n({ element: e, interactions: t }) {
|
|
|
1323
1328
|
});
|
|
1324
1329
|
}
|
|
1325
1330
|
if (!r.item) return null;
|
|
1326
|
-
let g =
|
|
1331
|
+
let g = xt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1327
1332
|
if (!_?.command) return null;
|
|
1328
1333
|
let v = _.command, y = U(v), b = r.item, x = async () => {
|
|
1329
1334
|
if (!y) return;
|
|
1330
1335
|
u(!0);
|
|
1331
|
-
let t = await i(v,
|
|
1336
|
+
let t = await i(v, $n(_, b));
|
|
1332
1337
|
if (u(!1), s(t.messages), !t.isSuccess) return;
|
|
1333
1338
|
n.refreshAfterCommand();
|
|
1334
|
-
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;
|
|
1335
1340
|
r && W(r, a && o != null ? { [a]: String(o) } : {});
|
|
1336
1341
|
};
|
|
1337
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ F("div", {
|
|
1338
1343
|
className: "stage-guarded-action",
|
|
1339
1344
|
"data-scene-id": e.id,
|
|
1340
1345
|
"data-command": v,
|
|
1341
|
-
children: [/* @__PURE__ */
|
|
1346
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1342
1347
|
...t,
|
|
1343
1348
|
type: "button",
|
|
1344
1349
|
disabled: !y || l,
|
|
1345
1350
|
title: y ? void 0 : "This command is not exposed as an API yet",
|
|
1346
1351
|
onClick: () => void x(),
|
|
1347
1352
|
children: d
|
|
1348
|
-
}), a.map((e) => /* @__PURE__ */
|
|
1353
|
+
}), a.map((e) => /* @__PURE__ */ P("p", {
|
|
1349
1354
|
role: "alert",
|
|
1350
1355
|
className: "stage-form-error",
|
|
1351
1356
|
children: e
|
|
1352
1357
|
}, e))]
|
|
1353
1358
|
});
|
|
1354
1359
|
}
|
|
1355
|
-
function
|
|
1360
|
+
function tr(e) {
|
|
1356
1361
|
let t = ae(), r = s(void 0), a = o(() => v(re(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
|
|
1357
1362
|
i(() => () => clearTimeout(r.current), []);
|
|
1358
1363
|
let c = n((e) => {
|
|
1359
1364
|
if (clearTimeout(r.current), r.current = void 0, !t) return;
|
|
1360
|
-
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);
|
|
1361
1366
|
b(a, t.dispatcher, {
|
|
1362
1367
|
...t.context,
|
|
1363
1368
|
resolve: n
|
|
@@ -1380,7 +1385,7 @@ function er(e) {
|
|
|
1380
1385
|
}
|
|
1381
1386
|
//#endregion
|
|
1382
1387
|
//#region src/stageComponents.tsx
|
|
1383
|
-
var
|
|
1388
|
+
var nr = "Stage:commandForm";
|
|
1384
1389
|
function X(e, t, n = {}) {
|
|
1385
1390
|
return {
|
|
1386
1391
|
id: e,
|
|
@@ -1393,15 +1398,15 @@ function Z(e, t, n = "") {
|
|
|
1393
1398
|
let r = e.properties[t];
|
|
1394
1399
|
return typeof r == "string" ? r : n;
|
|
1395
1400
|
}
|
|
1396
|
-
function
|
|
1401
|
+
function rr(e, t) {
|
|
1397
1402
|
let n = e.properties.queryArguments;
|
|
1398
|
-
if (!
|
|
1403
|
+
if (!sr(n)) return {
|
|
1399
1404
|
values: {},
|
|
1400
1405
|
ready: !0
|
|
1401
1406
|
};
|
|
1402
1407
|
let r = {}, i = !0;
|
|
1403
1408
|
for (let [e, a] of Object.entries(n)) {
|
|
1404
|
-
let n =
|
|
1409
|
+
let n = or(a) ? t.resolveBinding(a) : a;
|
|
1405
1410
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1406
1411
|
}
|
|
1407
1412
|
return {
|
|
@@ -1409,7 +1414,7 @@ function nr(e, t) {
|
|
|
1409
1414
|
ready: i
|
|
1410
1415
|
};
|
|
1411
1416
|
}
|
|
1412
|
-
function
|
|
1417
|
+
function ir(e, t) {
|
|
1413
1418
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1414
1419
|
let t = e.properties;
|
|
1415
1420
|
return {
|
|
@@ -1425,14 +1430,14 @@ function rr(e, t) {
|
|
|
1425
1430
|
function Q(e, t) {
|
|
1426
1431
|
return e[t] ?? e.id ?? e.key;
|
|
1427
1432
|
}
|
|
1428
|
-
function
|
|
1429
|
-
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({
|
|
1430
1435
|
scope: e.id,
|
|
1431
1436
|
name: r,
|
|
1432
1437
|
route: a || void 0,
|
|
1433
1438
|
arguments: s.values,
|
|
1434
1439
|
ready: s.ready
|
|
1435
|
-
}), 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);
|
|
1436
1441
|
i(() => {
|
|
1437
1442
|
if (!h) return;
|
|
1438
1443
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1478,10 +1483,10 @@ function ir({ element: e, slots: t }) {
|
|
|
1478
1483
|
}
|
|
1479
1484
|
n.selectRow(e.id, t);
|
|
1480
1485
|
};
|
|
1481
|
-
return !Z(e, "query") && !a && !
|
|
1486
|
+
return !Z(e, "query") && !a && !st(r) ? /* @__PURE__ */ F("section", {
|
|
1482
1487
|
className: "stage-table",
|
|
1483
1488
|
"data-scene-id": e.id,
|
|
1484
|
-
children: [/* @__PURE__ */
|
|
1489
|
+
children: [/* @__PURE__ */ F("p", {
|
|
1485
1490
|
className: "stage-note",
|
|
1486
1491
|
children: [
|
|
1487
1492
|
"No query is exposed for ",
|
|
@@ -1489,25 +1494,25 @@ function ir({ element: e, slots: t }) {
|
|
|
1489
1494
|
" yet."
|
|
1490
1495
|
]
|
|
1491
1496
|
}), t.columns]
|
|
1492
|
-
}) : /* @__PURE__ */
|
|
1497
|
+
}) : /* @__PURE__ */ F("section", {
|
|
1493
1498
|
className: "stage-table",
|
|
1494
1499
|
"data-scene-id": e.id,
|
|
1495
1500
|
children: [
|
|
1496
|
-
u && /* @__PURE__ */
|
|
1501
|
+
u && /* @__PURE__ */ P(Ne, {
|
|
1497
1502
|
element: X(`${e.id}-loading`, {
|
|
1498
1503
|
severity: "info",
|
|
1499
1504
|
text: "Loading…"
|
|
1500
1505
|
}),
|
|
1501
1506
|
slots: {}
|
|
1502
1507
|
}),
|
|
1503
|
-
l && /* @__PURE__ */
|
|
1508
|
+
l && /* @__PURE__ */ P(Ne, {
|
|
1504
1509
|
element: X(`${e.id}-error`, {
|
|
1505
1510
|
severity: "error",
|
|
1506
1511
|
text: l
|
|
1507
1512
|
}),
|
|
1508
1513
|
slots: {}
|
|
1509
1514
|
}),
|
|
1510
|
-
h && /* @__PURE__ */
|
|
1515
|
+
h && /* @__PURE__ */ P(I, {
|
|
1511
1516
|
type: "button",
|
|
1512
1517
|
size: "small",
|
|
1513
1518
|
onClick: () => {
|
|
@@ -1517,12 +1522,12 @@ function ir({ element: e, slots: t }) {
|
|
|
1517
1522
|
},
|
|
1518
1523
|
children: "Clear selection"
|
|
1519
1524
|
}),
|
|
1520
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ F("table", {
|
|
1521
1526
|
"aria-label": Z(e, "label", Z(e, "typeName", "Results")),
|
|
1522
|
-
children: [/* @__PURE__ */
|
|
1527
|
+
children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ P("tr", { children: d.map((e) => /* @__PURE__ */ P("th", {
|
|
1523
1528
|
scope: "col",
|
|
1524
1529
|
children: e.label
|
|
1525
|
-
}, e.property)) }) }), /* @__PURE__ */
|
|
1530
|
+
}, e.property)) }) }), /* @__PURE__ */ F("tbody", { children: [c.map((e, t) => /* @__PURE__ */ P("tr", {
|
|
1526
1531
|
"aria-selected": h === e,
|
|
1527
1532
|
tabIndex: 0,
|
|
1528
1533
|
onClick: () => _.click(e, () => v(e)),
|
|
@@ -1530,8 +1535,8 @@ function ir({ element: e, slots: t }) {
|
|
|
1530
1535
|
onKeyDown: (t) => {
|
|
1531
1536
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
|
|
1532
1537
|
},
|
|
1533
|
-
children: d.map((t) => /* @__PURE__ */
|
|
1534
|
-
}, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */
|
|
1538
|
+
children: d.map((t) => /* @__PURE__ */ P("td", { children: String(e[t.property] ?? "") }, t.property))
|
|
1539
|
+
}, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ P("tr", { children: /* @__PURE__ */ P("td", {
|
|
1535
1540
|
colSpan: Math.max(d.length, 1),
|
|
1536
1541
|
children: "No records found"
|
|
1537
1542
|
}) })] })]
|
|
@@ -1539,28 +1544,28 @@ function ir({ element: e, slots: t }) {
|
|
|
1539
1544
|
]
|
|
1540
1545
|
});
|
|
1541
1546
|
}
|
|
1542
|
-
function ar(e) {
|
|
1543
|
-
return or(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1544
|
-
}
|
|
1545
1547
|
function or(e) {
|
|
1548
|
+
return sr(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1549
|
+
}
|
|
1550
|
+
function sr(e) {
|
|
1546
1551
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1547
1552
|
}
|
|
1548
|
-
function
|
|
1549
|
-
return
|
|
1553
|
+
function cr({ element: e, interactions: t, slots: n }) {
|
|
1554
|
+
return Zn(e) ? /* @__PURE__ */ P(er, {
|
|
1550
1555
|
element: e,
|
|
1551
1556
|
interactions: t
|
|
1552
|
-
}) : /* @__PURE__ */
|
|
1557
|
+
}) : /* @__PURE__ */ P(lr, {
|
|
1553
1558
|
element: e,
|
|
1554
1559
|
interactions: t,
|
|
1555
1560
|
slots: n
|
|
1556
1561
|
});
|
|
1557
1562
|
}
|
|
1558
|
-
function
|
|
1563
|
+
function lr({ element: e, interactions: t }) {
|
|
1559
1564
|
let n = Z(e, "label", Z(e, "command"));
|
|
1560
|
-
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */
|
|
1565
|
+
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(ur, {
|
|
1561
1566
|
element: e,
|
|
1562
1567
|
label: n
|
|
1563
|
-
}) : /* @__PURE__ */
|
|
1568
|
+
}) : /* @__PURE__ */ P(I, {
|
|
1564
1569
|
type: "button",
|
|
1565
1570
|
"data-scene-id": e.id,
|
|
1566
1571
|
disabled: !0,
|
|
@@ -1569,15 +1574,15 @@ function cr({ element: e, interactions: t }) {
|
|
|
1569
1574
|
children: n
|
|
1570
1575
|
});
|
|
1571
1576
|
}
|
|
1572
|
-
function
|
|
1573
|
-
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */
|
|
1577
|
+
function ur({ element: e, label: t }) {
|
|
1578
|
+
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(vn.Provider, {
|
|
1574
1579
|
value: a,
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1580
|
+
children: /* @__PURE__ */ P(yn, { element: e })
|
|
1576
1581
|
});
|
|
1577
|
-
return /* @__PURE__ */
|
|
1582
|
+
return /* @__PURE__ */ P("div", {
|
|
1578
1583
|
className: "stage-action",
|
|
1579
1584
|
"data-scene-id": e.id,
|
|
1580
|
-
children: /* @__PURE__ */
|
|
1585
|
+
children: /* @__PURE__ */ P(Me, {
|
|
1581
1586
|
element: X(e.id, {
|
|
1582
1587
|
visible: !1,
|
|
1583
1588
|
header: t,
|
|
@@ -1587,13 +1592,13 @@ function lr({ element: e, label: t }) {
|
|
|
1587
1592
|
}, r)
|
|
1588
1593
|
});
|
|
1589
1594
|
}
|
|
1590
|
-
function
|
|
1591
|
-
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(() =>
|
|
1592
|
-
if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */
|
|
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]);
|
|
1597
|
+
if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
|
|
1593
1598
|
element: e.element,
|
|
1594
1599
|
slots: e.slots ?? {}
|
|
1595
|
-
}) : /* @__PURE__ */
|
|
1596
|
-
let p = d.filter((e) => !
|
|
1600
|
+
}) : /* @__PURE__ */ P(ne, {});
|
|
1601
|
+
let p = d.filter((e) => !kn(e, a)), m = X(`slice-dialog-${c}`, {
|
|
1597
1602
|
command: c,
|
|
1598
1603
|
label: l,
|
|
1599
1604
|
schema: u,
|
|
@@ -1603,25 +1608,25 @@ function ur(e) {
|
|
|
1603
1608
|
})),
|
|
1604
1609
|
generationMode: "manual"
|
|
1605
1610
|
});
|
|
1606
|
-
return /* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ F("section", {
|
|
1607
1612
|
className: "scene-slice-dialog",
|
|
1608
1613
|
"data-scene-slice-dialog": Z(t, "slice") || s?.slice,
|
|
1609
1614
|
"data-scene-command": c,
|
|
1610
1615
|
children: [
|
|
1611
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ P("header", {
|
|
1612
1617
|
className: "scene-slice-dialog-header",
|
|
1613
|
-
children: /* @__PURE__ */
|
|
1618
|
+
children: /* @__PURE__ */ P("h2", {
|
|
1614
1619
|
className: "scene-slice-dialog-title",
|
|
1615
1620
|
children: l
|
|
1616
1621
|
})
|
|
1617
1622
|
}),
|
|
1618
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ P(vn.Provider, {
|
|
1619
1624
|
value: f,
|
|
1620
|
-
children: /* @__PURE__ */
|
|
1625
|
+
children: /* @__PURE__ */ P(yn, { element: m })
|
|
1621
1626
|
}),
|
|
1622
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ P("footer", {
|
|
1623
1628
|
className: "scene-slice-dialog-footer",
|
|
1624
|
-
children: /* @__PURE__ */
|
|
1629
|
+
children: /* @__PURE__ */ P("button", {
|
|
1625
1630
|
type: "button",
|
|
1626
1631
|
className: "scene-slice-dialog-cancel",
|
|
1627
1632
|
onClick: f,
|
|
@@ -1631,9 +1636,9 @@ function ur(e) {
|
|
|
1631
1636
|
]
|
|
1632
1637
|
});
|
|
1633
1638
|
}
|
|
1634
|
-
function
|
|
1639
|
+
function fr(e) {
|
|
1635
1640
|
let { element: t } = e;
|
|
1636
|
-
if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */
|
|
1641
|
+
if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
|
|
1637
1642
|
let n = Z(t, "name", t.id), r = {
|
|
1638
1643
|
...t,
|
|
1639
1644
|
componentName: "core:action",
|
|
@@ -1642,27 +1647,27 @@ function dr(e) {
|
|
|
1642
1647
|
label: Z(t, "label", n)
|
|
1643
1648
|
}
|
|
1644
1649
|
};
|
|
1645
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ P("span", {
|
|
1646
1651
|
className: "stage-toolbar-action",
|
|
1647
1652
|
"data-scene-toolbar-item": n,
|
|
1648
|
-
children: /* @__PURE__ */
|
|
1653
|
+
children: /* @__PURE__ */ P(cr, {
|
|
1649
1654
|
element: r,
|
|
1650
1655
|
interactions: e.interactions,
|
|
1651
1656
|
slots: e.slots
|
|
1652
1657
|
})
|
|
1653
1658
|
});
|
|
1654
1659
|
}
|
|
1655
|
-
var
|
|
1660
|
+
var pr = {
|
|
1656
1661
|
...D,
|
|
1657
|
-
"core:table":
|
|
1658
|
-
"core:action":
|
|
1659
|
-
"core:toolbarItem":
|
|
1660
|
-
"core:sliceDialog":
|
|
1661
|
-
[
|
|
1662
|
+
"core:table": ar,
|
|
1663
|
+
"core:action": cr,
|
|
1664
|
+
"core:toolbarItem": fr,
|
|
1665
|
+
"core:sliceDialog": dr,
|
|
1666
|
+
[nr]: yn
|
|
1662
1667
|
};
|
|
1663
1668
|
//#endregion
|
|
1664
1669
|
//#region src/useStrings.ts
|
|
1665
|
-
function
|
|
1670
|
+
function mr() {
|
|
1666
1671
|
let e = Qe(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1667
1672
|
return i(() => {
|
|
1668
1673
|
let t = new AbortController();
|
|
@@ -1680,11 +1685,11 @@ function pr() {
|
|
|
1680
1685
|
dictionary: o
|
|
1681
1686
|
};
|
|
1682
1687
|
}
|
|
1683
|
-
var
|
|
1684
|
-
function
|
|
1685
|
-
return
|
|
1688
|
+
var hr = /* @__PURE__ */ new Set(["core:table"]);
|
|
1689
|
+
function gr(e) {
|
|
1690
|
+
return _r(e, /* @__PURE__ */ new Map(), void 0);
|
|
1686
1691
|
}
|
|
1687
|
-
function
|
|
1692
|
+
function _r(e, t, n) {
|
|
1688
1693
|
let r = e;
|
|
1689
1694
|
if (!r.slots) return e;
|
|
1690
1695
|
let i = !1, a = {};
|
|
@@ -1693,7 +1698,7 @@ function gr(e, t, n) {
|
|
|
1693
1698
|
a[e] = o.map((e) => {
|
|
1694
1699
|
let t = e, n = $(t, "typeName");
|
|
1695
1700
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1696
|
-
let a =
|
|
1701
|
+
let a = _r(yr(vr(t, r), s), r, s);
|
|
1697
1702
|
return a !== e && (i = !0), a;
|
|
1698
1703
|
});
|
|
1699
1704
|
}
|
|
@@ -1702,8 +1707,8 @@ function gr(e, t, n) {
|
|
|
1702
1707
|
slots: a
|
|
1703
1708
|
} : e;
|
|
1704
1709
|
}
|
|
1705
|
-
function
|
|
1706
|
-
if (!
|
|
1710
|
+
function vr(e, t) {
|
|
1711
|
+
if (!hr.has(e.componentName)) return e;
|
|
1707
1712
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1708
1713
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1709
1714
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -1712,7 +1717,7 @@ function _r(e, t) {
|
|
|
1712
1717
|
properties: a
|
|
1713
1718
|
};
|
|
1714
1719
|
}
|
|
1715
|
-
function
|
|
1720
|
+
function yr(e, t) {
|
|
1716
1721
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
|
|
1717
1722
|
let n = { ...e.properties };
|
|
1718
1723
|
if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
|
|
@@ -1731,7 +1736,7 @@ function $(e, t) {
|
|
|
1731
1736
|
}
|
|
1732
1737
|
//#endregion
|
|
1733
1738
|
//#region src/stageQueryBindings.tsx
|
|
1734
|
-
function
|
|
1739
|
+
function br(e) {
|
|
1735
1740
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1736
1741
|
if (Array.isArray(e)) {
|
|
1737
1742
|
e.forEach(n);
|
|
@@ -1751,7 +1756,7 @@ function yr(e) {
|
|
|
1751
1756
|
};
|
|
1752
1757
|
return r(e), [...t];
|
|
1753
1758
|
}
|
|
1754
|
-
function
|
|
1759
|
+
function xr(e) {
|
|
1755
1760
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
1756
1761
|
let n = e.properties?.[t];
|
|
1757
1762
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -1770,7 +1775,7 @@ function br(e) {
|
|
|
1770
1775
|
};
|
|
1771
1776
|
return r(e), [...t.values()];
|
|
1772
1777
|
}
|
|
1773
|
-
function
|
|
1778
|
+
function Sr({ source: e }) {
|
|
1774
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 } : {} : {
|
|
1775
1780
|
...i,
|
|
1776
1781
|
...r
|
|
@@ -1790,7 +1795,7 @@ function xr({ source: e }) {
|
|
|
1790
1795
|
list: !0
|
|
1791
1796
|
}), null;
|
|
1792
1797
|
}
|
|
1793
|
-
function
|
|
1798
|
+
function Cr({ name: e }) {
|
|
1794
1799
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
|
|
1795
1800
|
...i,
|
|
1796
1801
|
...r
|
|
@@ -1804,11 +1809,11 @@ function Sr({ name: e }) {
|
|
|
1804
1809
|
list: !0
|
|
1805
1810
|
}), null;
|
|
1806
1811
|
}
|
|
1807
|
-
function
|
|
1808
|
-
let t = o(() =>
|
|
1809
|
-
return /* @__PURE__ */
|
|
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))] });
|
|
1810
1815
|
}
|
|
1811
|
-
function
|
|
1816
|
+
function Tr(e) {
|
|
1812
1817
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1813
1818
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
1814
1819
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -1821,7 +1826,7 @@ function wr(e) {
|
|
|
1821
1826
|
]);
|
|
1822
1827
|
if (t.has(s)) continue;
|
|
1823
1828
|
t.add(s);
|
|
1824
|
-
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;
|
|
1825
1830
|
n.push({
|
|
1826
1831
|
label: i,
|
|
1827
1832
|
targetScreen: a,
|
|
@@ -1829,7 +1834,7 @@ function wr(e) {
|
|
|
1829
1834
|
order: c,
|
|
1830
1835
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
1831
1836
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
1832
|
-
...l &&
|
|
1837
|
+
...l && kr(l) ? { destination: l } : {}
|
|
1833
1838
|
});
|
|
1834
1839
|
}
|
|
1835
1840
|
return n.map((e, t) => ({
|
|
@@ -1837,7 +1842,7 @@ function wr(e) {
|
|
|
1837
1842
|
index: t
|
|
1838
1843
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
1839
1844
|
}
|
|
1840
|
-
function
|
|
1845
|
+
function Er(e) {
|
|
1841
1846
|
let t = {
|
|
1842
1847
|
label: "",
|
|
1843
1848
|
children: []
|
|
@@ -1862,21 +1867,21 @@ function Tr(e) {
|
|
|
1862
1867
|
}
|
|
1863
1868
|
return t.children;
|
|
1864
1869
|
}
|
|
1865
|
-
function
|
|
1870
|
+
function Dr(e, t) {
|
|
1866
1871
|
for (let n of e) {
|
|
1867
1872
|
if (n.screen === t) return [n.label];
|
|
1868
|
-
let e =
|
|
1873
|
+
let e = Dr(n.children, t);
|
|
1869
1874
|
if (e.length > 0) return [n.label, ...e];
|
|
1870
1875
|
}
|
|
1871
1876
|
return [];
|
|
1872
1877
|
}
|
|
1873
|
-
function
|
|
1878
|
+
function Or(e) {
|
|
1874
1879
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1875
1880
|
}
|
|
1876
|
-
function
|
|
1881
|
+
function kr(e) {
|
|
1877
1882
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
1878
1883
|
}
|
|
1879
|
-
function
|
|
1884
|
+
function Ar(e, t, n) {
|
|
1880
1885
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
1881
1886
|
label: e.name,
|
|
1882
1887
|
targetScreen: e.name,
|
|
@@ -1885,77 +1890,77 @@ function kr(e, t, n) {
|
|
|
1885
1890
|
}
|
|
1886
1891
|
//#endregion
|
|
1887
1892
|
//#region src/blueprint.ts
|
|
1888
|
-
var
|
|
1889
|
-
function
|
|
1890
|
-
let t =
|
|
1891
|
-
return n.splice(Math.max(n.indexOf(
|
|
1893
|
+
var jr = "Stage:locale";
|
|
1894
|
+
function Mr(e) {
|
|
1895
|
+
let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
|
|
1896
|
+
return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
|
|
1892
1897
|
...t,
|
|
1893
1898
|
name: e?.length ? t.name : "Stage",
|
|
1894
1899
|
packages: n
|
|
1895
1900
|
};
|
|
1896
1901
|
}
|
|
1897
|
-
var
|
|
1898
|
-
...
|
|
1902
|
+
var Nr = {
|
|
1903
|
+
...fe,
|
|
1899
1904
|
PrimeReact: Fe.components
|
|
1900
1905
|
};
|
|
1901
|
-
function
|
|
1906
|
+
function Pr(e) {
|
|
1902
1907
|
return {
|
|
1903
1908
|
...D,
|
|
1904
1909
|
...Pe,
|
|
1905
|
-
...
|
|
1906
|
-
...
|
|
1910
|
+
...me,
|
|
1911
|
+
...Se,
|
|
1907
1912
|
...e
|
|
1908
1913
|
};
|
|
1909
1914
|
}
|
|
1910
|
-
function
|
|
1915
|
+
function Fr(e) {
|
|
1911
1916
|
return e ? {
|
|
1912
1917
|
...e,
|
|
1913
|
-
...
|
|
1914
|
-
} :
|
|
1918
|
+
...Nr
|
|
1919
|
+
} : Nr;
|
|
1915
1920
|
}
|
|
1916
|
-
var
|
|
1917
|
-
function
|
|
1918
|
-
return
|
|
1921
|
+
var Ir = "Stage:navigationTree";
|
|
1922
|
+
function Lr(e, t, n) {
|
|
1923
|
+
return N(e, j.Logo, {
|
|
1919
1924
|
label: t,
|
|
1920
1925
|
initials: t.slice(0, 1).toUpperCase() || "S",
|
|
1921
1926
|
targetScreen: "",
|
|
1922
1927
|
...n ? { lightImageUrl: n } : {}
|
|
1923
1928
|
});
|
|
1924
1929
|
}
|
|
1925
|
-
function
|
|
1926
|
-
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({
|
|
1927
1932
|
label: e.name,
|
|
1928
1933
|
targetScreen: e.name,
|
|
1929
1934
|
icon: "pi pi-table",
|
|
1930
1935
|
group: "Screens",
|
|
1931
1936
|
order: n
|
|
1932
|
-
}, t)), p = Er(
|
|
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, {
|
|
1933
1938
|
nodes: d,
|
|
1934
1939
|
activeScreen: t
|
|
1935
|
-
}) :
|
|
1940
|
+
}) : N("menu-screens", j.Menu, {
|
|
1936
1941
|
title: "Screens",
|
|
1937
1942
|
label: "Screens"
|
|
1938
1943
|
}, { items: f }), _ = [];
|
|
1939
|
-
n.length > 1 && _.push(
|
|
1944
|
+
n.length > 1 && _.push(N("topbar-locale", jr, {
|
|
1940
1945
|
locales: n,
|
|
1941
1946
|
locale: r
|
|
1942
|
-
})), _.push(
|
|
1947
|
+
})), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
|
|
1943
1948
|
let v = { regionNavigation: a };
|
|
1944
1949
|
return {
|
|
1945
|
-
[
|
|
1946
|
-
logo: [
|
|
1950
|
+
[M.Topbar]: [N("topbar", j.Topbar, v, {
|
|
1951
|
+
logo: [Lr("topbar-logo", c, i?.image)],
|
|
1947
1952
|
end: _
|
|
1948
1953
|
})],
|
|
1949
|
-
[
|
|
1950
|
-
...a ? {} : { [
|
|
1951
|
-
[
|
|
1954
|
+
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [Lr("sidebar-logo", c, i?.image)] })],
|
|
1955
|
+
...a ? {} : { [M.Menu]: [g] },
|
|
1956
|
+
[M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
|
|
1952
1957
|
homeTargetScreen: s,
|
|
1953
1958
|
items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
|
|
1954
1959
|
})],
|
|
1955
|
-
...o ? { [
|
|
1956
|
-
[
|
|
1960
|
+
...o ? { [M.Footer]: [N("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
|
|
1961
|
+
[M.ConfigPanel]: [N(j.ConfigPanel, j.ConfigPanel, {
|
|
1957
1962
|
title: "Settings",
|
|
1958
|
-
themes:
|
|
1963
|
+
themes: ge.map((e) => ({
|
|
1959
1964
|
name: e.name,
|
|
1960
1965
|
label: e.name,
|
|
1961
1966
|
isDark: e.isDark ?? !1
|
|
@@ -1963,65 +1968,65 @@ function Lr(e, t, n, r, i, a = !1, o = !0) {
|
|
|
1963
1968
|
})]
|
|
1964
1969
|
};
|
|
1965
1970
|
}
|
|
1966
|
-
function
|
|
1971
|
+
function zr(e) {
|
|
1967
1972
|
return `#/${encodeURIComponent(e)}`;
|
|
1968
1973
|
}
|
|
1969
1974
|
//#endregion
|
|
1970
1975
|
//#region src/StageChrome.tsx
|
|
1971
|
-
var
|
|
1976
|
+
var Br = e({
|
|
1972
1977
|
locales: [],
|
|
1973
1978
|
locale: "",
|
|
1974
1979
|
setLocale: () => void 0,
|
|
1975
1980
|
activity: ""
|
|
1976
1981
|
});
|
|
1977
|
-
function
|
|
1978
|
-
return /* @__PURE__ */
|
|
1982
|
+
function Vr({ state: e, children: t }) {
|
|
1983
|
+
return /* @__PURE__ */ P(Br.Provider, {
|
|
1979
1984
|
value: e,
|
|
1980
1985
|
children: t
|
|
1981
1986
|
});
|
|
1982
1987
|
}
|
|
1983
|
-
var
|
|
1984
|
-
function
|
|
1985
|
-
let { locales: e, locale: t, setLocale: n } = r(
|
|
1986
|
-
return e.length < 2 ? null : /* @__PURE__ */
|
|
1988
|
+
var Hr = "Stage:activity";
|
|
1989
|
+
function Ur() {
|
|
1990
|
+
let { locales: e, locale: t, setLocale: n } = r(Br);
|
|
1991
|
+
return e.length < 2 ? null : /* @__PURE__ */ P("select", {
|
|
1987
1992
|
className: "stage-locale",
|
|
1988
1993
|
"aria-label": "Locale",
|
|
1989
1994
|
value: t,
|
|
1990
1995
|
onChange: (e) => n(e.target.value),
|
|
1991
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1996
|
+
children: e.map((e) => /* @__PURE__ */ P("option", {
|
|
1992
1997
|
value: e,
|
|
1993
1998
|
children: e
|
|
1994
1999
|
}, e))
|
|
1995
2000
|
});
|
|
1996
2001
|
}
|
|
1997
|
-
function
|
|
2002
|
+
function Wr({ element: e }) {
|
|
1998
2003
|
let t = e.properties ?? {};
|
|
1999
|
-
return /* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ P("nav", {
|
|
2000
2005
|
className: "stage-navigation-tree",
|
|
2001
2006
|
"aria-label": "Navigation",
|
|
2002
2007
|
"data-scene-id": e.id,
|
|
2003
|
-
children: /* @__PURE__ */
|
|
2008
|
+
children: /* @__PURE__ */ P(Gr, {
|
|
2004
2009
|
nodes: t.nodes ?? [],
|
|
2005
2010
|
activeScreen: t.activeScreen
|
|
2006
2011
|
})
|
|
2007
2012
|
});
|
|
2008
2013
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return /* @__PURE__ */
|
|
2014
|
+
function Gr({ nodes: e, activeScreen: t }) {
|
|
2015
|
+
return /* @__PURE__ */ P("ul", {
|
|
2011
2016
|
role: "tree",
|
|
2012
|
-
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */
|
|
2017
|
+
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
|
|
2013
2018
|
role: "treeitem",
|
|
2014
2019
|
"aria-expanded": "true",
|
|
2015
|
-
children: [/* @__PURE__ */
|
|
2020
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2016
2021
|
className: "stage-navigation-group",
|
|
2017
2022
|
children: e.label
|
|
2018
|
-
}), /* @__PURE__ */
|
|
2023
|
+
}), /* @__PURE__ */ P(Gr, {
|
|
2019
2024
|
nodes: e.children,
|
|
2020
2025
|
activeScreen: t
|
|
2021
2026
|
})]
|
|
2022
|
-
}, e.label) : /* @__PURE__ */
|
|
2027
|
+
}, e.label) : /* @__PURE__ */ P("li", {
|
|
2023
2028
|
role: "treeitem",
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2029
|
+
children: /* @__PURE__ */ P(Kr, {
|
|
2025
2030
|
node: e,
|
|
2026
2031
|
screen: e.screen,
|
|
2027
2032
|
activeScreen: t
|
|
@@ -2029,55 +2034,55 @@ function Wr({ nodes: e, activeScreen: t }) {
|
|
|
2029
2034
|
}, `${e.screen}:${e.label}`))
|
|
2030
2035
|
});
|
|
2031
2036
|
}
|
|
2032
|
-
function
|
|
2033
|
-
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) => {
|
|
2034
2039
|
e.preventDefault(), i.navigate(o);
|
|
2035
2040
|
} : void 0;
|
|
2036
|
-
return /* @__PURE__ */
|
|
2037
|
-
href: s ? o.route :
|
|
2041
|
+
return /* @__PURE__ */ F("a", {
|
|
2042
|
+
href: s ? o.route : zr(t),
|
|
2038
2043
|
rel: s ? "noreferrer" : void 0,
|
|
2039
2044
|
"aria-current": t === n ? "page" : void 0,
|
|
2040
2045
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
2041
2046
|
"data-presentation": e.presentation,
|
|
2042
2047
|
"data-icon": e.icon,
|
|
2043
2048
|
onClick: c,
|
|
2044
|
-
children: [a !== "text" && e.icon && /* @__PURE__ */
|
|
2049
|
+
children: [a !== "text" && e.icon && /* @__PURE__ */ P("span", {
|
|
2045
2050
|
className: "stage-navigation-icon",
|
|
2046
2051
|
"aria-hidden": "true",
|
|
2047
2052
|
"data-icon-name": e.icon
|
|
2048
2053
|
}), a !== "icon" && e.label]
|
|
2049
2054
|
});
|
|
2050
2055
|
}
|
|
2051
|
-
function
|
|
2056
|
+
function qr({ element: e }) {
|
|
2052
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;
|
|
2053
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ F("div", {
|
|
2054
2059
|
"data-scene-outlet": t,
|
|
2055
2060
|
"data-scene-outlet-screen": o,
|
|
2056
|
-
children: [c && o && /* @__PURE__ */
|
|
2061
|
+
children: [c && o && /* @__PURE__ */ P("div", {
|
|
2057
2062
|
className: "scene-outlet-bar",
|
|
2058
|
-
children: /* @__PURE__ */
|
|
2063
|
+
children: /* @__PURE__ */ P("button", {
|
|
2059
2064
|
type: "button",
|
|
2060
2065
|
className: "scene-outlet-close",
|
|
2061
2066
|
"aria-label": "Close",
|
|
2062
2067
|
onClick: () => n?.closeOutlet(t),
|
|
2063
2068
|
children: "Close"
|
|
2064
2069
|
})
|
|
2065
|
-
}), s && i && /* @__PURE__ */
|
|
2070
|
+
}), s && i && /* @__PURE__ */ P(T, {
|
|
2066
2071
|
element: s,
|
|
2067
2072
|
registry: i.registry,
|
|
2068
2073
|
resolveBinding: a.resolveBinding
|
|
2069
2074
|
})]
|
|
2070
2075
|
});
|
|
2071
2076
|
}
|
|
2072
|
-
function
|
|
2073
|
-
let { activity: e } = r(
|
|
2074
|
-
return e ? /* @__PURE__ */
|
|
2077
|
+
function Jr() {
|
|
2078
|
+
let { activity: e } = r(Br);
|
|
2079
|
+
return e ? /* @__PURE__ */ P("p", {
|
|
2075
2080
|
className: "stage-activity",
|
|
2076
2081
|
role: "status",
|
|
2077
2082
|
children: e
|
|
2078
2083
|
}) : null;
|
|
2079
2084
|
}
|
|
2080
|
-
function
|
|
2085
|
+
function Yr() {
|
|
2081
2086
|
let e = A(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2082
2087
|
return i(() => {
|
|
2083
2088
|
let r = e?.isDark ? "dark" : "light";
|
|
@@ -2088,44 +2093,44 @@ function Jr() {
|
|
|
2088
2093
|
n
|
|
2089
2094
|
]), null;
|
|
2090
2095
|
}
|
|
2091
|
-
var
|
|
2092
|
-
[
|
|
2093
|
-
[
|
|
2094
|
-
[
|
|
2095
|
-
"core:outlet":
|
|
2096
|
-
},
|
|
2096
|
+
var Xr = {
|
|
2097
|
+
[jr]: Ur,
|
|
2098
|
+
[Ir]: Wr,
|
|
2099
|
+
[Hr]: Jr,
|
|
2100
|
+
"core:outlet": qr
|
|
2101
|
+
}, Zr = [
|
|
2097
2102
|
"navigationMode",
|
|
2098
2103
|
"menuTheme",
|
|
2099
2104
|
"showFooter"
|
|
2100
|
-
],
|
|
2101
|
-
function
|
|
2105
|
+
], Qr = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2106
|
+
function $r(e, t, n = !1) {
|
|
2102
2107
|
let r = [], i = t.options ?? {}, a = {
|
|
2103
2108
|
showFooter: !0,
|
|
2104
2109
|
followsSystem: !1,
|
|
2105
2110
|
problems: r
|
|
2106
2111
|
};
|
|
2107
2112
|
for (let [e, n] of Object.entries(i)) {
|
|
2108
|
-
if (!
|
|
2109
|
-
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(", ")}.`);
|
|
2110
2115
|
continue;
|
|
2111
2116
|
}
|
|
2112
2117
|
if (e === "navigationMode") {
|
|
2113
|
-
let e = ve.find((e) => e === n);
|
|
2114
|
-
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ve.join(", ")}.`);
|
|
2115
|
-
} else if (e === "menuTheme") {
|
|
2116
2118
|
let e = ye.find((e) => e === n);
|
|
2117
|
-
e ? a.
|
|
2119
|
+
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ye.join(", ")}.`);
|
|
2120
|
+
} else if (e === "menuTheme") {
|
|
2121
|
+
let e = be.find((e) => e === n);
|
|
2122
|
+
e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${be.join(", ")}.`);
|
|
2118
2123
|
} else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
|
|
2119
2124
|
}
|
|
2120
2125
|
let o = e?.appearance;
|
|
2121
2126
|
if (o?.colorScheme !== void 0) {
|
|
2122
2127
|
a.followsSystem = o.colorScheme === l.System;
|
|
2123
2128
|
let e = a.followsSystem ? n : o.colorScheme === l.Dark;
|
|
2124
|
-
a.colorScheme = e ?
|
|
2129
|
+
a.colorScheme = e ? ue.Dark : ue.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2125
2130
|
}
|
|
2126
|
-
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;
|
|
2127
2132
|
}
|
|
2128
|
-
function
|
|
2133
|
+
function ei(e, t) {
|
|
2129
2134
|
if (e?.root === void 0) return [];
|
|
2130
2135
|
let n = /* @__PURE__ */ new Set([
|
|
2131
2136
|
m.RootTemplateUnknown,
|
|
@@ -2137,7 +2142,7 @@ function $r(e, t) {
|
|
|
2137
2142
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2138
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;
|
|
2139
2144
|
}
|
|
2140
|
-
function
|
|
2145
|
+
function ti(e) {
|
|
2141
2146
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2142
2147
|
0,
|
|
2143
2148
|
2,
|
|
@@ -2145,7 +2150,7 @@ function ei(e) {
|
|
|
2145
2150
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2146
2151
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2147
2152
|
}
|
|
2148
|
-
function
|
|
2153
|
+
function ni(e, t) {
|
|
2149
2154
|
if (t === void 0) return e;
|
|
2150
2155
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2151
2156
|
0,
|
|
@@ -2157,20 +2162,20 @@ function ti(e, t) {
|
|
|
2157
2162
|
tokens: {
|
|
2158
2163
|
...e.tokens,
|
|
2159
2164
|
"primary.color": t,
|
|
2160
|
-
"primary.contrastColor":
|
|
2165
|
+
"primary.contrastColor": ti(t),
|
|
2161
2166
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2162
2167
|
}
|
|
2163
2168
|
}));
|
|
2164
2169
|
}
|
|
2165
2170
|
//#endregion
|
|
2166
2171
|
//#region src/StageShellSettings.tsx
|
|
2167
|
-
var
|
|
2168
|
-
function
|
|
2172
|
+
var ri = "(prefers-color-scheme: dark)";
|
|
2173
|
+
function ii() {
|
|
2169
2174
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2170
2175
|
}
|
|
2171
|
-
function
|
|
2172
|
-
let n = s(
|
|
2173
|
-
n.current =
|
|
2176
|
+
function ai({ settings: e, onSystemSchemeChange: t }) {
|
|
2177
|
+
let n = s(we());
|
|
2178
|
+
n.current = we();
|
|
2174
2179
|
let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
|
|
2175
2180
|
return i(() => {
|
|
2176
2181
|
let { setMode: e, setMenuTheme: t, setColorScheme: i, setThemeName: s } = n.current;
|
|
@@ -2182,16 +2187,16 @@ function ii({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2182
2187
|
c
|
|
2183
2188
|
]), i(() => {
|
|
2184
2189
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2185
|
-
let n = globalThis.matchMedia(
|
|
2190
|
+
let n = globalThis.matchMedia(ri), r = (e) => t(e.matches);
|
|
2186
2191
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2187
2192
|
}, [e.followsSystem, t]), null;
|
|
2188
2193
|
}
|
|
2189
2194
|
//#endregion
|
|
2190
2195
|
//#region src/stageNavigationModel.ts
|
|
2191
|
-
function
|
|
2196
|
+
function oi(e) {
|
|
2192
2197
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2193
2198
|
}
|
|
2194
|
-
function
|
|
2199
|
+
function si(e) {
|
|
2195
2200
|
let t = /* @__PURE__ */ new Map();
|
|
2196
2201
|
for (let n of e) {
|
|
2197
2202
|
let e = (n.path ?? []).join(".");
|
|
@@ -2204,35 +2209,35 @@ function oi(e) {
|
|
|
2204
2209
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2205
2210
|
};
|
|
2206
2211
|
}
|
|
2207
|
-
function
|
|
2212
|
+
function ci(e) {
|
|
2208
2213
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2209
2214
|
}
|
|
2210
|
-
function
|
|
2215
|
+
function li(e, t) {
|
|
2211
2216
|
return {
|
|
2212
2217
|
structure: e.structure ?? { modules: [] },
|
|
2213
2218
|
navigation: e.navigation ?? {
|
|
2214
2219
|
application: { regions: [] },
|
|
2215
2220
|
modules: []
|
|
2216
2221
|
},
|
|
2217
|
-
screenFor:
|
|
2218
|
-
moduleOf:
|
|
2222
|
+
screenFor: si(e.screens),
|
|
2223
|
+
moduleOf: ci(e.screens),
|
|
2219
2224
|
...t ? { isVisible: t } : {}
|
|
2220
2225
|
};
|
|
2221
2226
|
}
|
|
2222
2227
|
//#endregion
|
|
2223
2228
|
//#region src/stageSlices.ts
|
|
2224
|
-
function
|
|
2225
|
-
return (t) =>
|
|
2229
|
+
function ui(e) {
|
|
2230
|
+
return (t) => $t(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2226
2231
|
name: e.name,
|
|
2227
2232
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2228
|
-
label:
|
|
2233
|
+
label: di(e.name),
|
|
2229
2234
|
required: e.required
|
|
2230
2235
|
}));
|
|
2231
2236
|
}
|
|
2232
|
-
function
|
|
2237
|
+
function di(e) {
|
|
2233
2238
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2234
2239
|
}
|
|
2235
|
-
function
|
|
2240
|
+
function fi(e, t, n) {
|
|
2236
2241
|
return { invoke: async (r, i, a) => {
|
|
2237
2242
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2238
2243
|
if (!U(o)) return {
|
|
@@ -2253,7 +2258,7 @@ function di(e, t, n) {
|
|
|
2253
2258
|
}
|
|
2254
2259
|
//#endregion
|
|
2255
2260
|
//#region src/withoutSeededSlots.ts
|
|
2256
|
-
function
|
|
2261
|
+
function pi(e, t) {
|
|
2257
2262
|
let n = /* @__PURE__ */ new Map();
|
|
2258
2263
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2259
2264
|
return e.map((e) => {
|
|
@@ -2271,15 +2276,15 @@ function fi(e, t) {
|
|
|
2271
2276
|
}
|
|
2272
2277
|
//#endregion
|
|
2273
2278
|
//#region src/App.tsx
|
|
2274
|
-
function
|
|
2275
|
-
return
|
|
2279
|
+
function mi(e = {}) {
|
|
2280
|
+
return Pr({
|
|
2276
2281
|
...e,
|
|
2277
|
-
...
|
|
2278
|
-
...
|
|
2282
|
+
...pr,
|
|
2283
|
+
...Xr
|
|
2279
2284
|
});
|
|
2280
2285
|
}
|
|
2281
|
-
function
|
|
2282
|
-
return
|
|
2286
|
+
function hi(e, t) {
|
|
2287
|
+
return N(`form-${e}-${t.name}`, nr, {
|
|
2283
2288
|
command: t.forCommand,
|
|
2284
2289
|
label: t.name,
|
|
2285
2290
|
generationMode: t.generationMode,
|
|
@@ -2287,43 +2292,43 @@ function mi(e, t) {
|
|
|
2287
2292
|
fields: t.fields
|
|
2288
2293
|
});
|
|
2289
2294
|
}
|
|
2290
|
-
function
|
|
2295
|
+
function gi(e, t) {
|
|
2291
2296
|
let n = e.screens[0];
|
|
2292
|
-
return
|
|
2293
|
-
profile:
|
|
2294
|
-
blueprintTemplates: t?.length ? [...
|
|
2297
|
+
return _e(e, n, {
|
|
2298
|
+
profile: Mr(e.uiProfiles),
|
|
2299
|
+
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2295
2300
|
});
|
|
2296
2301
|
}
|
|
2297
|
-
function
|
|
2298
|
-
let s =
|
|
2302
|
+
function _i(e, t, n, r, i, a, o = !0) {
|
|
2303
|
+
let s = oi(e.navigation), c = e.navigation?.application.logo ? {
|
|
2299
2304
|
title: e.navigation.application.logo.title,
|
|
2300
2305
|
image: e.navigation.application.logo.image || void 0
|
|
2301
2306
|
} : void 0;
|
|
2302
2307
|
return {
|
|
2303
|
-
profile:
|
|
2304
|
-
catalog:
|
|
2305
|
-
blueprintTemplates: a?.length ? [...
|
|
2306
|
-
chrome: (r, i) => i ===
|
|
2307
|
-
form:
|
|
2308
|
-
trailing: [
|
|
2308
|
+
profile: Mr(e.uiProfiles),
|
|
2309
|
+
catalog: Fr(r),
|
|
2310
|
+
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
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)],
|
|
2309
2314
|
decorate: (e) => {
|
|
2310
|
-
let t =
|
|
2315
|
+
let t = gr(e);
|
|
2311
2316
|
return i ? y(t, i) : t;
|
|
2312
2317
|
}
|
|
2313
2318
|
};
|
|
2314
2319
|
}
|
|
2315
|
-
function
|
|
2316
|
-
return
|
|
2320
|
+
function vi(e, t, n, r, i, a) {
|
|
2321
|
+
return pe(e, t, _i(e, n, r, i, void 0, a)).element;
|
|
2317
2322
|
}
|
|
2318
|
-
function
|
|
2323
|
+
function yi() {
|
|
2319
2324
|
try {
|
|
2320
2325
|
return globalThis.localStorage ?? null;
|
|
2321
2326
|
} catch {
|
|
2322
2327
|
return null;
|
|
2323
2328
|
}
|
|
2324
2329
|
}
|
|
2325
|
-
function
|
|
2326
|
-
let s = Qe(), l = o(() =>
|
|
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();
|
|
2327
2332
|
return i(() => {
|
|
2328
2333
|
let e = new AbortController();
|
|
2329
2334
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2332,10 +2337,10 @@ function yi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2332
2337
|
} : e)).catch((t) => {
|
|
2333
2338
|
e.signal.aborted || p(t instanceof Error ? t.message : String(t));
|
|
2334
2339
|
}), () => e.abort();
|
|
2335
|
-
}, [s, r]), f ? /* @__PURE__ */
|
|
2340
|
+
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2336
2341
|
className: "stage-message",
|
|
2337
|
-
children: [/* @__PURE__ */
|
|
2338
|
-
}) : u ? /* @__PURE__ */
|
|
2342
|
+
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2343
|
+
}) : u ? /* @__PURE__ */ P(xi, {
|
|
2339
2344
|
scene: u,
|
|
2340
2345
|
registry: l,
|
|
2341
2346
|
routeState: m,
|
|
@@ -2343,21 +2348,21 @@ function yi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2343
2348
|
packageCatalog: t,
|
|
2344
2349
|
screenTemplates: n,
|
|
2345
2350
|
isVisible: a
|
|
2346
|
-
}) : /* @__PURE__ */
|
|
2351
|
+
}) : /* @__PURE__ */ P("main", {
|
|
2347
2352
|
className: "stage-message",
|
|
2348
|
-
children: /* @__PURE__ */
|
|
2353
|
+
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2349
2354
|
});
|
|
2350
2355
|
}
|
|
2351
|
-
function
|
|
2352
|
-
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, [
|
|
2353
2358
|
e,
|
|
2354
2359
|
s,
|
|
2355
2360
|
p
|
|
2356
|
-
]), g = o(() => h ?
|
|
2361
|
+
]), g = o(() => h ? ei(m, h) : [], [m, h]), _ = o(() => h ? $r(m, h, d) : void 0, [
|
|
2357
2362
|
m,
|
|
2358
2363
|
h,
|
|
2359
2364
|
d
|
|
2360
|
-
]), 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), [
|
|
2361
2366
|
e,
|
|
2362
2367
|
i.locales,
|
|
2363
2368
|
i.locale,
|
|
@@ -2365,33 +2370,33 @@ function bi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2365
2370
|
a,
|
|
2366
2371
|
s,
|
|
2367
2372
|
y
|
|
2368
|
-
]), x = n((e) => f(e), []), S = o(() =>
|
|
2373
|
+
]), x = n((e) => f(e), []), S = o(() => li(e, l), [e, l]), C = o(() => ({
|
|
2369
2374
|
...e,
|
|
2370
|
-
screens:
|
|
2375
|
+
screens: pi(e.screens, [
|
|
2371
2376
|
...e.screenTemplates,
|
|
2372
2377
|
...e.dialogTemplates ?? [],
|
|
2373
|
-
...
|
|
2378
|
+
...ve,
|
|
2374
2379
|
...s ?? []
|
|
2375
2380
|
])
|
|
2376
2381
|
}), [e, s]);
|
|
2377
|
-
return p ? g.length > 0 ? /* @__PURE__ */
|
|
2382
|
+
return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
|
|
2378
2383
|
className: "stage-message",
|
|
2379
2384
|
role: "alert",
|
|
2380
2385
|
"data-stage-startup-problem": "root-template",
|
|
2381
2386
|
children: [
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ P("h1", { children: "Unable to start this Stage" }),
|
|
2388
|
+
/* @__PURE__ */ P("p", { children: "The ui profile's root template cannot be the application's shell." }),
|
|
2389
|
+
/* @__PURE__ */ P("ul", { children: g.map((e) => /* @__PURE__ */ P("li", { children: e }, e)) })
|
|
2385
2390
|
]
|
|
2386
|
-
}) : /* @__PURE__ */
|
|
2391
|
+
}) : /* @__PURE__ */ P(le, {
|
|
2387
2392
|
application: C,
|
|
2388
2393
|
composition: b,
|
|
2389
2394
|
navigationModel: S,
|
|
2390
2395
|
registry: t,
|
|
2391
2396
|
initialScreen: p,
|
|
2392
2397
|
history: u,
|
|
2393
|
-
layoutConfigStorage:
|
|
2394
|
-
scope: (t, n) => /* @__PURE__ */
|
|
2398
|
+
layoutConfigStorage: yi(),
|
|
2399
|
+
scope: (t, n) => /* @__PURE__ */ P(Si, {
|
|
2395
2400
|
scene: e,
|
|
2396
2401
|
routeState: r,
|
|
2397
2402
|
strings: i,
|
|
@@ -2401,25 +2406,25 @@ function bi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2401
2406
|
onSystemSchemeChange: x,
|
|
2402
2407
|
children: n
|
|
2403
2408
|
}),
|
|
2404
|
-
renderScreen: (e, n) => /* @__PURE__ */
|
|
2409
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(wi, {
|
|
2405
2410
|
element: e,
|
|
2406
2411
|
configuration: n,
|
|
2407
2412
|
registry: t
|
|
2408
2413
|
}),
|
|
2409
|
-
renderDialog: () => /* @__PURE__ */
|
|
2410
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */
|
|
2414
|
+
renderDialog: () => /* @__PURE__ */ P(dr, {}),
|
|
2415
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(Ti, {
|
|
2411
2416
|
template: e,
|
|
2412
2417
|
content: n,
|
|
2413
2418
|
registry: t,
|
|
2414
2419
|
strings: i,
|
|
2415
2420
|
close: () => r.closeDialog()
|
|
2416
2421
|
})
|
|
2417
|
-
}) : /* @__PURE__ */
|
|
2422
|
+
}) : /* @__PURE__ */ F("main", {
|
|
2418
2423
|
className: "stage-message",
|
|
2419
|
-
children: [/* @__PURE__ */
|
|
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." })]
|
|
2420
2425
|
});
|
|
2421
2426
|
}
|
|
2422
|
-
function
|
|
2427
|
+
function Si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2423
2428
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2424
2429
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2425
2430
|
let e = (e) => {
|
|
@@ -2436,22 +2441,22 @@ function xi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2436
2441
|
r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
|
|
2437
2442
|
};
|
|
2438
2443
|
return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
|
|
2439
|
-
}, [p, e]), /* @__PURE__ */
|
|
2444
|
+
}, [p, e]), /* @__PURE__ */ F(de, {
|
|
2440
2445
|
themes: a,
|
|
2441
2446
|
children: [
|
|
2442
|
-
o && /* @__PURE__ */
|
|
2447
|
+
o && /* @__PURE__ */ P(ai, {
|
|
2443
2448
|
settings: o,
|
|
2444
2449
|
onSystemSchemeChange: s
|
|
2445
2450
|
}),
|
|
2446
|
-
/* @__PURE__ */
|
|
2447
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ P(Yr, {}),
|
|
2452
|
+
/* @__PURE__ */ P(Mt, {
|
|
2448
2453
|
routes: t.routes,
|
|
2449
2454
|
routesReady: t.ready,
|
|
2450
2455
|
parameters: r.currentParameters,
|
|
2451
2456
|
locale: n.locale,
|
|
2452
2457
|
locales: n.locales,
|
|
2453
2458
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2454
|
-
children: /* @__PURE__ */
|
|
2459
|
+
children: /* @__PURE__ */ P(Ci, {
|
|
2455
2460
|
activity: d,
|
|
2456
2461
|
routesReady: t.ready,
|
|
2457
2462
|
scene: e,
|
|
@@ -2463,12 +2468,12 @@ function xi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2463
2468
|
]
|
|
2464
2469
|
});
|
|
2465
2470
|
}
|
|
2466
|
-
function
|
|
2467
|
-
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), [
|
|
2468
2473
|
l,
|
|
2469
2474
|
t,
|
|
2470
2475
|
s.refreshAfterCommand
|
|
2471
|
-
]), f = o(() =>
|
|
2476
|
+
]), f = o(() => ui(n.commandSchemas), [n.commandSchemas]), p = ie({
|
|
2472
2477
|
executeCommand: async (e, n) => {
|
|
2473
2478
|
let i = U(e);
|
|
2474
2479
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
@@ -2487,7 +2492,7 @@ function Si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2487
2492
|
};
|
|
2488
2493
|
},
|
|
2489
2494
|
navigate: (e, t) => {
|
|
2490
|
-
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.`);
|
|
2491
2496
|
},
|
|
2492
2497
|
navigateBack: () => globalThis.history?.back(),
|
|
2493
2498
|
openDialog: async (e) => {
|
|
@@ -2504,18 +2509,18 @@ function Si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2504
2509
|
refreshQuery: async (e) => s.refreshQuery(e),
|
|
2505
2510
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
2506
2511
|
});
|
|
2507
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ P(Vr, {
|
|
2508
2513
|
state: {
|
|
2509
2514
|
locales: i.locales,
|
|
2510
2515
|
locale: i.locale,
|
|
2511
2516
|
setLocale: i.setLocale,
|
|
2512
2517
|
activity: e
|
|
2513
2518
|
},
|
|
2514
|
-
children: /* @__PURE__ */
|
|
2519
|
+
children: /* @__PURE__ */ P(E, {
|
|
2515
2520
|
invoker: d,
|
|
2516
|
-
children: /* @__PURE__ */
|
|
2521
|
+
children: /* @__PURE__ */ P(te, {
|
|
2517
2522
|
fieldsFor: f,
|
|
2518
|
-
children: /* @__PURE__ */
|
|
2523
|
+
children: /* @__PURE__ */ P(w, {
|
|
2519
2524
|
dispatcher: p,
|
|
2520
2525
|
context: {
|
|
2521
2526
|
resolve: s.resolveBinding,
|
|
@@ -2529,9 +2534,9 @@ function Si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2529
2534
|
})
|
|
2530
2535
|
});
|
|
2531
2536
|
}
|
|
2532
|
-
function
|
|
2533
|
-
let r = z(), i =
|
|
2534
|
-
return /* @__PURE__ */
|
|
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, {
|
|
2535
2540
|
element: e,
|
|
2536
2541
|
registry: n,
|
|
2537
2542
|
resolveBinding: r.resolveBinding,
|
|
@@ -2540,25 +2545,25 @@ function Ci({ element: e, configuration: t, registry: n }) {
|
|
|
2540
2545
|
configuration: t
|
|
2541
2546
|
})] });
|
|
2542
2547
|
}
|
|
2543
|
-
function
|
|
2544
|
-
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);
|
|
2545
2550
|
return i(() => {
|
|
2546
2551
|
let e = (e) => {
|
|
2547
2552
|
e.key === "Escape" && a();
|
|
2548
2553
|
};
|
|
2549
2554
|
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
2550
|
-
}, [a]), /* @__PURE__ */
|
|
2555
|
+
}, [a]), /* @__PURE__ */ P("div", {
|
|
2551
2556
|
className: "stage-dialog-backdrop",
|
|
2552
|
-
children: /* @__PURE__ */
|
|
2557
|
+
children: /* @__PURE__ */ F("section", {
|
|
2553
2558
|
role: "dialog",
|
|
2554
2559
|
"aria-modal": "true",
|
|
2555
2560
|
"aria-label": e.displayName ?? e.name,
|
|
2556
2561
|
className: "stage-dialog",
|
|
2557
|
-
children: [/* @__PURE__ */
|
|
2562
|
+
children: [/* @__PURE__ */ P("button", {
|
|
2558
2563
|
type: "button",
|
|
2559
2564
|
onClick: a,
|
|
2560
2565
|
children: "Close"
|
|
2561
|
-
}), /* @__PURE__ */
|
|
2566
|
+
}), /* @__PURE__ */ P(T, {
|
|
2562
2567
|
element: c,
|
|
2563
2568
|
registry: n,
|
|
2564
2569
|
resolveBinding: o.resolveBinding,
|
|
@@ -2570,9 +2575,9 @@ function wi({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2570
2575
|
}
|
|
2571
2576
|
//#endregion
|
|
2572
2577
|
//#region src/stageTheme.ts
|
|
2573
|
-
var
|
|
2578
|
+
var Ei = "[data-scene-color-scheme='dark']", Di = {
|
|
2574
2579
|
preset: qe,
|
|
2575
|
-
options: { darkModeSelector:
|
|
2580
|
+
options: { darkModeSelector: Ei }
|
|
2576
2581
|
};
|
|
2577
2582
|
//#endregion
|
|
2578
|
-
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 };
|