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