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