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