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