@cratis/stage.runtime 4.207.1 → 4.209.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +659 -571
- package/dist/src/stageActionSubject.d.ts +35 -0
- package/package.json +3 -3
package/dist/src/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import "./app.css";
|
|
|
2
2
|
import { t as e } from "../stageDarkSelector-DAwb43-P.js";
|
|
3
3
|
import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
4
4
|
import { ColorScheme as u, DestinationKind as d, FormGenerationMode as f, FormWidthUnit as p, InteractionTriggerKind as m, LogoKind as h, PackageKind as g, componentIconLibrary as _ } from "@cratis/scene.model";
|
|
5
|
-
import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as ee, runBindings as
|
|
6
|
-
import { CoreSliceDialog as
|
|
5
|
+
import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as ee, runBindings as T, validateBindingExpression as te } from "@cratis/scene.engine";
|
|
6
|
+
import { CoreSliceDialog as ne, CoreToolbarItem as E, IconAdapterProvider as re, InteractionScope as ie, SceneElementView as ae, SceneNavigationContextInternal as D, SliceCommandFieldsProvider as oe, SliceDialogView as se, SliceInvokerProvider as ce, attachmentFor as le, componentRegistryKey as ue, coreComponents as O, createBrowserDispatcher as de, createBrowserSceneHistory as fe, createHashSceneHistory as k, createIconAdapterRegistry as pe, sliceDialogParameters as me, useInteractionScope as he, useOptionalSceneNavigation as ge, useSceneNavigation as _e, useSceneOutlets as ve, useSceneTheme as ye } from "@cratis/scene.react";
|
|
7
7
|
import { ApplicationHost as be, ColorScheme as A, ComponentName as j, KanbanBoard as xe, LayoutThemeProvider as Se, SlotName as M, blueprintPackageCatalog as Ce, composeApplicationScreen as we, defaultBlueprintComponents as Te, defaultBlueprintName as Ee, defaultBlueprintThemes as N, effectiveShellOf as De, externalComponent as P, galleryScreenTemplates as Oe, layoutModes as ke, menuThemes as Ae, navigationElement as je, previewComponents as Me, previewProfile as Ne, useLayoutConfig as Pe } from "@cratis/scene.blueprint.default";
|
|
8
8
|
import "@cratis/components/tokens";
|
|
9
9
|
import "@cratis/components/CommandForm/styles";
|
|
@@ -258,7 +258,7 @@ var Bt = "cratis.stage.data-changed", Vt = t({
|
|
|
258
258
|
3e3
|
|
259
259
|
], Ut = {};
|
|
260
260
|
function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, locales: o, screen: u, children: d }) {
|
|
261
|
-
let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [
|
|
261
|
+
let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [T, ne] = l({}), [E, re] = l({ version: 0 }), ie = s(() => Xt(T), [T]), ae = r((e, t) => {
|
|
262
262
|
p((n) => {
|
|
263
263
|
if (!t) {
|
|
264
264
|
let { [e]: t, ...r } = n;
|
|
@@ -319,7 +319,7 @@ function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, loc
|
|
|
319
319
|
}, g);
|
|
320
320
|
if (!e.kind && e.path.startsWith("component.")) return S(e.path, t);
|
|
321
321
|
if (!e.kind) return Zt(e.path, k, g, f, x, D, se, i, o);
|
|
322
|
-
let n =
|
|
322
|
+
let n = te(e, t);
|
|
323
323
|
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), b(t)(e);
|
|
324
324
|
}, [
|
|
325
325
|
w,
|
|
@@ -342,10 +342,10 @@ function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, loc
|
|
|
342
342
|
f,
|
|
343
343
|
k,
|
|
344
344
|
g
|
|
345
|
-
]), he = r((e, t) =>
|
|
345
|
+
]), he = r((e, t) => ne((n) => ({
|
|
346
346
|
...n,
|
|
347
347
|
[e]: t
|
|
348
|
-
})), []), ge = r((e) =>
|
|
348
|
+
})), []), ge = r((e) => ne((t) => {
|
|
349
349
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
350
350
|
let n = { ...t };
|
|
351
351
|
return delete n[e], n;
|
|
@@ -591,111 +591,34 @@ function nn() {
|
|
|
591
591
|
let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = z();
|
|
592
592
|
return a(() => () => n(e), [e, n]), r((n) => t(e, n), [t, e]);
|
|
593
593
|
}
|
|
594
|
-
// src/commandExecutor.ts
|
|
595
|
-
function U(e, t, n) {
|
|
596
|
-
for (let r of [
|
|
597
|
-
t,
|
|
598
|
-
n?.replace(/^\//, ""),
|
|
599
|
-
e
|
|
600
|
-
]) {
|
|
601
|
-
if (!r) continue;
|
|
602
|
-
let t = ze(r);
|
|
603
|
-
if (rn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
function rn(e) {
|
|
607
|
-
return typeof e == "function" && e.prototype instanceof qe;
|
|
608
|
-
}
|
|
609
|
-
function an(e, t) {
|
|
610
|
-
return e.setApiBasePath(gt(t)), e;
|
|
611
|
-
}
|
|
612
|
-
async function on(e, t, n) {
|
|
613
|
-
let r = U(e);
|
|
614
|
-
if (!r) return {
|
|
615
|
-
isSuccess: !1,
|
|
616
|
-
validationErrors: [],
|
|
617
|
-
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
618
|
-
};
|
|
619
|
-
let i = new r();
|
|
620
|
-
i.setMicroservice(n.microservice), i.setApiBasePath(gt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
621
|
-
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
622
|
-
return sn(e, await i.execute());
|
|
623
|
-
}
|
|
624
|
-
function sn(e, t) {
|
|
625
|
-
let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
|
|
626
|
-
member: t,
|
|
627
|
-
message: e.message
|
|
628
|
-
}))), i = n ? [] : [
|
|
629
|
-
...t.validationResults.map((e) => e.message),
|
|
630
|
-
...t.exceptionMessages,
|
|
631
|
-
...t.isAuthorized ? [] : [t.authorizationFailureReason || `“${e}” was not accepted.`]
|
|
632
|
-
];
|
|
633
|
-
return {
|
|
634
|
-
isSuccess: n,
|
|
635
|
-
response: n ? t.response : void 0,
|
|
636
|
-
validationErrors: r,
|
|
637
|
-
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
function cn() {
|
|
641
|
-
let e = i(Fe);
|
|
642
|
-
return r((t, n) => on(t, n, e), [e]);
|
|
643
|
-
}
|
|
644
|
-
// src/stageNavigation.ts
|
|
645
|
-
function ln(e, t = {}) {
|
|
646
|
-
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
647
|
-
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
648
|
-
}
|
|
649
|
-
function W(e, t = {}) {
|
|
650
|
-
if (!globalThis.location) return;
|
|
651
|
-
if (un === "path") {
|
|
652
|
-
let n = fn(e, t);
|
|
653
|
-
if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
|
|
654
|
-
globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
let n = ln(e, t);
|
|
658
|
-
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
659
|
-
}
|
|
660
|
-
var un = "hash";
|
|
661
|
-
function dn(e) {
|
|
662
|
-
un = e;
|
|
663
|
-
}
|
|
664
|
-
function fn(e, t = {}) {
|
|
665
|
-
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
666
|
-
return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
|
|
667
|
-
}
|
|
668
|
-
function pn(e) {
|
|
669
|
-
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ke)).map(([e, t]) => [e, String(t)]));
|
|
670
|
-
}
|
|
671
594
|
// src/stageFormSchema.ts
|
|
672
|
-
var
|
|
673
|
-
function
|
|
595
|
+
var rn = 8;
|
|
596
|
+
function U(e) {
|
|
674
597
|
if (!e) return [];
|
|
675
598
|
try {
|
|
676
|
-
return
|
|
599
|
+
return an(JSON.parse(e), 0);
|
|
677
600
|
} catch {
|
|
678
601
|
return [];
|
|
679
602
|
}
|
|
680
603
|
}
|
|
681
|
-
function
|
|
682
|
-
let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i =
|
|
683
|
-
return Object.entries(i).map(([e, i]) =>
|
|
604
|
+
function an(e, t) {
|
|
605
|
+
let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = pn(e.properties) ? e.properties : {};
|
|
606
|
+
return Object.entries(i).map(([e, i]) => on(e, i, !n || r.has(e), t));
|
|
684
607
|
}
|
|
685
|
-
function
|
|
608
|
+
function on(e, t, n, r) {
|
|
686
609
|
return {
|
|
687
610
|
name: e,
|
|
688
611
|
identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
689
612
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
690
613
|
required: n,
|
|
691
|
-
...
|
|
614
|
+
...sn(t, r)
|
|
692
615
|
};
|
|
693
616
|
}
|
|
694
|
-
function
|
|
617
|
+
function sn(e, t) {
|
|
695
618
|
let n = e?.type;
|
|
696
619
|
if (Array.isArray(n)) {
|
|
697
620
|
let r = n.filter((e) => e !== "null");
|
|
698
|
-
return r.length === 1 ?
|
|
621
|
+
return r.length === 1 ? sn({
|
|
699
622
|
...e,
|
|
700
623
|
type: r[0]
|
|
701
624
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -706,8 +629,8 @@ function _n(e, t) {
|
|
|
706
629
|
type: "date",
|
|
707
630
|
withTime: e.format === "date-time"
|
|
708
631
|
};
|
|
709
|
-
if (n === "array") return
|
|
710
|
-
if (n === "object") return
|
|
632
|
+
if (n === "array") return cn(e, t);
|
|
633
|
+
if (n === "object") return ln(e, t);
|
|
711
634
|
if (n === void 0 || n === "string") {
|
|
712
635
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
713
636
|
return t.length > 0 ? {
|
|
@@ -717,76 +640,236 @@ function _n(e, t) {
|
|
|
717
640
|
}
|
|
718
641
|
return { unsupportedReason: `type ${String(n)}` };
|
|
719
642
|
}
|
|
720
|
-
function
|
|
643
|
+
function cn(e, t) {
|
|
721
644
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
722
|
-
if (t >=
|
|
723
|
-
let r =
|
|
645
|
+
if (t >= rn || e?.items === void 0) return n;
|
|
646
|
+
let r = on("", e.items, !0, t + 1);
|
|
724
647
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
725
648
|
}
|
|
726
|
-
function
|
|
649
|
+
function ln(e, t) {
|
|
727
650
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
728
|
-
if (t >=
|
|
729
|
-
let r =
|
|
651
|
+
if (t >= rn || !pn(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
652
|
+
let r = an(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
730
653
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
731
654
|
}
|
|
732
|
-
function
|
|
655
|
+
function W(e) {
|
|
733
656
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
|
734
657
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
735
658
|
}
|
|
736
|
-
function
|
|
659
|
+
function un(e, t, n) {
|
|
737
660
|
if (t != null) {
|
|
738
|
-
if (e.members &&
|
|
739
|
-
let e = t[r.name], i =
|
|
740
|
-
if (
|
|
661
|
+
if (e.members && pn(t)) for (let r of e.members) {
|
|
662
|
+
let e = t[r.name], i = W(r.name);
|
|
663
|
+
if (dn(e)) {
|
|
741
664
|
if (r.required) return `${n}: ${i} is required`;
|
|
742
665
|
continue;
|
|
743
666
|
}
|
|
744
|
-
let a =
|
|
667
|
+
let a = un(r, e, `${n} ${i.toLowerCase()}`);
|
|
745
668
|
if (a) return a;
|
|
746
669
|
}
|
|
747
670
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
748
|
-
let t =
|
|
671
|
+
let t = dn(i) ? `${n} ${r + 1} is required` : un(e.item, i, `${n} ${r + 1}`);
|
|
749
672
|
if (t) return t;
|
|
750
673
|
}
|
|
751
674
|
}
|
|
752
675
|
}
|
|
753
|
-
function
|
|
676
|
+
function dn(e) {
|
|
754
677
|
return e == null || e === "";
|
|
755
678
|
}
|
|
756
|
-
function
|
|
757
|
-
return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members &&
|
|
679
|
+
function fn(e, t) {
|
|
680
|
+
return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && pn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
758
681
|
let r = e.members?.find((e) => e.name === t);
|
|
759
|
-
return [t, r ?
|
|
760
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
682
|
+
return [t, r ? fn(r, n) : n];
|
|
683
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => fn(e.item, t)) : t;
|
|
761
684
|
}
|
|
762
|
-
function
|
|
685
|
+
function pn(e) {
|
|
763
686
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
764
687
|
}
|
|
688
|
+
// src/stageActionSubject.ts
|
|
689
|
+
var mn = /^item\.(.+)$/, hn = [
|
|
690
|
+
void 0,
|
|
691
|
+
null,
|
|
692
|
+
""
|
|
693
|
+
];
|
|
694
|
+
function gn(e) {
|
|
695
|
+
let t = e.properties.actionSubject;
|
|
696
|
+
return t === "item" || t === "screen" ? t : void 0;
|
|
697
|
+
}
|
|
698
|
+
function _n(e, t) {
|
|
699
|
+
return e === "item" && t.length === 1 ? t[0] : void 0;
|
|
700
|
+
}
|
|
701
|
+
function vn(e, t) {
|
|
702
|
+
return e === "item" && !t;
|
|
703
|
+
}
|
|
704
|
+
function yn(e, t) {
|
|
705
|
+
let n = gn(e), r = e.properties.subjectValues;
|
|
706
|
+
return {
|
|
707
|
+
...n === "screen" ? {
|
|
708
|
+
selectableRows: [],
|
|
709
|
+
selectedRows: []
|
|
710
|
+
} : t,
|
|
711
|
+
rowAction: e.properties.rowAction === !0 || n === "item",
|
|
712
|
+
subjectValues: On(r) ? r : {}
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function bn(e, t) {
|
|
716
|
+
return {
|
|
717
|
+
...t === "screen" ? {} : { rowAction: !0 },
|
|
718
|
+
...t === void 0 ? {} : {
|
|
719
|
+
actionSubject: t,
|
|
720
|
+
subjectInputs: e.properties.subjectInputs
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function xn(e, t) {
|
|
725
|
+
let n = Object.entries(Tn(e)).map(([e, n]) => [e, Dn(t, n)]);
|
|
726
|
+
return Object.fromEntries(n.filter(([, e]) => !hn.includes(e)));
|
|
727
|
+
}
|
|
728
|
+
function Sn(e, t, n) {
|
|
729
|
+
let r = new Set(Object.keys(Tn(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 = Cn(e, t).filter((e) => !a.has(wn(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
|
|
730
|
+
fields: o,
|
|
731
|
+
generationMode: "manual"
|
|
732
|
+
} : {}, c = Object.fromEntries(i.map((e) => [e, n[e]]));
|
|
733
|
+
return {
|
|
734
|
+
...e,
|
|
735
|
+
properties: {
|
|
736
|
+
...e.properties,
|
|
737
|
+
rowAction: !0,
|
|
738
|
+
subjectValues: {
|
|
739
|
+
...c,
|
|
740
|
+
...xn(e, n)
|
|
741
|
+
},
|
|
742
|
+
...s
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function Cn(e, t) {
|
|
747
|
+
let n = e.properties.fields;
|
|
748
|
+
return Array.isArray(n) ? n : t.map((e) => ({
|
|
749
|
+
name: e.name,
|
|
750
|
+
label: W(e.name)
|
|
751
|
+
}));
|
|
752
|
+
}
|
|
753
|
+
function wn(e) {
|
|
754
|
+
let t = e.sourceProperty || e.name;
|
|
755
|
+
return typeof t == "string" ? t : "";
|
|
756
|
+
}
|
|
757
|
+
function Tn(e) {
|
|
758
|
+
let t = e.properties.subjectInputs, n = (On(t) ? Object.entries(t) : []).map(([e, t]) => [e, En(t)]);
|
|
759
|
+
return Object.fromEntries(n.filter((e) => e[1] !== void 0));
|
|
760
|
+
}
|
|
761
|
+
function En(e) {
|
|
762
|
+
let t = On(e) ? e.subject : void 0;
|
|
763
|
+
return typeof t == "string" ? mn.exec(t)?.[1] : void 0;
|
|
764
|
+
}
|
|
765
|
+
function Dn(e, t) {
|
|
766
|
+
return t.split(".").reduce((e, t) => On(e) ? e[t] : void 0, e);
|
|
767
|
+
}
|
|
768
|
+
function On(e) {
|
|
769
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
770
|
+
}
|
|
771
|
+
// src/commandExecutor.ts
|
|
772
|
+
function G(e, t, n) {
|
|
773
|
+
for (let r of [
|
|
774
|
+
t,
|
|
775
|
+
n?.replace(/^\//, ""),
|
|
776
|
+
e
|
|
777
|
+
]) {
|
|
778
|
+
if (!r) continue;
|
|
779
|
+
let t = ze(r);
|
|
780
|
+
if (kn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function kn(e) {
|
|
784
|
+
return typeof e == "function" && e.prototype instanceof qe;
|
|
785
|
+
}
|
|
786
|
+
function An(e, t) {
|
|
787
|
+
return e.setApiBasePath(gt(t)), e;
|
|
788
|
+
}
|
|
789
|
+
async function jn(e, t, n) {
|
|
790
|
+
let r = G(e);
|
|
791
|
+
if (!r) return {
|
|
792
|
+
isSuccess: !1,
|
|
793
|
+
validationErrors: [],
|
|
794
|
+
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
795
|
+
};
|
|
796
|
+
let i = new r();
|
|
797
|
+
i.setMicroservice(n.microservice), i.setApiBasePath(gt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
798
|
+
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
799
|
+
return Mn(e, await i.execute());
|
|
800
|
+
}
|
|
801
|
+
function Mn(e, t) {
|
|
802
|
+
let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
|
|
803
|
+
member: t,
|
|
804
|
+
message: e.message
|
|
805
|
+
}))), i = n ? [] : [
|
|
806
|
+
...t.validationResults.map((e) => e.message),
|
|
807
|
+
...t.exceptionMessages,
|
|
808
|
+
...t.isAuthorized ? [] : [t.authorizationFailureReason || `“${e}” was not accepted.`]
|
|
809
|
+
];
|
|
810
|
+
return {
|
|
811
|
+
isSuccess: n,
|
|
812
|
+
response: n ? t.response : void 0,
|
|
813
|
+
validationErrors: r,
|
|
814
|
+
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
function Nn() {
|
|
818
|
+
let e = i(Fe);
|
|
819
|
+
return r((t, n) => jn(t, n, e), [e]);
|
|
820
|
+
}
|
|
821
|
+
// src/stageNavigation.ts
|
|
822
|
+
function Pn(e, t = {}) {
|
|
823
|
+
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
824
|
+
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
825
|
+
}
|
|
826
|
+
function K(e, t = {}) {
|
|
827
|
+
if (!globalThis.location) return;
|
|
828
|
+
if (Fn === "path") {
|
|
829
|
+
let n = Ln(e, t);
|
|
830
|
+
if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
|
|
831
|
+
globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
let n = Pn(e, t);
|
|
835
|
+
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
836
|
+
}
|
|
837
|
+
var Fn = "hash";
|
|
838
|
+
function In(e) {
|
|
839
|
+
Fn = e;
|
|
840
|
+
}
|
|
841
|
+
function Ln(e, t = {}) {
|
|
842
|
+
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
843
|
+
return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
|
|
844
|
+
}
|
|
845
|
+
function Rn(e) {
|
|
846
|
+
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ke)).map(([e, t]) => [e, String(t)]));
|
|
847
|
+
}
|
|
765
848
|
// src/StageValueFields.tsx
|
|
766
|
-
var
|
|
849
|
+
var zn = Ye((e) => /* @__PURE__ */ F(Bn, {
|
|
767
850
|
descriptor: e.descriptor,
|
|
768
|
-
label: e.title ??
|
|
851
|
+
label: e.title ?? W(e.descriptor.name),
|
|
769
852
|
value: e.value,
|
|
770
853
|
onChange: e.onChange,
|
|
771
854
|
onBlur: e.onBlur,
|
|
772
855
|
invalid: e.invalid
|
|
773
856
|
}), { defaultValue: void 0 });
|
|
774
|
-
function
|
|
775
|
-
return e.members ? /* @__PURE__ */ F(
|
|
857
|
+
function Bn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
858
|
+
return e.members ? /* @__PURE__ */ F(Vn, {
|
|
776
859
|
descriptor: e,
|
|
777
860
|
label: t,
|
|
778
861
|
value: n,
|
|
779
862
|
onChange: r,
|
|
780
863
|
onBlur: i,
|
|
781
864
|
invalid: a
|
|
782
|
-
}) : e.item ? /* @__PURE__ */ F(
|
|
865
|
+
}) : e.item ? /* @__PURE__ */ F(Hn, {
|
|
783
866
|
descriptor: e,
|
|
784
867
|
label: t,
|
|
785
868
|
value: n,
|
|
786
869
|
onChange: r,
|
|
787
870
|
onBlur: i,
|
|
788
871
|
invalid: a
|
|
789
|
-
}) : /* @__PURE__ */ F(
|
|
872
|
+
}) : /* @__PURE__ */ F(Un, {
|
|
790
873
|
descriptor: e,
|
|
791
874
|
label: t,
|
|
792
875
|
value: n,
|
|
@@ -795,14 +878,14 @@ function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
795
878
|
invalid: a
|
|
796
879
|
});
|
|
797
880
|
}
|
|
798
|
-
function
|
|
799
|
-
let o =
|
|
881
|
+
function Vn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
882
|
+
let o = Kn(n) ? n : {};
|
|
800
883
|
return /* @__PURE__ */ I("fieldset", {
|
|
801
884
|
className: "stage-record-field",
|
|
802
885
|
"data-invalid": a ? "true" : void 0,
|
|
803
|
-
children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(
|
|
886
|
+
children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(Bn, {
|
|
804
887
|
descriptor: e,
|
|
805
|
-
label:
|
|
888
|
+
label: W(e.name),
|
|
806
889
|
value: o[e.name],
|
|
807
890
|
onBlur: i,
|
|
808
891
|
onChange: (t) => r({
|
|
@@ -812,7 +895,7 @@ function En({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
812
895
|
}, e.name))]
|
|
813
896
|
});
|
|
814
897
|
}
|
|
815
|
-
function
|
|
898
|
+
function Hn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
816
899
|
let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
|
|
817
900
|
return /* @__PURE__ */ I("fieldset", {
|
|
818
901
|
className: "stage-list-field",
|
|
@@ -825,7 +908,7 @@ function Dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
825
908
|
}),
|
|
826
909
|
s.map((e, n) => /* @__PURE__ */ I("div", {
|
|
827
910
|
className: "stage-list-field__row",
|
|
828
|
-
children: [/* @__PURE__ */ F(
|
|
911
|
+
children: [/* @__PURE__ */ F(Bn, {
|
|
829
912
|
descriptor: o,
|
|
830
913
|
label: `${t} ${n + 1}`,
|
|
831
914
|
value: e,
|
|
@@ -841,13 +924,13 @@ function Dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
841
924
|
/* @__PURE__ */ F("button", {
|
|
842
925
|
type: "button",
|
|
843
926
|
"aria-label": `Add ${t}`,
|
|
844
|
-
onClick: () => c([...s,
|
|
927
|
+
onClick: () => c([...s, Wn(o)]),
|
|
845
928
|
children: "Add"
|
|
846
929
|
})
|
|
847
930
|
]
|
|
848
931
|
});
|
|
849
932
|
}
|
|
850
|
-
function
|
|
933
|
+
function Un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
851
934
|
let o = {
|
|
852
935
|
"aria-invalid": a ? !0 : void 0,
|
|
853
936
|
onBlur: i
|
|
@@ -863,7 +946,7 @@ function On({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
863
946
|
children: ""
|
|
864
947
|
}), e.options.map((e) => /* @__PURE__ */ F("option", {
|
|
865
948
|
value: e,
|
|
866
|
-
children:
|
|
949
|
+
children: W(e)
|
|
867
950
|
}, e))]
|
|
868
951
|
})]
|
|
869
952
|
});
|
|
@@ -893,7 +976,7 @@ function On({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
893
976
|
...o,
|
|
894
977
|
type: e.withTime ? "datetime-local" : "date",
|
|
895
978
|
value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
|
|
896
|
-
onChange: (t) => r(t.target.value === "" ? void 0 :
|
|
979
|
+
onChange: (t) => r(t.target.value === "" ? void 0 : Gn(t.target.value, e.withTime === !0))
|
|
897
980
|
})]
|
|
898
981
|
});
|
|
899
982
|
default: return /* @__PURE__ */ I("label", {
|
|
@@ -907,19 +990,19 @@ function On({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
907
990
|
});
|
|
908
991
|
}
|
|
909
992
|
}
|
|
910
|
-
function
|
|
993
|
+
function Wn(e) {
|
|
911
994
|
return e.members ? {} : void 0;
|
|
912
995
|
}
|
|
913
|
-
function
|
|
996
|
+
function Gn(e, t) {
|
|
914
997
|
if (!t) return e;
|
|
915
998
|
let n = new Date(e);
|
|
916
999
|
return Number.isNaN(n.getTime()) ? e : n.toISOString();
|
|
917
1000
|
}
|
|
918
|
-
function
|
|
1001
|
+
function Kn(e) {
|
|
919
1002
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
920
1003
|
}
|
|
921
1004
|
// src/stageScreenTables.tsx
|
|
922
|
-
function
|
|
1005
|
+
function qn(e) {
|
|
923
1006
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
924
1007
|
let r = e;
|
|
925
1008
|
if (r.componentName !== "core:outlet") {
|
|
@@ -929,27 +1012,27 @@ function Mn(e) {
|
|
|
929
1012
|
};
|
|
930
1013
|
return n(e), [...t];
|
|
931
1014
|
}
|
|
932
|
-
var
|
|
933
|
-
function
|
|
934
|
-
let n = s(() => new Set(
|
|
935
|
-
return /* @__PURE__ */ F(
|
|
1015
|
+
var Jn = t(void 0);
|
|
1016
|
+
function Yn({ element: e, children: t }) {
|
|
1017
|
+
let n = s(() => new Set(qn(e)), [e]);
|
|
1018
|
+
return /* @__PURE__ */ F(Jn.Provider, {
|
|
936
1019
|
value: n,
|
|
937
1020
|
children: t
|
|
938
1021
|
});
|
|
939
1022
|
}
|
|
940
|
-
function
|
|
941
|
-
return /* @__PURE__ */ F(
|
|
1023
|
+
function Xn({ children: e }) {
|
|
1024
|
+
return /* @__PURE__ */ F(Jn.Provider, {
|
|
942
1025
|
value: void 0,
|
|
943
1026
|
children: e
|
|
944
1027
|
});
|
|
945
1028
|
}
|
|
946
|
-
function
|
|
947
|
-
let e = i(
|
|
1029
|
+
function q() {
|
|
1030
|
+
let e = i(Jn), { queries: t, selections: n } = z();
|
|
948
1031
|
return s(() => {
|
|
949
1032
|
let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
|
|
950
1033
|
return {
|
|
951
|
-
selectableRows:
|
|
952
|
-
selectedRows:
|
|
1034
|
+
selectableRows: hr(r),
|
|
1035
|
+
selectedRows: gr(i, r)
|
|
953
1036
|
};
|
|
954
1037
|
}, [
|
|
955
1038
|
t,
|
|
@@ -958,12 +1041,13 @@ function In() {
|
|
|
958
1041
|
]);
|
|
959
1042
|
}
|
|
960
1043
|
// src/StageCommandForm.tsx
|
|
961
|
-
var
|
|
962
|
-
function
|
|
963
|
-
let t = z(), n = i(Fe), r = i(
|
|
1044
|
+
var Zn = t(void 0), Qn = t(null);
|
|
1045
|
+
function $n({ element: e }) {
|
|
1046
|
+
let t = z(), n = i(Fe), r = i(Zn), a = i(Qn), o = c(null), u = s(() => tr(e), [e]), d = s(() => Nr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? nr(u, d) : [], [u, d]), m = u ? G(u.command, Y(e, "typeName"), Y(e, "route")) : void 0, h = Y(e, "submitLabel") || "Submit", g = xr(e, p, t.resolveArgument), _ = yr(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), { selectableRows: b, selectedRows: x, rowAction: S, subjectValues: C } = yn(e, q()), w = s(() => ({
|
|
964
1047
|
...y,
|
|
965
|
-
...
|
|
966
|
-
...
|
|
1048
|
+
...cr(p, d, t.parameters, x, b, S),
|
|
1049
|
+
...C,
|
|
1050
|
+
...sr(p, t.parameters)
|
|
967
1051
|
}), [
|
|
968
1052
|
y,
|
|
969
1053
|
p,
|
|
@@ -971,16 +1055,17 @@ function zn({ element: e }) {
|
|
|
971
1055
|
t.parameters,
|
|
972
1056
|
x,
|
|
973
1057
|
b,
|
|
974
|
-
S
|
|
975
|
-
|
|
1058
|
+
S,
|
|
1059
|
+
C
|
|
1060
|
+
]), ee = s(() => u ? rr(u, p, d) : void 0, [
|
|
976
1061
|
u,
|
|
977
1062
|
p,
|
|
978
1063
|
d
|
|
979
|
-
]),
|
|
1064
|
+
]), T = s(() => u ? jr(p, d) : [], [
|
|
980
1065
|
u,
|
|
981
1066
|
p,
|
|
982
1067
|
d
|
|
983
|
-
]), te = s(() => u ?
|
|
1068
|
+
]), te = s(() => u ? Mr(u.layout, p) : [], [u, p]), [ne, E] = l([]);
|
|
984
1069
|
return u ? !m && !t.routesReady ? /* @__PURE__ */ I("p", {
|
|
985
1070
|
className: "stage-note",
|
|
986
1071
|
children: [
|
|
@@ -988,12 +1073,12 @@ function zn({ element: e }) {
|
|
|
988
1073
|
u.command,
|
|
989
1074
|
"” is waiting for Stage routes."
|
|
990
1075
|
]
|
|
991
|
-
}) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(
|
|
1076
|
+
}) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(er, {
|
|
992
1077
|
form: u,
|
|
993
1078
|
messages: [`The modeled command “${u.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
994
|
-
}) :
|
|
1079
|
+
}) : T.length > 0 ? /* @__PURE__ */ F(er, {
|
|
995
1080
|
form: u,
|
|
996
|
-
messages:
|
|
1081
|
+
messages: T
|
|
997
1082
|
}) : /* @__PURE__ */ F("section", {
|
|
998
1083
|
ref: o,
|
|
999
1084
|
className: "stage-command-form",
|
|
@@ -1001,19 +1086,19 @@ function zn({ element: e }) {
|
|
|
1001
1086
|
"data-generation-mode": u.generationMode,
|
|
1002
1087
|
children: /* @__PURE__ */ I(Je, {
|
|
1003
1088
|
command: m,
|
|
1004
|
-
initialValues:
|
|
1089
|
+
initialValues: w,
|
|
1005
1090
|
currentValues: g,
|
|
1006
1091
|
validateOn: "both",
|
|
1007
1092
|
validateAllFieldsOnChange: !0,
|
|
1008
|
-
onBeforeExecute: (e) =>
|
|
1009
|
-
onFieldValidate: (e, t, n, r) =>
|
|
1010
|
-
onValidationFailure: (e) =>
|
|
1011
|
-
onException: (e) =>
|
|
1012
|
-
onFailed: (e) =>
|
|
1093
|
+
onBeforeExecute: (e) => An(e, n.apiBasePath),
|
|
1094
|
+
onFieldValidate: (e, t, n, r) => Ar(p, d, t, r),
|
|
1095
|
+
onValidationFailure: (e) => E(kr(p, e)),
|
|
1096
|
+
onException: (e) => E(e),
|
|
1097
|
+
onFailed: (e) => E(Mn(u.command, e).messages),
|
|
1013
1098
|
onSuccess: () => {
|
|
1014
|
-
|
|
1015
|
-
let n =
|
|
1016
|
-
n &&
|
|
1099
|
+
E([]), t.refreshAfterCommand();
|
|
1100
|
+
let n = Y(e, "navigateToScreen");
|
|
1101
|
+
n && K(n, {}), r?.();
|
|
1017
1102
|
},
|
|
1018
1103
|
children: [
|
|
1019
1104
|
te.map((e) => /* @__PURE__ */ F("p", {
|
|
@@ -1021,7 +1106,7 @@ function zn({ element: e }) {
|
|
|
1021
1106
|
className: "stage-form-error",
|
|
1022
1107
|
children: e
|
|
1023
1108
|
}, e)),
|
|
1024
|
-
|
|
1109
|
+
ee,
|
|
1025
1110
|
ne.map((e) => /* @__PURE__ */ F("p", {
|
|
1026
1111
|
role: "alert",
|
|
1027
1112
|
className: "stage-form-error",
|
|
@@ -1051,7 +1136,7 @@ function zn({ element: e }) {
|
|
|
1051
1136
|
children: "This form is missing its command metadata."
|
|
1052
1137
|
});
|
|
1053
1138
|
}
|
|
1054
|
-
function
|
|
1139
|
+
function er({ form: e, messages: t }) {
|
|
1055
1140
|
return /* @__PURE__ */ F("section", {
|
|
1056
1141
|
className: "stage-command-form",
|
|
1057
1142
|
"data-command": e.command,
|
|
@@ -1063,47 +1148,47 @@ function Bn({ form: e, messages: t }) {
|
|
|
1063
1148
|
}, e))
|
|
1064
1149
|
});
|
|
1065
1150
|
}
|
|
1066
|
-
function
|
|
1067
|
-
let t =
|
|
1151
|
+
function tr(e) {
|
|
1152
|
+
let t = Y(e, "command");
|
|
1068
1153
|
if (!t) return;
|
|
1069
|
-
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(
|
|
1154
|
+
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(X) : [];
|
|
1070
1155
|
return {
|
|
1071
1156
|
command: t,
|
|
1072
|
-
label:
|
|
1157
|
+
label: Y(e, "label", t),
|
|
1073
1158
|
fields: n,
|
|
1074
|
-
generationMode:
|
|
1075
|
-
layout:
|
|
1159
|
+
generationMode: Cr(e.properties.generationMode),
|
|
1160
|
+
layout: wr(e.properties.layout)
|
|
1076
1161
|
};
|
|
1077
1162
|
}
|
|
1078
|
-
function
|
|
1163
|
+
function nr(e, t) {
|
|
1079
1164
|
return e.generationMode === f.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1080
1165
|
name: e.name,
|
|
1081
|
-
label:
|
|
1166
|
+
label: W(e.name)
|
|
1082
1167
|
}));
|
|
1083
1168
|
}
|
|
1084
|
-
function
|
|
1085
|
-
let r = e.layout, i = r ?
|
|
1086
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
1087
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1088
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1089
|
-
columnGap:
|
|
1090
|
-
rowGap:
|
|
1169
|
+
function rr(e, t, n) {
|
|
1170
|
+
let r = e.layout, i = r ? Tr(r, t) : [];
|
|
1171
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => ir(e, n));
|
|
1172
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Er(r, i), s = {
|
|
1173
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => Dr(t + 1, r.columns)).join(" "),
|
|
1174
|
+
columnGap: J(r.columnGap),
|
|
1175
|
+
rowGap: J(r.rowGap)
|
|
1091
1176
|
}, c = /* @__PURE__ */ new Set();
|
|
1092
1177
|
return /* @__PURE__ */ I("div", {
|
|
1093
1178
|
className: "stage-command-form__layout",
|
|
1094
1179
|
style: s,
|
|
1095
1180
|
children: [i.map((e) => {
|
|
1096
1181
|
let t = a.get(e.field);
|
|
1097
|
-
return t ? (c.add(t.name),
|
|
1098
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
1182
|
+
return t ? (c.add(t.name), ir(t, n, e)) : null;
|
|
1183
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => ir(e, n))]
|
|
1099
1184
|
});
|
|
1100
1185
|
}
|
|
1101
|
-
function
|
|
1186
|
+
function ir(e, t, n) {
|
|
1102
1187
|
let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
|
|
1103
1188
|
if (i?.options) {
|
|
1104
1189
|
let e = i.options.map((e) => ({
|
|
1105
1190
|
value: e,
|
|
1106
|
-
label:
|
|
1191
|
+
label: W(e)
|
|
1107
1192
|
}));
|
|
1108
1193
|
return /* @__PURE__ */ F($e, {
|
|
1109
1194
|
value: o,
|
|
@@ -1115,7 +1200,7 @@ function Wn(e, t, n) {
|
|
|
1115
1200
|
optionLabel: "label"
|
|
1116
1201
|
});
|
|
1117
1202
|
}
|
|
1118
|
-
if (i?.members || i?.item) return /* @__PURE__ */ F(
|
|
1203
|
+
if (i?.members || i?.item) return /* @__PURE__ */ F(zn, {
|
|
1119
1204
|
value: o,
|
|
1120
1205
|
fieldName: r,
|
|
1121
1206
|
title: a,
|
|
@@ -1135,7 +1220,7 @@ function Wn(e, t, n) {
|
|
|
1135
1220
|
label: a,
|
|
1136
1221
|
required: s
|
|
1137
1222
|
});
|
|
1138
|
-
case "date": return /* @__PURE__ */ F(
|
|
1223
|
+
case "date": return /* @__PURE__ */ F(ar, {
|
|
1139
1224
|
value: o,
|
|
1140
1225
|
fieldName: r,
|
|
1141
1226
|
title: a,
|
|
@@ -1150,7 +1235,7 @@ function Wn(e, t, n) {
|
|
|
1150
1235
|
required: s
|
|
1151
1236
|
});
|
|
1152
1237
|
}
|
|
1153
|
-
})(), l =
|
|
1238
|
+
})(), l = Or(n);
|
|
1154
1239
|
return /* @__PURE__ */ F("span", {
|
|
1155
1240
|
className: "stage-command-form__field",
|
|
1156
1241
|
"data-field": e.name,
|
|
@@ -1161,12 +1246,12 @@ function Wn(e, t, n) {
|
|
|
1161
1246
|
children: c
|
|
1162
1247
|
}, e.name);
|
|
1163
1248
|
}
|
|
1164
|
-
var
|
|
1249
|
+
var ar = Xe((e) => /* @__PURE__ */ F(Ze, {
|
|
1165
1250
|
...e,
|
|
1166
|
-
currentValue: e.showTime ? e.currentValue :
|
|
1251
|
+
currentValue: e.showTime ? e.currentValue : or(e.currentValue),
|
|
1167
1252
|
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ge.fromDate(t) : t)
|
|
1168
1253
|
}));
|
|
1169
|
-
function
|
|
1254
|
+
function or(e) {
|
|
1170
1255
|
if (e instanceof Ge) return e.toDate();
|
|
1171
1256
|
if (typeof e != "string") return e;
|
|
1172
1257
|
try {
|
|
@@ -1175,7 +1260,7 @@ function Kn(e) {
|
|
|
1175
1260
|
return null;
|
|
1176
1261
|
}
|
|
1177
1262
|
}
|
|
1178
|
-
function
|
|
1263
|
+
function sr(e, t) {
|
|
1179
1264
|
let n = {};
|
|
1180
1265
|
for (let r of e) {
|
|
1181
1266
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1183,35 +1268,35 @@ function qn(e, t) {
|
|
|
1183
1268
|
}
|
|
1184
1269
|
return n;
|
|
1185
1270
|
}
|
|
1186
|
-
function
|
|
1271
|
+
function cr(e, t, n, r = [], i = [], a = !1) {
|
|
1187
1272
|
let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
|
|
1188
1273
|
for (let e of t) {
|
|
1189
1274
|
if (!e.identifier || !e.required || o.has(e.name)) continue;
|
|
1190
|
-
if (a &&
|
|
1191
|
-
let t = n[e.name] ||
|
|
1275
|
+
if (a && fr(e, i)) {
|
|
1276
|
+
let t = n[e.name] || dr(e, r);
|
|
1192
1277
|
t && (c[e.name] = t);
|
|
1193
1278
|
continue;
|
|
1194
1279
|
}
|
|
1195
|
-
let t = n[e.name] ||
|
|
1280
|
+
let t = n[e.name] || dr(e, r) || Lt(e.identifier) || (e.identity || !s && !fr(e, i) ? Rt(e.identifier) : void 0);
|
|
1196
1281
|
t !== void 0 && (c[e.name] = t);
|
|
1197
1282
|
}
|
|
1198
1283
|
return c;
|
|
1199
1284
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 ||
|
|
1285
|
+
function lr(e, t) {
|
|
1286
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || ur(e, t) !== void 0;
|
|
1202
1287
|
}
|
|
1203
|
-
function
|
|
1288
|
+
function ur(e, t) {
|
|
1204
1289
|
if (e.identifier) return t[e.name] || Lt(e.identifier);
|
|
1205
1290
|
}
|
|
1206
|
-
function
|
|
1291
|
+
function dr(e, t) {
|
|
1207
1292
|
if (!e.identifier) return;
|
|
1208
1293
|
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1209
1294
|
return n.size === 1 ? [...n][0] : void 0;
|
|
1210
1295
|
}
|
|
1211
|
-
function
|
|
1296
|
+
function fr(e, t) {
|
|
1212
1297
|
return t.some((t) => Object.hasOwn(t, e.name));
|
|
1213
1298
|
}
|
|
1214
|
-
function
|
|
1299
|
+
function pr(e, t) {
|
|
1215
1300
|
let n = e.id;
|
|
1216
1301
|
if (typeof n != "string" || n === "") return e;
|
|
1217
1302
|
let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
|
|
@@ -1220,43 +1305,43 @@ function $n(e, t) {
|
|
|
1220
1305
|
...e
|
|
1221
1306
|
};
|
|
1222
1307
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return Object.values(e).flatMap((e) => e.rows.map((t) => [t,
|
|
1308
|
+
function mr(e) {
|
|
1309
|
+
return Object.values(e).flatMap((e) => e.rows.map((t) => [t, pr(t, e)]));
|
|
1225
1310
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1311
|
+
function hr(e) {
|
|
1312
|
+
return mr(e).map(([, e]) => e);
|
|
1228
1313
|
}
|
|
1229
|
-
function
|
|
1230
|
-
let n = new Map(
|
|
1314
|
+
function gr(e, t) {
|
|
1315
|
+
let n = new Map(mr(t));
|
|
1231
1316
|
return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
|
|
1232
1317
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return e.filter((e) => e.identifier && e.required &&
|
|
1318
|
+
function _r(e, t, n, r) {
|
|
1319
|
+
return e.filter((e) => e.identifier && e.required && fr(e, r)).filter((e) => !t[e.name] && dr(e, n) === void 0).map((e) => e.name);
|
|
1235
1320
|
}
|
|
1236
|
-
function
|
|
1321
|
+
function vr(e) {
|
|
1237
1322
|
let t = e.properties.populateSource;
|
|
1238
|
-
return
|
|
1323
|
+
return X(t) ? t : void 0;
|
|
1239
1324
|
}
|
|
1240
|
-
function
|
|
1241
|
-
let r =
|
|
1242
|
-
scope: `populate:${
|
|
1325
|
+
function yr(e, t, n) {
|
|
1326
|
+
let r = vr(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, br(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
|
|
1327
|
+
scope: `populate:${Y(e, "command")}`,
|
|
1243
1328
|
name: i,
|
|
1244
1329
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
1245
1330
|
arguments: o,
|
|
1246
1331
|
ready: c,
|
|
1247
1332
|
publish: !1
|
|
1248
|
-
}), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] :
|
|
1333
|
+
}), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : X(u) ? u : void 0;
|
|
1249
1334
|
return s(() => {
|
|
1250
1335
|
if (!d) return;
|
|
1251
1336
|
let e = {};
|
|
1252
1337
|
for (let n of t) {
|
|
1253
1338
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1254
|
-
t != null && (e[n.name] =
|
|
1339
|
+
t != null && (e[n.name] = fn(n, t));
|
|
1255
1340
|
}
|
|
1256
1341
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1257
1342
|
}, [d, t]);
|
|
1258
1343
|
}
|
|
1259
|
-
function
|
|
1344
|
+
function br(e, t, n, r) {
|
|
1260
1345
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1261
1346
|
if (i) return i;
|
|
1262
1347
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
@@ -1264,52 +1349,52 @@ function or(e, t, n, r) {
|
|
|
1264
1349
|
let o = r.resolveBinding({ path: t });
|
|
1265
1350
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1266
1351
|
}
|
|
1267
|
-
function
|
|
1268
|
-
let r = s(() =>
|
|
1352
|
+
function xr(e, t, n) {
|
|
1353
|
+
let r = s(() => Sr(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1269
1354
|
return s(() => {
|
|
1270
1355
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1271
1356
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1272
1357
|
}, [r, a]);
|
|
1273
1358
|
}
|
|
1274
|
-
function
|
|
1359
|
+
function Sr(e, t) {
|
|
1275
1360
|
let n = e.properties.arguments;
|
|
1276
1361
|
if (!Array.isArray(n)) return [];
|
|
1277
1362
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1278
1363
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1279
1364
|
}
|
|
1280
|
-
function
|
|
1365
|
+
function Cr(e) {
|
|
1281
1366
|
return e === f.Manual ? f.Manual : f.Auto;
|
|
1282
1367
|
}
|
|
1283
|
-
function
|
|
1284
|
-
if (!
|
|
1368
|
+
function wr(e) {
|
|
1369
|
+
if (!X(e)) return;
|
|
1285
1370
|
let t = e;
|
|
1286
1371
|
return {
|
|
1287
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1288
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1289
|
-
columnGap:
|
|
1290
|
-
rowGap:
|
|
1372
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(Pr) : [],
|
|
1373
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Fr) : [],
|
|
1374
|
+
columnGap: Ir(t.columnGap) ? t.columnGap : void 0,
|
|
1375
|
+
rowGap: Ir(t.rowGap) ? t.rowGap : void 0
|
|
1291
1376
|
};
|
|
1292
1377
|
}
|
|
1293
|
-
function
|
|
1378
|
+
function Tr(e, t) {
|
|
1294
1379
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1295
|
-
for (let e of t) !n.has(e.name) &&
|
|
1380
|
+
for (let e of t) !n.has(e.name) && Fr(e.placement) && n.set(e.name, e.placement);
|
|
1296
1381
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1297
1382
|
}
|
|
1298
|
-
function
|
|
1383
|
+
function Er(e, t) {
|
|
1299
1384
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1300
1385
|
}
|
|
1301
|
-
function
|
|
1302
|
-
let n = t.find((t) => t.index === e), r =
|
|
1386
|
+
function Dr(e, t) {
|
|
1387
|
+
let n = t.find((t) => t.index === e), r = J(n?.width), i = J(n?.minWidth), a = J(n?.maxWidth);
|
|
1303
1388
|
return n?.width?.unit === p.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
|
|
1304
1389
|
}
|
|
1305
|
-
function
|
|
1390
|
+
function Or(e) {
|
|
1306
1391
|
if (e) return {
|
|
1307
1392
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1308
1393
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
1309
|
-
width: e.width?.unit === p.Fraction ? void 0 :
|
|
1394
|
+
width: e.width?.unit === p.Fraction ? void 0 : J(e.width)
|
|
1310
1395
|
};
|
|
1311
1396
|
}
|
|
1312
|
-
function
|
|
1397
|
+
function J(e) {
|
|
1313
1398
|
if (e) switch (e.unit) {
|
|
1314
1399
|
case p.Fraction: return `${e.value ?? 1}fr`;
|
|
1315
1400
|
case p.Pixels: return `${e.value ?? 0}px`;
|
|
@@ -1317,60 +1402,60 @@ function q(e) {
|
|
|
1317
1402
|
case p.Auto: return "auto";
|
|
1318
1403
|
}
|
|
1319
1404
|
}
|
|
1320
|
-
function
|
|
1405
|
+
function kr(e, t) {
|
|
1321
1406
|
let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
|
|
1322
1407
|
return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
|
|
1323
1408
|
}
|
|
1324
|
-
function
|
|
1409
|
+
function Ar(e, t, n, r) {
|
|
1325
1410
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1326
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1411
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? un(a, r, i?.label ?? n) : void 0;
|
|
1327
1412
|
}
|
|
1328
|
-
function
|
|
1413
|
+
function jr(e, t) {
|
|
1329
1414
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1330
1415
|
return e.flatMap((e) => {
|
|
1331
1416
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1332
1417
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1333
1418
|
});
|
|
1334
1419
|
}
|
|
1335
|
-
function
|
|
1420
|
+
function Mr(e, t) {
|
|
1336
1421
|
if (!e) return [];
|
|
1337
|
-
let n =
|
|
1422
|
+
let n = Tr(e, t).filter((e) => e.width?.unit === p.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === p.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
|
|
1338
1423
|
return [...n, ...r];
|
|
1339
1424
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return
|
|
1425
|
+
function Nr(e) {
|
|
1426
|
+
return U(Y(e, "schema"));
|
|
1342
1427
|
}
|
|
1343
|
-
function
|
|
1428
|
+
function Y(e, t, n = "") {
|
|
1344
1429
|
let r = e.properties[t];
|
|
1345
1430
|
return typeof r == "string" ? r : n;
|
|
1346
1431
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return
|
|
1432
|
+
function Pr(e) {
|
|
1433
|
+
return X(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1349
1434
|
}
|
|
1350
|
-
function
|
|
1351
|
-
return
|
|
1435
|
+
function Fr(e) {
|
|
1436
|
+
return X(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1352
1437
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1438
|
+
function Ir(e) {
|
|
1439
|
+
return X(e) && Object.values(p).includes(e.unit);
|
|
1355
1440
|
}
|
|
1356
|
-
function
|
|
1441
|
+
function X(e) {
|
|
1357
1442
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1358
1443
|
}
|
|
1359
1444
|
// src/StageGuardedAction.tsx
|
|
1360
|
-
function
|
|
1445
|
+
function Lr(e) {
|
|
1361
1446
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1362
1447
|
}
|
|
1363
|
-
function
|
|
1448
|
+
function Rr(e, t) {
|
|
1364
1449
|
let n = e.properties[t];
|
|
1365
1450
|
return typeof n == "string" ? n : "";
|
|
1366
1451
|
}
|
|
1367
|
-
function
|
|
1452
|
+
function zr(e) {
|
|
1368
1453
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1369
1454
|
}
|
|
1370
|
-
function
|
|
1371
|
-
let t = z(), n =
|
|
1455
|
+
function Br(e) {
|
|
1456
|
+
let t = z(), n = Rr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Rr(e, "itemRoute"), i = Lr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1372
1457
|
for (let [e, n] of Object.entries(i)) {
|
|
1373
|
-
let r =
|
|
1458
|
+
let r = Lr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1374
1459
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1375
1460
|
}
|
|
1376
1461
|
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
|
|
@@ -1389,11 +1474,11 @@ function Er(e) {
|
|
|
1389
1474
|
item: l.rows.length === 1 ? l.rows[0] : void 0
|
|
1390
1475
|
};
|
|
1391
1476
|
}
|
|
1392
|
-
function
|
|
1477
|
+
function Vr(e, t) {
|
|
1393
1478
|
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Ft(wt(n) ?? "", t)]));
|
|
1394
1479
|
}
|
|
1395
|
-
function
|
|
1396
|
-
let n = z(), r =
|
|
1480
|
+
function Hr({ element: e, interactions: t }) {
|
|
1481
|
+
let n = z(), r = Br(e), i = Nn(), [a, o] = l([]), [c, u] = l(!1), d = Rr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Lr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1397
1482
|
if (!Mt(m) || !h || !r.hasSource) {
|
|
1398
1483
|
let n = r.hasSource ? `${Tt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Tt}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1399
1484
|
return /* @__PURE__ */ I("div", {
|
|
@@ -1415,14 +1500,14 @@ function Or({ element: e, interactions: t }) {
|
|
|
1415
1500
|
if (!r.item) return null;
|
|
1416
1501
|
let g = Nt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1417
1502
|
if (!_?.command) return null;
|
|
1418
|
-
let v = _.command, y =
|
|
1503
|
+
let v = _.command, y = G(v), b = r.item, x = async () => {
|
|
1419
1504
|
if (!y) return;
|
|
1420
1505
|
u(!0);
|
|
1421
|
-
let t = await i(v,
|
|
1506
|
+
let t = await i(v, Vr(_, b));
|
|
1422
1507
|
if (u(!1), o(t.messages), !t.isSuccess) return;
|
|
1423
1508
|
n.refreshAfterCommand();
|
|
1424
|
-
let r =
|
|
1425
|
-
r &&
|
|
1509
|
+
let r = Rr(e, "navigateToScreen"), a = Rr(e, "navigateByParameter"), s = a ? Ft(`item.${a}`, b) : void 0;
|
|
1510
|
+
r && K(r, a && s != null ? { [a]: String(s) } : {});
|
|
1426
1511
|
};
|
|
1427
1512
|
return /* @__PURE__ */ I("div", {
|
|
1428
1513
|
className: "stage-guarded-action",
|
|
@@ -1442,13 +1527,13 @@ function Or({ element: e, interactions: t }) {
|
|
|
1442
1527
|
}, e))]
|
|
1443
1528
|
});
|
|
1444
1529
|
}
|
|
1445
|
-
function
|
|
1530
|
+
function Ur(e) {
|
|
1446
1531
|
let t = he(), n = c(void 0), i = s(() => C(le(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
|
|
1447
1532
|
a(() => () => clearTimeout(n.current), []);
|
|
1448
1533
|
let o = r((e) => {
|
|
1449
1534
|
if (clearTimeout(n.current), n.current = void 0, !t) return;
|
|
1450
1535
|
let r = (n) => n.path === "$guard" ? Pt(n.value, e) : n.path?.startsWith("item.") ? Ft(n.path, e) : t.context.resolve(n);
|
|
1451
|
-
|
|
1536
|
+
T(i, t.dispatcher, {
|
|
1452
1537
|
...t.context,
|
|
1453
1538
|
resolve: r
|
|
1454
1539
|
}).then((e) => {
|
|
@@ -1465,12 +1550,12 @@ function kr(e) {
|
|
|
1465
1550
|
};
|
|
1466
1551
|
}
|
|
1467
1552
|
// src/stageDialogScreens.ts
|
|
1468
|
-
var
|
|
1469
|
-
function
|
|
1553
|
+
var Wr = "Stage:confirmDialog", Gr = "ConfirmDialog";
|
|
1554
|
+
function Kr(e, t) {
|
|
1470
1555
|
let n = new Set(t.map((e) => e.name));
|
|
1471
1556
|
return e.map((t) => {
|
|
1472
|
-
if (t.screenTemplate !==
|
|
1473
|
-
let r =
|
|
1557
|
+
if (t.screenTemplate !== Gr || n.has(Gr)) return t;
|
|
1558
|
+
let r = qr(t), i = e.find((e) => e.name !== t.name)?.name, a = P(`confirm-dialog-${t.name}`, Wr, {
|
|
1474
1559
|
title: t.name,
|
|
1475
1560
|
decisions: r,
|
|
1476
1561
|
home: i
|
|
@@ -1483,44 +1568,44 @@ function Mr(e, t) {
|
|
|
1483
1568
|
};
|
|
1484
1569
|
});
|
|
1485
1570
|
}
|
|
1486
|
-
function
|
|
1571
|
+
function qr(e) {
|
|
1487
1572
|
let t = [];
|
|
1488
|
-
for (let n of
|
|
1489
|
-
let r =
|
|
1573
|
+
for (let n of Jr(Object.values(e.slotContent).flat())) {
|
|
1574
|
+
let r = Yr(n.properties.command);
|
|
1490
1575
|
r && !t.some((e) => e.command === r) && t.push({
|
|
1491
1576
|
command: r,
|
|
1492
|
-
label:
|
|
1493
|
-
navigateToScreen:
|
|
1494
|
-
typeName:
|
|
1495
|
-
route:
|
|
1577
|
+
label: Yr(n.properties.label),
|
|
1578
|
+
navigateToScreen: Yr(n.properties.navigateToScreen),
|
|
1579
|
+
typeName: Yr(n.properties.typeName),
|
|
1580
|
+
route: Yr(n.properties.route),
|
|
1496
1581
|
form: e.forms.find((e) => e.forCommand === r)
|
|
1497
1582
|
});
|
|
1498
1583
|
}
|
|
1499
1584
|
return t;
|
|
1500
1585
|
}
|
|
1501
|
-
function
|
|
1586
|
+
function Jr(e) {
|
|
1502
1587
|
return e.flatMap((e) => {
|
|
1503
1588
|
let t = e;
|
|
1504
|
-
return t.componentName === "core:action" ? [t] :
|
|
1589
|
+
return t.componentName === "core:action" ? [t] : Jr(Object.values(t.slots ?? {}).flat());
|
|
1505
1590
|
});
|
|
1506
1591
|
}
|
|
1507
|
-
function
|
|
1592
|
+
function Yr(e) {
|
|
1508
1593
|
return typeof e == "string" && e !== "" ? e : void 0;
|
|
1509
1594
|
}
|
|
1510
1595
|
// src/StageConfirmDialog.tsx
|
|
1511
|
-
function
|
|
1512
|
-
let { routes: t, parameters: n, queries: r, selections: i } = z(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h =
|
|
1596
|
+
function Xr({ element: e }) {
|
|
1597
|
+
let { routes: t, parameters: n, queries: r, selections: i } = z(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = gr(i, r);
|
|
1513
1598
|
return a(() => u.current?.focus(), []), /* @__PURE__ */ I("section", {
|
|
1514
1599
|
className: "scene-slice-dialog stage-confirm-dialog",
|
|
1515
1600
|
role: "dialog",
|
|
1516
|
-
"aria-label":
|
|
1517
|
-
"data-stage-component":
|
|
1601
|
+
"aria-label": W(d),
|
|
1602
|
+
"data-stage-component": Wr,
|
|
1518
1603
|
children: [
|
|
1519
1604
|
/* @__PURE__ */ F("header", {
|
|
1520
1605
|
className: "scene-slice-dialog-header",
|
|
1521
1606
|
children: /* @__PURE__ */ F("h2", {
|
|
1522
1607
|
className: "scene-slice-dialog-title",
|
|
1523
|
-
children:
|
|
1608
|
+
children: W(d)
|
|
1524
1609
|
})
|
|
1525
1610
|
}),
|
|
1526
1611
|
/* @__PURE__ */ F("div", {
|
|
@@ -1532,50 +1617,50 @@ function Fr({ element: e }) {
|
|
|
1532
1617
|
"data-emphasis": t === 0 ? "primary" : "secondary",
|
|
1533
1618
|
"aria-pressed": e.command === o,
|
|
1534
1619
|
onClick: () => s(e.command),
|
|
1535
|
-
children:
|
|
1620
|
+
children: Qr(e)
|
|
1536
1621
|
}, e.command))
|
|
1537
1622
|
}),
|
|
1538
|
-
m && /* @__PURE__ */ F(
|
|
1623
|
+
m && /* @__PURE__ */ F(Xn, { children: /* @__PURE__ */ F($n, { element: ti(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
|
|
1539
1624
|
/* @__PURE__ */ F("footer", {
|
|
1540
1625
|
className: "scene-slice-dialog-footer",
|
|
1541
1626
|
children: /* @__PURE__ */ F("button", {
|
|
1542
1627
|
type: "button",
|
|
1543
1628
|
className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
|
|
1544
|
-
onClick: () =>
|
|
1629
|
+
onClick: () => Zr(f, p),
|
|
1545
1630
|
children: "Cancel"
|
|
1546
1631
|
})
|
|
1547
1632
|
})
|
|
1548
1633
|
]
|
|
1549
1634
|
});
|
|
1550
1635
|
}
|
|
1551
|
-
function
|
|
1636
|
+
function Zr(e, t) {
|
|
1552
1637
|
let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
|
|
1553
|
-
r &&
|
|
1638
|
+
r && K(r, {});
|
|
1554
1639
|
}
|
|
1555
|
-
function
|
|
1556
|
-
return e.label ??
|
|
1640
|
+
function Qr(e) {
|
|
1641
|
+
return e.label ?? W(e.command);
|
|
1557
1642
|
}
|
|
1558
|
-
function
|
|
1559
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] ||
|
|
1643
|
+
function $r(e, t, n) {
|
|
1644
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || dr(e, n) !== void 0;
|
|
1560
1645
|
}
|
|
1561
|
-
function
|
|
1646
|
+
function ei(e, t, n, r) {
|
|
1562
1647
|
let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1563
1648
|
name: e.name,
|
|
1564
1649
|
label: e.name
|
|
1565
|
-
})), o = new Set(t.filter((e) =>
|
|
1650
|
+
})), o = new Set(t.filter((e) => $r(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
|
|
1566
1651
|
return [...s, ...l.map((e) => ({
|
|
1567
1652
|
name: e.name,
|
|
1568
|
-
label:
|
|
1653
|
+
label: W(e.name)
|
|
1569
1654
|
}))];
|
|
1570
1655
|
}
|
|
1571
|
-
function
|
|
1572
|
-
let i =
|
|
1656
|
+
function ti(e, t, n, r) {
|
|
1657
|
+
let i = ei(e, U(t), n, r);
|
|
1573
1658
|
return {
|
|
1574
1659
|
id: `confirm-${e.command}`,
|
|
1575
|
-
componentName:
|
|
1660
|
+
componentName: Wr,
|
|
1576
1661
|
properties: {
|
|
1577
1662
|
command: e.command,
|
|
1578
|
-
label:
|
|
1663
|
+
label: Qr(e),
|
|
1579
1664
|
submitLabel: "Confirm",
|
|
1580
1665
|
typeName: e.typeName,
|
|
1581
1666
|
route: e.route,
|
|
@@ -1589,13 +1674,13 @@ function Br(e, t, n, r) {
|
|
|
1589
1674
|
slots: {}
|
|
1590
1675
|
};
|
|
1591
1676
|
}
|
|
1592
|
-
function
|
|
1677
|
+
function ni(e) {
|
|
1593
1678
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1594
1679
|
}
|
|
1595
|
-
function
|
|
1680
|
+
function ri(e, t) {
|
|
1596
1681
|
if (!Array.isArray(e) || !Array.isArray(t)) return;
|
|
1597
|
-
let n = new Map(e.filter(
|
|
1598
|
-
for (let e of t.filter(
|
|
1682
|
+
let n = new Map(e.filter(ni).map((e) => [JSON.stringify(e.id), e.column]));
|
|
1683
|
+
for (let e of t.filter(ni)) {
|
|
1599
1684
|
let t = JSON.stringify(e.id);
|
|
1600
1685
|
if (n.has(t) && n.get(t) !== e.column) return {
|
|
1601
1686
|
item: {
|
|
@@ -1606,9 +1691,9 @@ function Hr(e, t) {
|
|
|
1606
1691
|
};
|
|
1607
1692
|
}
|
|
1608
1693
|
}
|
|
1609
|
-
function
|
|
1694
|
+
function ii(e, t, n, r) {
|
|
1610
1695
|
if (!Array.isArray(e)) return;
|
|
1611
|
-
let i = e.filter(
|
|
1696
|
+
let i = e.filter(ni).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
|
|
1612
1697
|
if (i !== void 0) return {
|
|
1613
1698
|
item: {
|
|
1614
1699
|
...i,
|
|
@@ -1618,10 +1703,10 @@ function Ur(e, t, n, r) {
|
|
|
1618
1703
|
previous: t.previous
|
|
1619
1704
|
};
|
|
1620
1705
|
}
|
|
1621
|
-
function
|
|
1706
|
+
function ai(e, t) {
|
|
1622
1707
|
return (n) => n.path === "$guard" ? Pt(n.value, e.item) : n.path === "value" ? e.value : n.path === "previous" ? e.previous : n.path?.startsWith("item.") ? Ft(n.path, e.item) : t(n);
|
|
1623
1708
|
}
|
|
1624
|
-
function
|
|
1709
|
+
function oi(e, t) {
|
|
1625
1710
|
let n = he(), i = z(), { element: a, rowsProperty: o, idField: u, valueField: d } = e, f = s(() => C(le(a.id, a.behaviors), m.Change), [a.behaviors, a.id]), p = c(void 0), h = c(!1), [g, _] = l(0), v = c({
|
|
1626
1711
|
scope: n,
|
|
1627
1712
|
data: i,
|
|
@@ -1635,13 +1720,13 @@ function Gr(e, t) {
|
|
|
1635
1720
|
bindings: f
|
|
1636
1721
|
};
|
|
1637
1722
|
let y = r((e, t) => {
|
|
1638
|
-
let { scope: n, data: r, element: i, bindings: a } = v.current, s =
|
|
1723
|
+
let { scope: n, data: r, element: i, bindings: a } = v.current, s = ri(e, t);
|
|
1639
1724
|
if (!n || a.length === 0 || s === void 0) return;
|
|
1640
|
-
let c =
|
|
1725
|
+
let c = ii(i.properties[o], s, u, d);
|
|
1641
1726
|
if (c === void 0) return;
|
|
1642
1727
|
let l = {
|
|
1643
1728
|
...n.context,
|
|
1644
|
-
resolve:
|
|
1729
|
+
resolve: ai(c, n.context.resolve)
|
|
1645
1730
|
}, f = !1, p = !1, m = {
|
|
1646
1731
|
...n.dispatcher,
|
|
1647
1732
|
executeCommand: async (e, t) => {
|
|
@@ -1649,7 +1734,7 @@ function Gr(e, t) {
|
|
|
1649
1734
|
return r?.isSuccess ? f = !0 : p = !0, r;
|
|
1650
1735
|
}
|
|
1651
1736
|
};
|
|
1652
|
-
|
|
1737
|
+
T(a, m, l).then((e) => {
|
|
1653
1738
|
e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && _((e) => e + 1);
|
|
1654
1739
|
});
|
|
1655
1740
|
}, [
|
|
@@ -1673,8 +1758,8 @@ function Gr(e, t) {
|
|
|
1673
1758
|
revision: g
|
|
1674
1759
|
};
|
|
1675
1760
|
}
|
|
1676
|
-
function
|
|
1677
|
-
let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r =
|
|
1761
|
+
function si(e) {
|
|
1762
|
+
let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = oi({
|
|
1678
1763
|
element: t,
|
|
1679
1764
|
rowsProperty: "cards",
|
|
1680
1765
|
idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
|
|
@@ -1689,8 +1774,8 @@ function Kr(e) {
|
|
|
1689
1774
|
bindingOutputs: r.outputs
|
|
1690
1775
|
}, r.revision) : /* @__PURE__ */ F(i, { ...e });
|
|
1691
1776
|
}
|
|
1692
|
-
var
|
|
1693
|
-
function
|
|
1777
|
+
var ci = ue(Ee, j.KanbanBoard), li = "Stage:commandForm";
|
|
1778
|
+
function ui(e, t, n = {}) {
|
|
1694
1779
|
return {
|
|
1695
1780
|
id: e,
|
|
1696
1781
|
componentName: "",
|
|
@@ -1702,19 +1787,19 @@ function Z(e, t, n = "") {
|
|
|
1702
1787
|
let r = e.properties[t];
|
|
1703
1788
|
return typeof r == "string" ? r : n;
|
|
1704
1789
|
}
|
|
1705
|
-
function
|
|
1790
|
+
function di(e, t, n) {
|
|
1706
1791
|
let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
|
|
1707
|
-
return typeof r == "string" && t?.includes(r) ?
|
|
1792
|
+
return typeof r == "string" && t?.includes(r) ? W(r) : String(e ?? "");
|
|
1708
1793
|
}
|
|
1709
|
-
function
|
|
1794
|
+
function fi(e, t) {
|
|
1710
1795
|
let n = e.properties.queryArguments;
|
|
1711
|
-
if (!
|
|
1796
|
+
if (!gi(n)) return {
|
|
1712
1797
|
values: {},
|
|
1713
1798
|
ready: !0
|
|
1714
1799
|
};
|
|
1715
1800
|
let r = {}, i = !0;
|
|
1716
1801
|
for (let [e, a] of Object.entries(n)) {
|
|
1717
|
-
let n =
|
|
1802
|
+
let n = hi(a) ? t.resolveBinding(a) : a;
|
|
1718
1803
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1719
1804
|
}
|
|
1720
1805
|
return {
|
|
@@ -1722,7 +1807,7 @@ function Zr(e, t) {
|
|
|
1722
1807
|
ready: i
|
|
1723
1808
|
};
|
|
1724
1809
|
}
|
|
1725
|
-
function
|
|
1810
|
+
function pi(e, t) {
|
|
1726
1811
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1727
1812
|
let t = e.properties;
|
|
1728
1813
|
return {
|
|
@@ -1740,14 +1825,14 @@ function Qr(e, t) {
|
|
|
1740
1825
|
function Q(e, t) {
|
|
1741
1826
|
return e[t] ?? e.id ?? e.key;
|
|
1742
1827
|
}
|
|
1743
|
-
function
|
|
1744
|
-
let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() =>
|
|
1828
|
+
function mi({ element: e, slots: t }) {
|
|
1829
|
+
let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() => fi(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
|
|
1745
1830
|
scope: e.id,
|
|
1746
1831
|
name: r,
|
|
1747
1832
|
route: i || void 0,
|
|
1748
1833
|
arguments: o.values,
|
|
1749
1834
|
ready: o.ready
|
|
1750
|
-
}), d =
|
|
1835
|
+
}), d = pi(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = Ur(e);
|
|
1751
1836
|
a(() => {
|
|
1752
1837
|
if (!h) return;
|
|
1753
1838
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1784,7 +1869,7 @@ function $r({ element: e, slots: t }) {
|
|
|
1784
1869
|
...f && f !== n.screen ? {} : n.parameters,
|
|
1785
1870
|
[p]: String(r)
|
|
1786
1871
|
};
|
|
1787
|
-
f && f !== n.screen || n.selectRow(e.id, t),
|
|
1872
|
+
f && f !== n.screen || n.selectRow(e.id, t), K(f || n.screen, i);
|
|
1788
1873
|
} else n.selectRow(e.id, t);
|
|
1789
1874
|
};
|
|
1790
1875
|
return !Z(e, "query") && !i && !yt(r) ? /* @__PURE__ */ I("section", {
|
|
@@ -1816,7 +1901,7 @@ function $r({ element: e, slots: t }) {
|
|
|
1816
1901
|
onClick: () => {
|
|
1817
1902
|
if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
|
|
1818
1903
|
let { [p]: t, ...r } = n.parameters;
|
|
1819
|
-
|
|
1904
|
+
K(n.screen, r);
|
|
1820
1905
|
},
|
|
1821
1906
|
children: "Clear selection"
|
|
1822
1907
|
}),
|
|
@@ -1833,7 +1918,7 @@ function $r({ element: e, slots: t }) {
|
|
|
1833
1918
|
onKeyDown: (t) => {
|
|
1834
1919
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
|
|
1835
1920
|
},
|
|
1836
|
-
children: d.map((t) => /* @__PURE__ */ F("td", { children:
|
|
1921
|
+
children: d.map((t) => /* @__PURE__ */ F("td", { children: di(e[t.property], t.options, t.optionValues) }, t.property))
|
|
1837
1922
|
}, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ F("tr", { children: /* @__PURE__ */ F("td", {
|
|
1838
1923
|
colSpan: Math.max(d.length, 1),
|
|
1839
1924
|
children: "No records found"
|
|
@@ -1842,33 +1927,33 @@ function $r({ element: e, slots: t }) {
|
|
|
1842
1927
|
]
|
|
1843
1928
|
});
|
|
1844
1929
|
}
|
|
1845
|
-
function
|
|
1846
|
-
return
|
|
1930
|
+
function hi(e) {
|
|
1931
|
+
return gi(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1847
1932
|
}
|
|
1848
|
-
function
|
|
1933
|
+
function gi(e) {
|
|
1849
1934
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1850
1935
|
}
|
|
1851
|
-
function
|
|
1852
|
-
return
|
|
1936
|
+
function _i({ element: e, interactions: t, slots: n }) {
|
|
1937
|
+
return zr(e) ? /* @__PURE__ */ F(Hr, {
|
|
1853
1938
|
element: e,
|
|
1854
1939
|
interactions: t
|
|
1855
|
-
}) : /* @__PURE__ */ F(
|
|
1940
|
+
}) : /* @__PURE__ */ F(vi, {
|
|
1856
1941
|
element: e,
|
|
1857
1942
|
interactions: t,
|
|
1858
1943
|
slots: n
|
|
1859
1944
|
});
|
|
1860
1945
|
}
|
|
1861
|
-
function
|
|
1862
|
-
let n = Z(e, "label", Z(e, "command")), r =
|
|
1863
|
-
return r ?
|
|
1946
|
+
function vi({ element: e, interactions: t }) {
|
|
1947
|
+
let n = Z(e, "label", Z(e, "command")), r = G(Z(e, "command"), Z(e, "typeName"), Z(e, "route")), i = gn(e), a = yi(e, i), o = Z(e, "schema"), c = s(() => U(o), [o]), { selectedRows: l } = q(), u = _n(i, l);
|
|
1948
|
+
return r ? a.length > 0 || vn(i, u) ? /* @__PURE__ */ F(L, {
|
|
1864
1949
|
type: "button",
|
|
1865
1950
|
"data-scene-id": e.id,
|
|
1866
1951
|
disabled: !0,
|
|
1867
1952
|
title: "Select a row first",
|
|
1868
1953
|
...t,
|
|
1869
1954
|
children: n
|
|
1870
|
-
}) : /* @__PURE__ */ F(
|
|
1871
|
-
element: e,
|
|
1955
|
+
}) : /* @__PURE__ */ F(xi, {
|
|
1956
|
+
element: u ? Sn(e, c, u) : e,
|
|
1872
1957
|
label: n
|
|
1873
1958
|
}) : /* @__PURE__ */ F(L, {
|
|
1874
1959
|
type: "button",
|
|
@@ -1879,19 +1964,19 @@ function ri({ element: e, interactions: t }) {
|
|
|
1879
1964
|
children: n
|
|
1880
1965
|
});
|
|
1881
1966
|
}
|
|
1882
|
-
function
|
|
1883
|
-
let { parameters:
|
|
1884
|
-
return
|
|
1967
|
+
function yi(e, t) {
|
|
1968
|
+
let { parameters: n } = z(), r = Z(e, "schema"), i = e.properties.fields, a = Z(e, "generationMode").toLowerCase(), o = s(() => U(r), [r]), { selectableRows: c, selectedRows: l } = q(), u = Array.isArray(i) ? i : [], d = u.length > 0 || a === "manual" ? new Set(u.map(bi).filter((e) => e !== "")) : void 0;
|
|
1969
|
+
return !d || t !== void 0 ? [] : _r(o.filter((e) => !d.has(e.name)), n, l, c);
|
|
1885
1970
|
}
|
|
1886
|
-
function
|
|
1887
|
-
return
|
|
1971
|
+
function bi(e) {
|
|
1972
|
+
return gi(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
|
|
1888
1973
|
}
|
|
1889
|
-
function
|
|
1974
|
+
function xi({ element: e, label: t }) {
|
|
1890
1975
|
let [n, i] = l(0), [a, o] = l(!1), s = r(() => {
|
|
1891
1976
|
o(!1), i((e) => e + 1);
|
|
1892
|
-
}, []), c = /* @__PURE__ */ F(
|
|
1977
|
+
}, []), c = /* @__PURE__ */ F(Zn.Provider, {
|
|
1893
1978
|
value: s,
|
|
1894
|
-
children: /* @__PURE__ */ F(
|
|
1979
|
+
children: /* @__PURE__ */ F($n, { element: e }, n)
|
|
1895
1980
|
});
|
|
1896
1981
|
return /* @__PURE__ */ I("div", {
|
|
1897
1982
|
className: "stage-action",
|
|
@@ -1910,19 +1995,19 @@ function oi({ element: e, label: t }) {
|
|
|
1910
1995
|
})]
|
|
1911
1996
|
});
|
|
1912
1997
|
}
|
|
1913
|
-
function
|
|
1914
|
-
let t = e.element ??
|
|
1915
|
-
if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ F(
|
|
1998
|
+
function Si(e) {
|
|
1999
|
+
let t = e.element ?? ui("slice-dialog", {}), n = ge(), { routes: i, parameters: a } = z(), o = me(n?.currentDialogParameters), c = Z(t, "command") || o?.command || Z(t, "slice") || "", u = Z(t, "title") || o?.title || c, d = i?.commandSchemas?.[c], f = s(() => U(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = q(), h = r(() => n?.closeDialog(), [n]), [g, _] = l(null), v = (e) => e.identifier && e.required && fr(e, p) && dr(e, m) !== void 0;
|
|
2000
|
+
if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ F(ne, {
|
|
1916
2001
|
element: e.element,
|
|
1917
2002
|
slots: e.slots ?? {}
|
|
1918
2003
|
}) : /* @__PURE__ */ F(se, {});
|
|
1919
|
-
let y = f.filter((e) => !
|
|
2004
|
+
let y = f.filter((e) => !lr(e, a) && !v(e)), b = ui(`slice-dialog-${c}`, {
|
|
1920
2005
|
command: c,
|
|
1921
2006
|
label: u,
|
|
1922
2007
|
schema: d,
|
|
1923
2008
|
fields: y.map((e) => ({
|
|
1924
2009
|
name: e.name,
|
|
1925
|
-
label:
|
|
2010
|
+
label: W(e.name)
|
|
1926
2011
|
})),
|
|
1927
2012
|
generationMode: "manual"
|
|
1928
2013
|
});
|
|
@@ -1938,11 +2023,11 @@ function si(e) {
|
|
|
1938
2023
|
children: u
|
|
1939
2024
|
})
|
|
1940
2025
|
}),
|
|
1941
|
-
/* @__PURE__ */ F(
|
|
2026
|
+
/* @__PURE__ */ F(Zn.Provider, {
|
|
1942
2027
|
value: h,
|
|
1943
|
-
children: /* @__PURE__ */ F(
|
|
2028
|
+
children: /* @__PURE__ */ F(Qn.Provider, {
|
|
1944
2029
|
value: g,
|
|
1945
|
-
children: /* @__PURE__ */ F(
|
|
2030
|
+
children: /* @__PURE__ */ F($n, { element: b })
|
|
1946
2031
|
})
|
|
1947
2032
|
}),
|
|
1948
2033
|
/* @__PURE__ */ F("footer", {
|
|
@@ -1958,13 +2043,13 @@ function si(e) {
|
|
|
1958
2043
|
]
|
|
1959
2044
|
});
|
|
1960
2045
|
}
|
|
1961
|
-
function
|
|
2046
|
+
function Ci(e) {
|
|
1962
2047
|
let { element: t } = e;
|
|
1963
|
-
return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ F(
|
|
2048
|
+
return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ F(Ei, { ...e }) : /* @__PURE__ */ F(E, { ...e }) : /* @__PURE__ */ F(wi, { ...e });
|
|
1964
2049
|
}
|
|
1965
|
-
function
|
|
1966
|
-
let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "slice"), a = Z(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], c = s(() =>
|
|
1967
|
-
if (
|
|
2050
|
+
function wi(e) {
|
|
2051
|
+
let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "slice"), a = Z(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], c = s(() => U(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = q();
|
|
2052
|
+
if (_r(c, r, u, l).length === 0) return /* @__PURE__ */ F(E, { ...e });
|
|
1968
2053
|
let d = Z(t, "label", Z(t, "name", t.id));
|
|
1969
2054
|
return /* @__PURE__ */ F("span", {
|
|
1970
2055
|
className: "stage-toolbar-action",
|
|
@@ -1979,53 +2064,56 @@ function li(e) {
|
|
|
1979
2064
|
})
|
|
1980
2065
|
});
|
|
1981
2066
|
}
|
|
1982
|
-
function
|
|
1983
|
-
|
|
2067
|
+
function Ti(e, t, n) {
|
|
2068
|
+
return t !== "screen" && !!e.identifier && e.required && fr(e, n);
|
|
2069
|
+
}
|
|
2070
|
+
function Ei(e) {
|
|
2071
|
+
let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "name", t.id), a = Z(t, "target"), o = Z(t, "label", i), c = n?.commandSchemas?.[a], l = s(() => U(c ?? ""), [c]), { selectableRows: u, selectedRows: d } = q(), f = gn(t), p = f === void 0 ? _r(l, r, d, u) : [], m = l.filter((e) => !lr(e, r) && !Ti(e, f, u)), h = c ? {
|
|
1984
2072
|
schema: c,
|
|
1985
|
-
fields:
|
|
2073
|
+
fields: m.map((e) => ({
|
|
1986
2074
|
name: e.name,
|
|
1987
|
-
label:
|
|
2075
|
+
label: W(e.name)
|
|
1988
2076
|
})),
|
|
1989
2077
|
generationMode: "manual"
|
|
1990
|
-
} : {},
|
|
2078
|
+
} : {}, g = {
|
|
1991
2079
|
...t,
|
|
1992
2080
|
componentName: "core:action",
|
|
1993
2081
|
properties: {
|
|
1994
2082
|
command: a,
|
|
1995
2083
|
label: o,
|
|
1996
|
-
|
|
1997
|
-
...
|
|
2084
|
+
...h,
|
|
2085
|
+
...bn(t, f)
|
|
1998
2086
|
}
|
|
1999
2087
|
};
|
|
2000
2088
|
return /* @__PURE__ */ F("span", {
|
|
2001
2089
|
className: "stage-toolbar-action",
|
|
2002
2090
|
"data-scene-toolbar-item": i,
|
|
2003
|
-
children:
|
|
2091
|
+
children: p.length > 0 ? /* @__PURE__ */ F(L, {
|
|
2004
2092
|
type: "button",
|
|
2005
2093
|
"data-scene-id": t.id,
|
|
2006
2094
|
disabled: !0,
|
|
2007
2095
|
title: "Select a row first",
|
|
2008
2096
|
...e.interactions,
|
|
2009
2097
|
children: o
|
|
2010
|
-
}) : /* @__PURE__ */ F(
|
|
2011
|
-
element:
|
|
2098
|
+
}) : /* @__PURE__ */ F(_i, {
|
|
2099
|
+
element: g,
|
|
2012
2100
|
interactions: e.interactions,
|
|
2013
2101
|
slots: e.slots
|
|
2014
2102
|
})
|
|
2015
2103
|
});
|
|
2016
2104
|
}
|
|
2017
|
-
var
|
|
2105
|
+
var Di = {
|
|
2018
2106
|
...O,
|
|
2019
|
-
"core:table":
|
|
2020
|
-
"core:action":
|
|
2021
|
-
"core:toolbarItem":
|
|
2022
|
-
"core:sliceDialog":
|
|
2023
|
-
[
|
|
2024
|
-
[
|
|
2025
|
-
[
|
|
2107
|
+
"core:table": mi,
|
|
2108
|
+
"core:action": _i,
|
|
2109
|
+
"core:toolbarItem": Ci,
|
|
2110
|
+
"core:sliceDialog": Si,
|
|
2111
|
+
[li]: $n,
|
|
2112
|
+
[Wr]: Xr,
|
|
2113
|
+
[ci]: si
|
|
2026
2114
|
};
|
|
2027
2115
|
// src/useStrings.ts
|
|
2028
|
-
function
|
|
2116
|
+
function Oi() {
|
|
2029
2117
|
let e = lt(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
|
|
2030
2118
|
return a(() => {
|
|
2031
2119
|
let t = new AbortController();
|
|
@@ -2047,11 +2135,11 @@ function fi() {
|
|
|
2047
2135
|
dictionary: o
|
|
2048
2136
|
};
|
|
2049
2137
|
}
|
|
2050
|
-
var
|
|
2051
|
-
function
|
|
2052
|
-
return
|
|
2138
|
+
var ki = /* @__PURE__ */ new Set(["core:table"]);
|
|
2139
|
+
function Ai(e) {
|
|
2140
|
+
return ji(e, /* @__PURE__ */ new Map(), void 0);
|
|
2053
2141
|
}
|
|
2054
|
-
function
|
|
2142
|
+
function ji(e, t, n) {
|
|
2055
2143
|
let r = e;
|
|
2056
2144
|
if (!r.slots) return e;
|
|
2057
2145
|
let i = !1, a = {};
|
|
@@ -2060,7 +2148,7 @@ function hi(e, t, n) {
|
|
|
2060
2148
|
a[e] = o.map((e) => {
|
|
2061
2149
|
let t = e, n = $(t, "typeName");
|
|
2062
2150
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
2063
|
-
let a =
|
|
2151
|
+
let a = ji(Ni(Mi(t, r), s), r, s);
|
|
2064
2152
|
return a !== e && (i = !0), a;
|
|
2065
2153
|
});
|
|
2066
2154
|
}
|
|
@@ -2069,8 +2157,8 @@ function hi(e, t, n) {
|
|
|
2069
2157
|
slots: a
|
|
2070
2158
|
} : e;
|
|
2071
2159
|
}
|
|
2072
|
-
function
|
|
2073
|
-
if (!
|
|
2160
|
+
function Mi(e, t) {
|
|
2161
|
+
if (!ki.has(e.componentName)) return e;
|
|
2074
2162
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
2075
2163
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
2076
2164
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -2079,7 +2167,7 @@ function gi(e, t) {
|
|
|
2079
2167
|
properties: a
|
|
2080
2168
|
};
|
|
2081
2169
|
}
|
|
2082
|
-
function
|
|
2170
|
+
function Ni(e, t) {
|
|
2083
2171
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
|
|
2084
2172
|
let n = { ...e.properties };
|
|
2085
2173
|
if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
|
|
@@ -2097,7 +2185,7 @@ function $(e, t) {
|
|
|
2097
2185
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
2098
2186
|
}
|
|
2099
2187
|
// src/stageQueryBindings.tsx
|
|
2100
|
-
function
|
|
2188
|
+
function Pi(e) {
|
|
2101
2189
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
2102
2190
|
if (Array.isArray(e)) {
|
|
2103
2191
|
e.forEach(n);
|
|
@@ -2113,7 +2201,7 @@ function vi(e) {
|
|
|
2113
2201
|
};
|
|
2114
2202
|
return r(e), [...t];
|
|
2115
2203
|
}
|
|
2116
|
-
function
|
|
2204
|
+
function Fi(e) {
|
|
2117
2205
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
2118
2206
|
let n = e.properties?.[t];
|
|
2119
2207
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -2132,7 +2220,7 @@ function yi(e) {
|
|
|
2132
2220
|
};
|
|
2133
2221
|
return r(e), [...t.values()];
|
|
2134
2222
|
}
|
|
2135
|
-
function
|
|
2223
|
+
function Ii({ source: e }) {
|
|
2136
2224
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
|
|
2137
2225
|
...i,
|
|
2138
2226
|
...r
|
|
@@ -2152,7 +2240,7 @@ function bi({ source: e }) {
|
|
|
2152
2240
|
list: !0
|
|
2153
2241
|
}), null;
|
|
2154
2242
|
}
|
|
2155
|
-
function
|
|
2243
|
+
function Li({ name: e }) {
|
|
2156
2244
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = s(() => ({
|
|
2157
2245
|
...i,
|
|
2158
2246
|
...r
|
|
@@ -2166,37 +2254,37 @@ function xi({ name: e }) {
|
|
|
2166
2254
|
list: !0
|
|
2167
2255
|
}), null;
|
|
2168
2256
|
}
|
|
2169
|
-
function
|
|
2170
|
-
let t = s(() =>
|
|
2171
|
-
return /* @__PURE__ */ I(Ve, { children: [t.map((e) => /* @__PURE__ */ F(
|
|
2257
|
+
function Ri({ element: e }) {
|
|
2258
|
+
let t = s(() => Pi(e), [e]), n = s(() => Fi(e), [e]);
|
|
2259
|
+
return /* @__PURE__ */ I(Ve, { children: [t.map((e) => /* @__PURE__ */ F(Li, { name: e }, e)), n.map((e) => /* @__PURE__ */ F(Ii, { source: e }, e.typeName))] });
|
|
2172
2260
|
}
|
|
2173
2261
|
// src/stageThemeChoice.ts
|
|
2174
|
-
var
|
|
2175
|
-
function
|
|
2262
|
+
var zi = "cratis.stage.theme";
|
|
2263
|
+
function Bi() {
|
|
2176
2264
|
try {
|
|
2177
2265
|
return globalThis.localStorage ?? null;
|
|
2178
2266
|
} catch {
|
|
2179
2267
|
return null;
|
|
2180
2268
|
}
|
|
2181
2269
|
}
|
|
2182
|
-
function
|
|
2270
|
+
function Vi() {
|
|
2183
2271
|
try {
|
|
2184
|
-
return
|
|
2272
|
+
return Bi()?.getItem("cratis.stage.theme") || void 0;
|
|
2185
2273
|
} catch {
|
|
2186
2274
|
return;
|
|
2187
2275
|
}
|
|
2188
2276
|
}
|
|
2189
|
-
function
|
|
2277
|
+
function Hi(e) {
|
|
2190
2278
|
try {
|
|
2191
|
-
|
|
2279
|
+
Bi()?.setItem(zi, e);
|
|
2192
2280
|
} catch {}
|
|
2193
2281
|
}
|
|
2194
|
-
function
|
|
2282
|
+
function Ui(e) {
|
|
2195
2283
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2196
2284
|
for (let r of e.flatMap((e) => e.contributions ?? [])) {
|
|
2197
|
-
let e =
|
|
2285
|
+
let e = Gi(r);
|
|
2198
2286
|
if (!e) continue;
|
|
2199
|
-
let i =
|
|
2287
|
+
let i = qi(e);
|
|
2200
2288
|
t.has(i) || (t.add(i), n.push(e));
|
|
2201
2289
|
}
|
|
2202
2290
|
return n.map((e, t) => ({
|
|
@@ -2204,47 +2292,47 @@ function Di(e) {
|
|
|
2204
2292
|
index: t
|
|
2205
2293
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
2206
2294
|
}
|
|
2207
|
-
function
|
|
2295
|
+
function Wi(e) {
|
|
2208
2296
|
let t = {
|
|
2209
2297
|
label: "",
|
|
2210
2298
|
children: []
|
|
2211
2299
|
};
|
|
2212
2300
|
for (let n of e) {
|
|
2213
|
-
let e = n.hierarchy.reduce((e, t) =>
|
|
2214
|
-
(n.group ?
|
|
2301
|
+
let e = n.hierarchy.reduce((e, t) => Ji(e, t, !1), t);
|
|
2302
|
+
(n.group ? Ji(e, n.group, !0) : e).children.push(Yi(n));
|
|
2215
2303
|
}
|
|
2216
2304
|
return t.children;
|
|
2217
2305
|
}
|
|
2218
|
-
function
|
|
2306
|
+
function Gi(e) {
|
|
2219
2307
|
if (e.contributionPointName !== "Navigation") return;
|
|
2220
2308
|
let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
|
|
2221
2309
|
if (typeof n != "string" || typeof r != "string") return;
|
|
2222
|
-
let i =
|
|
2310
|
+
let i = Ki(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
|
|
2223
2311
|
return {
|
|
2224
2312
|
label: n,
|
|
2225
2313
|
targetScreen: r,
|
|
2226
2314
|
hierarchy: i,
|
|
2227
2315
|
order: a,
|
|
2228
|
-
...
|
|
2229
|
-
id:
|
|
2230
|
-
group:
|
|
2231
|
-
icon:
|
|
2232
|
-
presentation:
|
|
2233
|
-
destination:
|
|
2316
|
+
...Zi({
|
|
2317
|
+
id: Xi(t.id),
|
|
2318
|
+
group: Xi(t.group),
|
|
2319
|
+
icon: Xi(t.icon),
|
|
2320
|
+
presentation: Xi(t.presentation),
|
|
2321
|
+
destination: $i(o) && ea(o) ? o : void 0
|
|
2234
2322
|
})
|
|
2235
2323
|
};
|
|
2236
2324
|
}
|
|
2237
|
-
function
|
|
2325
|
+
function Ki(e) {
|
|
2238
2326
|
return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
|
|
2239
2327
|
}
|
|
2240
|
-
function
|
|
2328
|
+
function qi(e) {
|
|
2241
2329
|
return e.id === void 0 ? JSON.stringify([
|
|
2242
2330
|
e.hierarchy,
|
|
2243
2331
|
e.targetScreen,
|
|
2244
2332
|
e.label
|
|
2245
2333
|
]) : JSON.stringify(["id", e.id]);
|
|
2246
2334
|
}
|
|
2247
|
-
function
|
|
2335
|
+
function Ji(e, t, n) {
|
|
2248
2336
|
let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
|
|
2249
2337
|
if (r) return r;
|
|
2250
2338
|
let i = n ? {
|
|
@@ -2257,12 +2345,12 @@ function Mi(e, t, n) {
|
|
|
2257
2345
|
};
|
|
2258
2346
|
return e.children.push(i), i;
|
|
2259
2347
|
}
|
|
2260
|
-
function
|
|
2348
|
+
function Yi(e) {
|
|
2261
2349
|
return {
|
|
2262
2350
|
label: e.label,
|
|
2263
|
-
...
|
|
2351
|
+
...Zi({ id: e.id || void 0 }),
|
|
2264
2352
|
screen: e.targetScreen,
|
|
2265
|
-
...
|
|
2353
|
+
...Zi({
|
|
2266
2354
|
icon: e.icon || void 0,
|
|
2267
2355
|
presentation: e.presentation || void 0,
|
|
2268
2356
|
destination: e.destination
|
|
@@ -2270,27 +2358,27 @@ function Ni(e) {
|
|
|
2270
2358
|
children: []
|
|
2271
2359
|
};
|
|
2272
2360
|
}
|
|
2273
|
-
function
|
|
2361
|
+
function Xi(e) {
|
|
2274
2362
|
return typeof e == "string" ? e : void 0;
|
|
2275
2363
|
}
|
|
2276
|
-
function
|
|
2364
|
+
function Zi(e) {
|
|
2277
2365
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
2278
2366
|
}
|
|
2279
|
-
function
|
|
2367
|
+
function Qi(e, t) {
|
|
2280
2368
|
for (let n of e) {
|
|
2281
2369
|
if (n.screen === t) return [n.label];
|
|
2282
|
-
let e =
|
|
2370
|
+
let e = Qi(n.children, t);
|
|
2283
2371
|
if (e.length > 0) return n.section ? e : [n.label, ...e];
|
|
2284
2372
|
}
|
|
2285
2373
|
return [];
|
|
2286
2374
|
}
|
|
2287
|
-
function
|
|
2375
|
+
function $i(e) {
|
|
2288
2376
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2289
2377
|
}
|
|
2290
|
-
function
|
|
2378
|
+
function ea(e) {
|
|
2291
2379
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
2292
2380
|
}
|
|
2293
|
-
function
|
|
2381
|
+
function ta(e, t, n) {
|
|
2294
2382
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
2295
2383
|
label: e.name,
|
|
2296
2384
|
targetScreen: e.name,
|
|
@@ -2298,30 +2386,30 @@ function zi(e, t, n) {
|
|
|
2298
2386
|
}));
|
|
2299
2387
|
}
|
|
2300
2388
|
// src/blueprint.ts
|
|
2301
|
-
var
|
|
2302
|
-
function
|
|
2303
|
-
return Ne(e).packages.includes(
|
|
2389
|
+
var na = "Stage:locale", ra = "Stage:themeToggle", ia = "Cratis.Components", aa = "PrimeReact", oa = /* @__PURE__ */ new Map();
|
|
2390
|
+
function sa(e) {
|
|
2391
|
+
return Ne(e).packages.includes(aa);
|
|
2304
2392
|
}
|
|
2305
|
-
function
|
|
2306
|
-
|
|
2393
|
+
function ca(e, t) {
|
|
2394
|
+
oa.set(e, t);
|
|
2307
2395
|
}
|
|
2308
|
-
function
|
|
2396
|
+
function la(e) {
|
|
2309
2397
|
let t = Ne(e);
|
|
2310
2398
|
return {
|
|
2311
2399
|
...t,
|
|
2312
2400
|
name: e?.length ? t.name : "Stage",
|
|
2313
2401
|
packages: x(t.packages, {
|
|
2314
|
-
baseline:
|
|
2402
|
+
baseline: ia,
|
|
2315
2403
|
catalog: { [Ee]: g.Blueprint }
|
|
2316
2404
|
})
|
|
2317
2405
|
};
|
|
2318
2406
|
}
|
|
2319
|
-
var
|
|
2407
|
+
var ua = {
|
|
2320
2408
|
...Ce,
|
|
2321
|
-
[
|
|
2409
|
+
[ia]: rt.components
|
|
2322
2410
|
};
|
|
2323
|
-
function
|
|
2324
|
-
let t = [...
|
|
2411
|
+
function da(e) {
|
|
2412
|
+
let t = [...oa.values()].reduce((e, t) => ({
|
|
2325
2413
|
...e,
|
|
2326
2414
|
...t.components
|
|
2327
2415
|
}), {});
|
|
@@ -2334,16 +2422,16 @@ function Yi(e) {
|
|
|
2334
2422
|
...e
|
|
2335
2423
|
};
|
|
2336
2424
|
}
|
|
2337
|
-
function
|
|
2338
|
-
let t = Object.fromEntries([...
|
|
2425
|
+
function fa(e) {
|
|
2426
|
+
let t = Object.fromEntries([...oa].map(([e, t]) => [e, t.declared]));
|
|
2339
2427
|
return {
|
|
2340
2428
|
...e,
|
|
2341
|
-
...
|
|
2429
|
+
...ua,
|
|
2342
2430
|
...t
|
|
2343
2431
|
};
|
|
2344
2432
|
}
|
|
2345
|
-
var
|
|
2346
|
-
function
|
|
2433
|
+
var pa = "Stage:navigationTree";
|
|
2434
|
+
function ma(e, t, n) {
|
|
2347
2435
|
let r = t?.title ?? "Cratis Stage";
|
|
2348
2436
|
return P(e, j.Logo, {
|
|
2349
2437
|
label: r,
|
|
@@ -2354,31 +2442,31 @@ function Qi(e, t, n) {
|
|
|
2354
2442
|
...t?.showName === void 0 ? {} : { showName: t.showName }
|
|
2355
2443
|
});
|
|
2356
2444
|
}
|
|
2357
|
-
function
|
|
2358
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
2445
|
+
function ha(e, t, n, r, i, a = !1, o = !0) {
|
|
2446
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Ui(e), u = ta(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Wi([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => je({
|
|
2359
2447
|
label: e.name,
|
|
2360
2448
|
targetScreen: e.name,
|
|
2361
2449
|
icon: "pi pi-table",
|
|
2362
2450
|
group: "Screens",
|
|
2363
2451
|
order: n
|
|
2364
|
-
}, t)), p =
|
|
2452
|
+
}, t)), p = Qi(Wi(l), t), m = e.find((e) => e.name === t)?.path?.length ? Qi(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? P("menu-hierarchy", pa, {
|
|
2365
2453
|
nodes: d,
|
|
2366
2454
|
activeScreen: t
|
|
2367
2455
|
}) : P("menu-screens", j.Menu, {
|
|
2368
2456
|
title: "Screens",
|
|
2369
2457
|
label: "Screens"
|
|
2370
2458
|
}, { items: f }), _ = [];
|
|
2371
|
-
n.length > 1 && _.push(P("topbar-locale",
|
|
2459
|
+
n.length > 1 && _.push(P("topbar-locale", na, {
|
|
2372
2460
|
locales: n,
|
|
2373
2461
|
locale: r
|
|
2374
|
-
})), _.push(P("topbar-theme",
|
|
2462
|
+
})), _.push(P("topbar-theme", ra, {}));
|
|
2375
2463
|
let v = { regionNavigation: a };
|
|
2376
2464
|
return {
|
|
2377
2465
|
[M.Topbar]: [P("topbar", j.Topbar, v, {
|
|
2378
|
-
logo: [
|
|
2466
|
+
logo: [ma("topbar-logo", i, s)],
|
|
2379
2467
|
end: _
|
|
2380
2468
|
})],
|
|
2381
|
-
[M.Sidebar]: [P("sidebar", j.Sidebar, v, { logo: [
|
|
2469
|
+
[M.Sidebar]: [P("sidebar", j.Sidebar, v, { logo: [ma("sidebar-logo", i, s)] })],
|
|
2382
2470
|
...a ? {} : { [M.Menu]: [g] },
|
|
2383
2471
|
[M.Breadcrumb]: [P("breadcrumb", j.Breadcrumb, {
|
|
2384
2472
|
homeTargetScreen: s,
|
|
@@ -2395,11 +2483,11 @@ function $i(e, t, n, r, i, a = !1, o = !0) {
|
|
|
2395
2483
|
})]
|
|
2396
2484
|
};
|
|
2397
2485
|
}
|
|
2398
|
-
function
|
|
2486
|
+
function ga(e) {
|
|
2399
2487
|
return `#/${encodeURIComponent(e)}`;
|
|
2400
2488
|
}
|
|
2401
2489
|
// src/externalRouteHref.ts
|
|
2402
|
-
function
|
|
2490
|
+
function _a(e) {
|
|
2403
2491
|
try {
|
|
2404
2492
|
let t = new URL(e ?? "");
|
|
2405
2493
|
return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
|
|
@@ -2408,21 +2496,21 @@ function ta(e) {
|
|
|
2408
2496
|
}
|
|
2409
2497
|
}
|
|
2410
2498
|
// src/StageChrome.tsx
|
|
2411
|
-
var
|
|
2499
|
+
var va = t({
|
|
2412
2500
|
locales: [],
|
|
2413
2501
|
locale: "",
|
|
2414
2502
|
setLocale: () => void 0,
|
|
2415
2503
|
activity: ""
|
|
2416
2504
|
});
|
|
2417
|
-
function
|
|
2418
|
-
return /* @__PURE__ */ F(
|
|
2505
|
+
function ya({ state: e, children: t }) {
|
|
2506
|
+
return /* @__PURE__ */ F(va.Provider, {
|
|
2419
2507
|
value: e,
|
|
2420
2508
|
children: t
|
|
2421
2509
|
});
|
|
2422
2510
|
}
|
|
2423
|
-
var
|
|
2424
|
-
function
|
|
2425
|
-
let { locales: e, locale: t, setLocale: n } = i(
|
|
2511
|
+
var ba = "Stage:activity";
|
|
2512
|
+
function xa() {
|
|
2513
|
+
let { locales: e, locale: t, setLocale: n } = i(va);
|
|
2426
2514
|
return e.length < 2 ? null : /* @__PURE__ */ F("select", {
|
|
2427
2515
|
className: "stage-locale",
|
|
2428
2516
|
"aria-label": "Locale",
|
|
@@ -2434,7 +2522,7 @@ function aa() {
|
|
|
2434
2522
|
}, e))
|
|
2435
2523
|
});
|
|
2436
2524
|
}
|
|
2437
|
-
function
|
|
2525
|
+
function Sa({ element: e }) {
|
|
2438
2526
|
let { config: t, setThemeName: n, setColorScheme: r } = Pe(), i = N.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === A.Dark, a = N.find((e) => (e.isDark ?? !1) !== i);
|
|
2439
2527
|
if (!a) return null;
|
|
2440
2528
|
let o = i ? "Switch to a light theme" : "Switch to a dark theme";
|
|
@@ -2447,7 +2535,7 @@ function oa({ element: e }) {
|
|
|
2447
2535
|
"aria-label": o,
|
|
2448
2536
|
title: o,
|
|
2449
2537
|
onClick: () => {
|
|
2450
|
-
|
|
2538
|
+
Hi(a.name), n(a.name), r(a.isDark ? A.Dark : A.Light);
|
|
2451
2539
|
},
|
|
2452
2540
|
children: /* @__PURE__ */ F("svg", {
|
|
2453
2541
|
width: "18",
|
|
@@ -2468,19 +2556,19 @@ function oa({ element: e }) {
|
|
|
2468
2556
|
})
|
|
2469
2557
|
});
|
|
2470
2558
|
}
|
|
2471
|
-
function
|
|
2559
|
+
function Ca({ element: e }) {
|
|
2472
2560
|
let t = e.properties ?? {};
|
|
2473
2561
|
return /* @__PURE__ */ F("nav", {
|
|
2474
2562
|
className: "stage-navigation-tree",
|
|
2475
2563
|
"aria-label": "Navigation",
|
|
2476
2564
|
"data-scene-id": e.id,
|
|
2477
|
-
children: /* @__PURE__ */ F(
|
|
2565
|
+
children: /* @__PURE__ */ F(wa, {
|
|
2478
2566
|
nodes: t.nodes ?? [],
|
|
2479
2567
|
activeScreen: t.activeScreen
|
|
2480
2568
|
})
|
|
2481
2569
|
});
|
|
2482
2570
|
}
|
|
2483
|
-
function
|
|
2571
|
+
function wa({ nodes: e, activeScreen: t }) {
|
|
2484
2572
|
return /* @__PURE__ */ F("ul", {
|
|
2485
2573
|
role: "tree",
|
|
2486
2574
|
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ I("li", {
|
|
@@ -2489,13 +2577,13 @@ function ca({ nodes: e, activeScreen: t }) {
|
|
|
2489
2577
|
children: [/* @__PURE__ */ F("span", {
|
|
2490
2578
|
className: "stage-navigation-group",
|
|
2491
2579
|
children: e.label
|
|
2492
|
-
}), /* @__PURE__ */ F(
|
|
2580
|
+
}), /* @__PURE__ */ F(wa, {
|
|
2493
2581
|
nodes: e.children,
|
|
2494
2582
|
activeScreen: t
|
|
2495
2583
|
})]
|
|
2496
2584
|
}, e.label) : /* @__PURE__ */ F("li", {
|
|
2497
2585
|
role: "treeitem",
|
|
2498
|
-
children: /* @__PURE__ */ F(
|
|
2586
|
+
children: /* @__PURE__ */ F(Ta, {
|
|
2499
2587
|
node: e,
|
|
2500
2588
|
screen: e.screen,
|
|
2501
2589
|
activeScreen: t
|
|
@@ -2503,10 +2591,10 @@ function ca({ nodes: e, activeScreen: t }) {
|
|
|
2503
2591
|
}, `${e.screen}:${e.label}`))
|
|
2504
2592
|
});
|
|
2505
2593
|
}
|
|
2506
|
-
function
|
|
2507
|
-
let r = i(D), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s &&
|
|
2594
|
+
function Ta({ node: e, screen: t, activeScreen: n }) {
|
|
2595
|
+
let r = i(D), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && ea(o) ? (e) => {
|
|
2508
2596
|
e.preventDefault(), r.navigate(o);
|
|
2509
|
-
} : void 0, l = s ?
|
|
2597
|
+
} : void 0, l = s ? _a(o.route) : ga(t), u = s && l === void 0;
|
|
2510
2598
|
return /* @__PURE__ */ I("a", {
|
|
2511
2599
|
href: l,
|
|
2512
2600
|
rel: s && !u ? "noreferrer" : void 0,
|
|
@@ -2523,7 +2611,7 @@ function la({ node: e, screen: t, activeScreen: n }) {
|
|
|
2523
2611
|
}), a !== "icon" && e.label]
|
|
2524
2612
|
});
|
|
2525
2613
|
}
|
|
2526
|
-
function
|
|
2614
|
+
function Ea({ element: e }) {
|
|
2527
2615
|
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(D), r = ve(), a = z(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
|
|
2528
2616
|
return /* @__PURE__ */ I("div", {
|
|
2529
2617
|
"data-scene-outlet": t,
|
|
@@ -2537,7 +2625,7 @@ function ua({ element: e }) {
|
|
|
2537
2625
|
onClick: () => n?.closeOutlet(t),
|
|
2538
2626
|
children: "Close"
|
|
2539
2627
|
})
|
|
2540
|
-
}), s && r && /* @__PURE__ */ F(
|
|
2628
|
+
}), s && r && /* @__PURE__ */ F(Yn, {
|
|
2541
2629
|
element: s,
|
|
2542
2630
|
children: /* @__PURE__ */ F(ae, {
|
|
2543
2631
|
element: s,
|
|
@@ -2547,15 +2635,15 @@ function ua({ element: e }) {
|
|
|
2547
2635
|
})]
|
|
2548
2636
|
});
|
|
2549
2637
|
}
|
|
2550
|
-
function
|
|
2551
|
-
let { activity: e } = i(
|
|
2638
|
+
function Da() {
|
|
2639
|
+
let { activity: e } = i(va);
|
|
2552
2640
|
return e ? /* @__PURE__ */ F("p", {
|
|
2553
2641
|
className: "stage-activity",
|
|
2554
2642
|
role: "status",
|
|
2555
2643
|
children: e
|
|
2556
2644
|
}) : null;
|
|
2557
2645
|
}
|
|
2558
|
-
function
|
|
2646
|
+
function Oa() {
|
|
2559
2647
|
let e = ye(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2560
2648
|
return a(() => {
|
|
2561
2649
|
let r = e?.isDark ? "dark" : "light";
|
|
@@ -2566,24 +2654,24 @@ function fa() {
|
|
|
2566
2654
|
n
|
|
2567
2655
|
]), null;
|
|
2568
2656
|
}
|
|
2569
|
-
var
|
|
2570
|
-
[
|
|
2571
|
-
[
|
|
2572
|
-
[
|
|
2573
|
-
[
|
|
2574
|
-
"core:outlet":
|
|
2575
|
-
},
|
|
2657
|
+
var ka = {
|
|
2658
|
+
[na]: xa,
|
|
2659
|
+
[ra]: Sa,
|
|
2660
|
+
[pa]: Ca,
|
|
2661
|
+
[ba]: Da,
|
|
2662
|
+
"core:outlet": Ea
|
|
2663
|
+
}, Aa = [
|
|
2576
2664
|
"navigationMode",
|
|
2577
2665
|
"menuTheme",
|
|
2578
2666
|
"showFooter"
|
|
2579
|
-
],
|
|
2580
|
-
function
|
|
2667
|
+
], ja = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2668
|
+
function Ma(e, t, n = !1) {
|
|
2581
2669
|
let r = [], i = t.options ?? {}, a = {
|
|
2582
2670
|
showFooter: !0,
|
|
2583
2671
|
followsSystem: !1,
|
|
2584
2672
|
problems: r
|
|
2585
2673
|
};
|
|
2586
|
-
for (let [e, n] of Object.entries(i)) if (!
|
|
2674
|
+
for (let [e, n] of Object.entries(i)) if (!Aa.includes(e)) r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Aa.join(", ")}.`);
|
|
2587
2675
|
else if (e === "navigationMode") {
|
|
2588
2676
|
let e = ke.find((e) => e === n);
|
|
2589
2677
|
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ke.join(", ")}.`);
|
|
@@ -2597,9 +2685,9 @@ function ga(e, t, n = !1) {
|
|
|
2597
2685
|
let e = a.followsSystem ? n : o.colorScheme === u.Dark;
|
|
2598
2686
|
a.colorScheme = e ? A.Dark : A.Light, a.themeName = N.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2599
2687
|
}
|
|
2600
|
-
return o?.accent !== void 0 && (
|
|
2688
|
+
return o?.accent !== void 0 && (ja.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
|
|
2601
2689
|
}
|
|
2602
|
-
function
|
|
2690
|
+
function Na(e, t) {
|
|
2603
2691
|
if (e?.root === void 0) return [];
|
|
2604
2692
|
let n = /* @__PURE__ */ new Set([
|
|
2605
2693
|
v.RootTemplateUnknown,
|
|
@@ -2611,7 +2699,7 @@ function _a(e, t) {
|
|
|
2611
2699
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2612
2700
|
return r.length === 0 && t.origin !== y.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
|
|
2613
2701
|
}
|
|
2614
|
-
function
|
|
2702
|
+
function Pa(e) {
|
|
2615
2703
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2616
2704
|
0,
|
|
2617
2705
|
2,
|
|
@@ -2619,7 +2707,7 @@ function va(e) {
|
|
|
2619
2707
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2620
2708
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2621
2709
|
}
|
|
2622
|
-
function
|
|
2710
|
+
function Fa(e, t) {
|
|
2623
2711
|
if (t === void 0) return e;
|
|
2624
2712
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2625
2713
|
0,
|
|
@@ -2631,24 +2719,24 @@ function ya(e, t) {
|
|
|
2631
2719
|
tokens: {
|
|
2632
2720
|
...e.tokens,
|
|
2633
2721
|
"primary.color": t,
|
|
2634
|
-
"primary.contrastColor":
|
|
2722
|
+
"primary.contrastColor": Pa(t),
|
|
2635
2723
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2636
2724
|
}
|
|
2637
2725
|
}));
|
|
2638
2726
|
}
|
|
2639
2727
|
// src/StageShellSettings.tsx
|
|
2640
|
-
var
|
|
2641
|
-
function
|
|
2728
|
+
var Ia = "(prefers-color-scheme: dark)";
|
|
2729
|
+
function La() {
|
|
2642
2730
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2643
2731
|
}
|
|
2644
|
-
function
|
|
2732
|
+
function Ra({ settings: e, onSystemSchemeChange: t }) {
|
|
2645
2733
|
let n = c(Pe());
|
|
2646
2734
|
n.current = Pe();
|
|
2647
2735
|
let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
|
|
2648
2736
|
return a(() => {
|
|
2649
2737
|
let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
|
|
2650
2738
|
r !== void 0 && e(r), i !== void 0 && t(i);
|
|
2651
|
-
let l = N.find((e) => e.name ===
|
|
2739
|
+
let l = N.find((e) => e.name === Vi());
|
|
2652
2740
|
l ? (c(l.name), a(l.isDark ? A.Dark : A.Light)) : (o !== void 0 && a(o), s !== void 0 && c(s));
|
|
2653
2741
|
}, [
|
|
2654
2742
|
r,
|
|
@@ -2657,15 +2745,15 @@ function Sa({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2657
2745
|
s
|
|
2658
2746
|
]), a(() => {
|
|
2659
2747
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2660
|
-
let n = globalThis.matchMedia(
|
|
2748
|
+
let n = globalThis.matchMedia(Ia), r = (e) => t(e.matches);
|
|
2661
2749
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2662
2750
|
}, [e.followsSystem, t]), null;
|
|
2663
2751
|
}
|
|
2664
2752
|
// src/stageNavigationModel.ts
|
|
2665
|
-
function
|
|
2753
|
+
function za(e) {
|
|
2666
2754
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2667
2755
|
}
|
|
2668
|
-
function
|
|
2756
|
+
function Ba(e) {
|
|
2669
2757
|
let t = /* @__PURE__ */ new Map();
|
|
2670
2758
|
for (let n of e) {
|
|
2671
2759
|
let e = (n.path ?? []).join(".");
|
|
@@ -2678,41 +2766,41 @@ function wa(e) {
|
|
|
2678
2766
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2679
2767
|
};
|
|
2680
2768
|
}
|
|
2681
|
-
function
|
|
2769
|
+
function Va(e) {
|
|
2682
2770
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2683
2771
|
}
|
|
2684
|
-
function
|
|
2772
|
+
function Ha(e, t, n) {
|
|
2685
2773
|
let r = e.navigation ?? {
|
|
2686
2774
|
application: { regions: [] },
|
|
2687
2775
|
modules: []
|
|
2688
2776
|
};
|
|
2689
2777
|
return {
|
|
2690
2778
|
structure: e.structure ?? { modules: [] },
|
|
2691
|
-
navigation: n ?
|
|
2692
|
-
screenFor:
|
|
2693
|
-
moduleOf:
|
|
2779
|
+
navigation: n ? Ua(r, n) : r,
|
|
2780
|
+
screenFor: Ba(e.screens),
|
|
2781
|
+
moduleOf: Va(e.screens),
|
|
2694
2782
|
...t ? { isVisible: t } : {}
|
|
2695
2783
|
};
|
|
2696
2784
|
}
|
|
2697
|
-
function
|
|
2698
|
-
return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) =>
|
|
2785
|
+
function Ua(e, t) {
|
|
2786
|
+
return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) => Ua(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Ua(n, t)])) : e;
|
|
2699
2787
|
}
|
|
2700
2788
|
// src/stageSlices.ts
|
|
2701
|
-
function
|
|
2702
|
-
return (t) =>
|
|
2789
|
+
function Wa(e) {
|
|
2790
|
+
return (t) => U(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2703
2791
|
name: e.name,
|
|
2704
2792
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2705
|
-
label:
|
|
2793
|
+
label: Ga(e.name),
|
|
2706
2794
|
required: e.required
|
|
2707
2795
|
}));
|
|
2708
2796
|
}
|
|
2709
|
-
function
|
|
2797
|
+
function Ga(e) {
|
|
2710
2798
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2711
2799
|
}
|
|
2712
|
-
function
|
|
2800
|
+
function Ka(e, t, n) {
|
|
2713
2801
|
return { invoke: async (r, i, a) => {
|
|
2714
2802
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2715
|
-
if (!
|
|
2803
|
+
if (!G(o)) return {
|
|
2716
2804
|
succeeded: !1,
|
|
2717
2805
|
message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
|
|
2718
2806
|
};
|
|
@@ -2729,7 +2817,7 @@ function Aa(e, t, n) {
|
|
|
2729
2817
|
} };
|
|
2730
2818
|
}
|
|
2731
2819
|
// src/withoutSeededSlots.ts
|
|
2732
|
-
function
|
|
2820
|
+
function qa(e, t) {
|
|
2733
2821
|
let n = /* @__PURE__ */ new Map();
|
|
2734
2822
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2735
2823
|
return e.map((e) => {
|
|
@@ -2746,7 +2834,7 @@ function ja(e, t) {
|
|
|
2746
2834
|
});
|
|
2747
2835
|
}
|
|
2748
2836
|
// src/stageIcons.ts
|
|
2749
|
-
var
|
|
2837
|
+
var Ja = /* @__PURE__ */ new Map([
|
|
2750
2838
|
["chart", "chart-column"],
|
|
2751
2839
|
["add", "plus"],
|
|
2752
2840
|
["dollar", "dollar-sign"],
|
|
@@ -2754,23 +2842,23 @@ var Ma = /* @__PURE__ */ new Map([
|
|
|
2754
2842
|
["refresh", "refresh-cw"],
|
|
2755
2843
|
["invoice", "receipt-text"],
|
|
2756
2844
|
["batch", "layers"]
|
|
2757
|
-
]),
|
|
2845
|
+
]), Ya = (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(), Xa = pe([{
|
|
2758
2846
|
library: _,
|
|
2759
2847
|
loadGlyph: async ({ key: e }) => {
|
|
2760
|
-
let t =
|
|
2848
|
+
let t = Ya(e), n = Ja.get(t) ?? t;
|
|
2761
2849
|
if (Object.hasOwn(it, n)) return (await it[n]())?.default;
|
|
2762
2850
|
}
|
|
2763
2851
|
}]);
|
|
2764
2852
|
// src/App.tsx
|
|
2765
|
-
function
|
|
2766
|
-
return
|
|
2853
|
+
function Za(e = {}) {
|
|
2854
|
+
return da({
|
|
2767
2855
|
...e,
|
|
2768
|
-
...
|
|
2769
|
-
...
|
|
2856
|
+
...Di,
|
|
2857
|
+
...ka
|
|
2770
2858
|
});
|
|
2771
2859
|
}
|
|
2772
|
-
function
|
|
2773
|
-
return P(`form-${e}-${t.name}`,
|
|
2860
|
+
function Qa(e, t) {
|
|
2861
|
+
return P(`form-${e}-${t.name}`, li, {
|
|
2774
2862
|
command: t.forCommand,
|
|
2775
2863
|
label: t.name,
|
|
2776
2864
|
generationMode: t.generationMode,
|
|
@@ -2778,36 +2866,36 @@ function Ia(e, t) {
|
|
|
2778
2866
|
fields: t.fields
|
|
2779
2867
|
});
|
|
2780
2868
|
}
|
|
2781
|
-
function
|
|
2869
|
+
function $a(e, t) {
|
|
2782
2870
|
let n = e.screens[0];
|
|
2783
2871
|
return De(e, n, {
|
|
2784
|
-
profile:
|
|
2872
|
+
profile: la(e.uiProfiles),
|
|
2785
2873
|
blueprintTemplates: t?.length ? [...Oe, ...t] : Oe
|
|
2786
2874
|
});
|
|
2787
2875
|
}
|
|
2788
|
-
function
|
|
2789
|
-
let s =
|
|
2876
|
+
function eo(e, t, n, r, i, a, o = !0) {
|
|
2877
|
+
let s = za(e.navigation), c = to(e);
|
|
2790
2878
|
return {
|
|
2791
|
-
profile:
|
|
2792
|
-
catalog:
|
|
2879
|
+
profile: la(e.uiProfiles),
|
|
2880
|
+
catalog: fa(r),
|
|
2793
2881
|
blueprintTemplates: a?.length ? [...Oe, ...a] : Oe,
|
|
2794
2882
|
namedTemplateOnly: !0,
|
|
2795
|
-
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]:
|
|
2796
|
-
form:
|
|
2797
|
-
trailing: [P("activity",
|
|
2883
|
+
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: ha(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : ha(e.screens, r.name, t, n, c, s, o),
|
|
2884
|
+
form: Qa,
|
|
2885
|
+
trailing: [P("activity", ba)],
|
|
2798
2886
|
decorate: (e) => {
|
|
2799
|
-
let t =
|
|
2887
|
+
let t = Ai(e);
|
|
2800
2888
|
return i ? w(t, i) : t;
|
|
2801
2889
|
}
|
|
2802
2890
|
};
|
|
2803
2891
|
}
|
|
2804
|
-
function
|
|
2892
|
+
function to(e) {
|
|
2805
2893
|
let t = e.navigation?.application.logo;
|
|
2806
2894
|
if (t) return {
|
|
2807
2895
|
title: t.title,
|
|
2808
2896
|
image: t.image || void 0
|
|
2809
2897
|
};
|
|
2810
|
-
let n =
|
|
2898
|
+
let n = la(e.uiProfiles).identity;
|
|
2811
2899
|
if (!n?.name) return;
|
|
2812
2900
|
let r = n.logo;
|
|
2813
2901
|
return {
|
|
@@ -2817,22 +2905,22 @@ function za(e) {
|
|
|
2817
2905
|
showName: n.showName
|
|
2818
2906
|
};
|
|
2819
2907
|
}
|
|
2820
|
-
function
|
|
2821
|
-
let [o] =
|
|
2822
|
-
return we(e, o,
|
|
2908
|
+
function no(e, t, n, r, i, a) {
|
|
2909
|
+
let [o] = Kr([t], ro(e));
|
|
2910
|
+
return we(e, o, eo(e, n, r, i, void 0, a)).element;
|
|
2823
2911
|
}
|
|
2824
|
-
function
|
|
2912
|
+
function ro(e) {
|
|
2825
2913
|
return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
|
|
2826
2914
|
}
|
|
2827
|
-
function
|
|
2915
|
+
function io() {
|
|
2828
2916
|
try {
|
|
2829
2917
|
return globalThis.localStorage ?? null;
|
|
2830
2918
|
} catch {
|
|
2831
2919
|
return null;
|
|
2832
2920
|
}
|
|
2833
2921
|
}
|
|
2834
|
-
function
|
|
2835
|
-
let c = lt(), [u, d] = l(), [f, p] = l(""), m = s(() =>
|
|
2922
|
+
function ao({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
|
|
2923
|
+
let c = lt(), [u, d] = l(), [f, p] = l(""), m = s(() => Za(e), [e, u]), h = ut(), g = Oi();
|
|
2836
2924
|
return a(() => {
|
|
2837
2925
|
let e = new AbortController();
|
|
2838
2926
|
return c.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2844,7 +2932,7 @@ function Ua({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2844
2932
|
}, [c, r]), f ? /* @__PURE__ */ I("main", {
|
|
2845
2933
|
className: "stage-message",
|
|
2846
2934
|
children: [/* @__PURE__ */ F("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ F("p", { children: f })]
|
|
2847
|
-
}) : u ? /* @__PURE__ */ F(
|
|
2935
|
+
}) : u ? /* @__PURE__ */ F(oo, {
|
|
2848
2936
|
scene: u,
|
|
2849
2937
|
registry: m,
|
|
2850
2938
|
routing: o,
|
|
@@ -2858,20 +2946,20 @@ function Ua({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2858
2946
|
children: /* @__PURE__ */ F("h1", { children: "Preparing the Stage" })
|
|
2859
2947
|
});
|
|
2860
2948
|
}
|
|
2861
|
-
function
|
|
2949
|
+
function oo({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
|
|
2862
2950
|
let d = s(() => {
|
|
2863
|
-
if (
|
|
2951
|
+
if (In(n), n === "hash") return k();
|
|
2864
2952
|
let e = /^#\/(.+)$/.exec(globalThis.location.hash);
|
|
2865
2953
|
return e && globalThis.history.replaceState(null, "", `/${e[1]}`), fe(window, "/");
|
|
2866
|
-
}, [n]), [f, p] = l(
|
|
2954
|
+
}, [n]), [f, p] = l(La), m = e.screens[0]?.name ?? "", h = s(() => la(e.uiProfiles), [e]), g = s(() => m ? $a(e, c) : void 0, [
|
|
2867
2955
|
e,
|
|
2868
2956
|
c,
|
|
2869
2957
|
m
|
|
2870
|
-
]), _ = s(() => g ?
|
|
2958
|
+
]), _ = s(() => g ? Na(h, g) : [], [h, g]), v = s(() => g ? Ma(h, g, f) : void 0, [
|
|
2871
2959
|
h,
|
|
2872
2960
|
g,
|
|
2873
2961
|
f
|
|
2874
|
-
]), y = s(() =>
|
|
2962
|
+
]), y = s(() => Fa(N, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => eo(e, a.locales, a.locale, o, a.dictionary, c, b), [
|
|
2875
2963
|
e,
|
|
2876
2964
|
a.locales,
|
|
2877
2965
|
a.locale,
|
|
@@ -2879,18 +2967,18 @@ function Wa({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
2879
2967
|
o,
|
|
2880
2968
|
c,
|
|
2881
2969
|
b
|
|
2882
|
-
]), S = r((e) => p(e), []), C = s(() =>
|
|
2970
|
+
]), S = r((e) => p(e), []), C = s(() => Ha(e, u, a.dictionary), [
|
|
2883
2971
|
e,
|
|
2884
2972
|
u,
|
|
2885
2973
|
a.dictionary
|
|
2886
2974
|
]), w = s(() => ({
|
|
2887
2975
|
...e,
|
|
2888
|
-
screens:
|
|
2976
|
+
screens: Kr(qa(e.screens, [
|
|
2889
2977
|
...e.screenTemplates,
|
|
2890
2978
|
...e.dialogTemplates ?? [],
|
|
2891
2979
|
...Oe,
|
|
2892
2980
|
...c ?? []
|
|
2893
|
-
]),
|
|
2981
|
+
]), ro(e))
|
|
2894
2982
|
}), [e, c]);
|
|
2895
2983
|
return m ? _.length > 0 ? /* @__PURE__ */ I("main", {
|
|
2896
2984
|
className: "stage-message",
|
|
@@ -2908,8 +2996,8 @@ function Wa({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
2908
2996
|
registry: t,
|
|
2909
2997
|
initialScreen: m,
|
|
2910
2998
|
history: d,
|
|
2911
|
-
layoutConfigStorage:
|
|
2912
|
-
scope: (t, n) => /* @__PURE__ */ F(
|
|
2999
|
+
layoutConfigStorage: io(),
|
|
3000
|
+
scope: (t, n) => /* @__PURE__ */ F(so, {
|
|
2913
3001
|
scene: e,
|
|
2914
3002
|
routeState: i,
|
|
2915
3003
|
strings: a,
|
|
@@ -2919,13 +3007,13 @@ function Wa({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
2919
3007
|
onSystemSchemeChange: S,
|
|
2920
3008
|
children: n
|
|
2921
3009
|
}),
|
|
2922
|
-
renderScreen: (e, n) => /* @__PURE__ */ F(
|
|
3010
|
+
renderScreen: (e, n) => /* @__PURE__ */ F(lo, {
|
|
2923
3011
|
element: e,
|
|
2924
3012
|
configuration: n,
|
|
2925
3013
|
registry: t
|
|
2926
3014
|
}),
|
|
2927
|
-
renderDialog: () => /* @__PURE__ */ F(
|
|
2928
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(
|
|
3015
|
+
renderDialog: () => /* @__PURE__ */ F(Si, {}),
|
|
3016
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(uo, {
|
|
2929
3017
|
template: e,
|
|
2930
3018
|
content: n,
|
|
2931
3019
|
registry: t,
|
|
@@ -2937,7 +3025,7 @@ function Wa({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
2937
3025
|
children: [/* @__PURE__ */ F("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ F("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
2938
3026
|
});
|
|
2939
3027
|
}
|
|
2940
|
-
function
|
|
3028
|
+
function so({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
|
|
2941
3029
|
let [u, f] = l(""), { navigate: p } = r;
|
|
2942
3030
|
return a(() => f(""), [r.currentScreen, r.currentDialog]), a(() => {
|
|
2943
3031
|
let e = (e) => {
|
|
@@ -2955,15 +3043,15 @@ function Ga({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
2955
3043
|
};
|
|
2956
3044
|
return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
|
|
2957
3045
|
}, [p, e]), /* @__PURE__ */ F(re, {
|
|
2958
|
-
registry:
|
|
3046
|
+
registry: Xa,
|
|
2959
3047
|
children: /* @__PURE__ */ I(Se, {
|
|
2960
3048
|
themes: i,
|
|
2961
3049
|
children: [
|
|
2962
|
-
o && /* @__PURE__ */ F(
|
|
3050
|
+
o && /* @__PURE__ */ F(Ra, {
|
|
2963
3051
|
settings: o,
|
|
2964
3052
|
onSystemSchemeChange: s
|
|
2965
3053
|
}),
|
|
2966
|
-
/* @__PURE__ */ F(
|
|
3054
|
+
/* @__PURE__ */ F(Oa, {}),
|
|
2967
3055
|
/* @__PURE__ */ F(Wt, {
|
|
2968
3056
|
routes: t.routes,
|
|
2969
3057
|
routesReady: t.ready,
|
|
@@ -2971,7 +3059,7 @@ function Ga({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
2971
3059
|
locale: n.locale,
|
|
2972
3060
|
locales: n.locales,
|
|
2973
3061
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2974
|
-
children: /* @__PURE__ */ F(
|
|
3062
|
+
children: /* @__PURE__ */ F(co, {
|
|
2975
3063
|
activity: u,
|
|
2976
3064
|
routesReady: t.ready,
|
|
2977
3065
|
scene: e,
|
|
@@ -2984,14 +3072,14 @@ function Ga({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
2984
3072
|
})
|
|
2985
3073
|
});
|
|
2986
3074
|
}
|
|
2987
|
-
function
|
|
2988
|
-
let o = z(), c = _e(), l =
|
|
3075
|
+
function co({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
3076
|
+
let o = z(), c = _e(), l = Nn(), u = s(() => Ka(l, t, o.refreshAfterCommand), [
|
|
2989
3077
|
l,
|
|
2990
3078
|
t,
|
|
2991
3079
|
o.refreshAfterCommand
|
|
2992
|
-
]), f = s(() =>
|
|
3080
|
+
]), f = s(() => Wa(n.commandSchemas), [n.commandSchemas]), p = de({
|
|
2993
3081
|
executeCommand: async (e, n) => {
|
|
2994
|
-
let i =
|
|
3082
|
+
let i = G(e);
|
|
2995
3083
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
2996
3084
|
isSuccess: !1,
|
|
2997
3085
|
validationErrors: []
|
|
@@ -3008,7 +3096,7 @@ function Ka({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3008
3096
|
};
|
|
3009
3097
|
},
|
|
3010
3098
|
navigate: (e, t) => {
|
|
3011
|
-
n.screens.some((t) => t.name === e) ?
|
|
3099
|
+
n.screens.some((t) => t.name === e) ? K(e, Rn(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
3012
3100
|
},
|
|
3013
3101
|
navigateBack: () => globalThis.history?.back(),
|
|
3014
3102
|
openDialog: async (e) => {
|
|
@@ -3025,7 +3113,7 @@ function Ka({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3025
3113
|
refreshQuery: async (e) => o.refreshQuery(e),
|
|
3026
3114
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
3027
3115
|
});
|
|
3028
|
-
return /* @__PURE__ */ F(
|
|
3116
|
+
return /* @__PURE__ */ F(ya, {
|
|
3029
3117
|
state: {
|
|
3030
3118
|
locales: i.locales,
|
|
3031
3119
|
locale: i.locale,
|
|
@@ -3050,11 +3138,11 @@ function Ka({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3050
3138
|
})
|
|
3051
3139
|
});
|
|
3052
3140
|
}
|
|
3053
|
-
function
|
|
3141
|
+
function lo({ element: e, configuration: t, registry: n }) {
|
|
3054
3142
|
let r = z(), i = nn();
|
|
3055
|
-
return /* @__PURE__ */ I(
|
|
3143
|
+
return /* @__PURE__ */ I(Yn, {
|
|
3056
3144
|
element: e,
|
|
3057
|
-
children: [/* @__PURE__ */ F(
|
|
3145
|
+
children: [/* @__PURE__ */ F(Ri, { element: e }), /* @__PURE__ */ F(ae, {
|
|
3058
3146
|
element: e,
|
|
3059
3147
|
registry: n,
|
|
3060
3148
|
resolveBinding: r.resolveBinding,
|
|
@@ -3064,7 +3152,7 @@ function qa({ element: e, configuration: t, registry: n }) {
|
|
|
3064
3152
|
})]
|
|
3065
3153
|
});
|
|
3066
3154
|
}
|
|
3067
|
-
function
|
|
3155
|
+
function uo({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
3068
3156
|
let o = z(), s = nn(), c = w(t, r.dictionary);
|
|
3069
3157
|
return a(() => {
|
|
3070
3158
|
let e = (e) => {
|
|
@@ -3082,7 +3170,7 @@ function Ja({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
|
3082
3170
|
type: "button",
|
|
3083
3171
|
onClick: i,
|
|
3084
3172
|
children: "Close"
|
|
3085
|
-
}), /* @__PURE__ */ F(
|
|
3173
|
+
}), /* @__PURE__ */ F(Yn, {
|
|
3086
3174
|
element: c,
|
|
3087
3175
|
children: /* @__PURE__ */ F(ae, {
|
|
3088
3176
|
element: c,
|
|
@@ -3095,4 +3183,4 @@ function Ja({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
|
3095
3183
|
})
|
|
3096
3184
|
});
|
|
3097
3185
|
}
|
|
3098
|
-
export {
|
|
3186
|
+
export { ao as App, ao as StageApplication, $n as StageCommandForm, Wt as StageDataProvider, Hr as StageGuardedAction, ct as StageSourceProvider, no as composeStageScreen, Ka as createStageSliceInvoker, Gt as dataChanged, jn as executeRegisteredCommand, ht as hostedBasePath, sa as listsPrimeReact, St as performQuery, vt as registerQueryRouteResolver, ca as registerStageLibrary, G as registeredCommand, yt as registeredQuery, Wa as sliceFieldsFrom, Za as stageApplicationRegistry, eo as stageComposition, e as stageDarkSelector, ot as stageEndpoints, $a as stageShellOf, at as staticStageSource, Ct as subscribeQuery, Nn as useStageCommandExecutor, z as useStageData, B as useStageQuery, lt as useStageSource };
|