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