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