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