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