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