@cratis/stage.runtime 4.187.1 → 4.187.2
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/commandExecutor.d.ts +7 -0
- package/dist/src/index.js +389 -385
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -8,16 +8,16 @@ import "@cratis/scene.blueprint.default/styles.css";
|
|
|
8
8
|
import { Globals as Te } from "@cratis/arc";
|
|
9
9
|
import { ServerSentEventQueryConnection as Ee } from "@cratis/arc/queries";
|
|
10
10
|
import { Fragment as De, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
|
-
import { Button as
|
|
12
|
-
import { PrimeDialog as
|
|
13
|
-
import { ArcContext as
|
|
14
|
-
import { Command as
|
|
15
|
-
import { resolveCommand as
|
|
16
|
-
import { CommandForm as
|
|
17
|
-
import { CalendarField as
|
|
18
|
-
import
|
|
11
|
+
import { Button as Oe } from "primereact/button";
|
|
12
|
+
import { PrimeDialog as ke, PrimeMessage as Ae, primeReactComponents as je, primeReactPackageManifest as Me } from "@cratis/scene.primereact";
|
|
13
|
+
import { ArcContext as Ne } from "@cratis/arc.react";
|
|
14
|
+
import { Command as Pe } from "@cratis/arc/commands";
|
|
15
|
+
import { resolveCommand as Fe } from "@cratis/scene.components";
|
|
16
|
+
import { CommandForm as Ie, asCommandFormField as Le } from "@cratis/arc.react/commands";
|
|
17
|
+
import { CalendarField as Re, CheckboxField as ze, DropdownField as Be, InputTextField as Ve, NumberField as He } from "@cratis/components/CommandForm";
|
|
18
|
+
import Ue from "@primeuix/themes/lara";
|
|
19
19
|
//#region src/stageSource.ts
|
|
20
|
-
function
|
|
20
|
+
function We(e) {
|
|
21
21
|
return {
|
|
22
22
|
scene: async () => e.scene,
|
|
23
23
|
routes: async () => e.routes,
|
|
@@ -25,23 +25,23 @@ function Ue(e) {
|
|
|
25
25
|
strings: async (t) => e.strings[t] ?? {}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var Ge = {
|
|
29
29
|
scene: "stage/scene",
|
|
30
30
|
routes: "stage/routes",
|
|
31
31
|
locales: "stage/locales",
|
|
32
32
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
33
|
-
},
|
|
34
|
-
function
|
|
35
|
-
return t(
|
|
33
|
+
}, Ke = e(void 0);
|
|
34
|
+
function qe({ source: e, children: n }) {
|
|
35
|
+
return t(Ke.Provider, { value: e }, n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let e = r(
|
|
37
|
+
function I() {
|
|
38
|
+
let e = r(Ke);
|
|
39
39
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
let e =
|
|
42
|
+
Ge.routes;
|
|
43
|
+
function Je() {
|
|
44
|
+
let e = I(), [t, n] = c({
|
|
45
45
|
routes: void 0,
|
|
46
46
|
ready: !1
|
|
47
47
|
});
|
|
@@ -60,35 +60,35 @@ function qe() {
|
|
|
60
60
|
}), () => t.abort();
|
|
61
61
|
}, [e]), t;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
63
|
+
function Ye(e) {
|
|
64
|
+
if (L(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
66
|
+
var Xe = "STAGE-SCENE-ACTION-001", Ze = "item.";
|
|
67
|
+
function L(e) {
|
|
68
68
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Qe(e, t) {
|
|
71
71
|
let n = e;
|
|
72
72
|
for (let e of t.split(".").filter(Boolean)) {
|
|
73
|
-
if (!
|
|
73
|
+
if (!L(n)) return;
|
|
74
74
|
n = n[e];
|
|
75
75
|
}
|
|
76
76
|
return n;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function $e(e) {
|
|
79
79
|
return e === null || [
|
|
80
80
|
"string",
|
|
81
81
|
"number",
|
|
82
82
|
"boolean"
|
|
83
83
|
].includes(typeof e);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function et(e, t) {
|
|
86
86
|
if (typeof e == "number") return t[e];
|
|
87
87
|
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function tt(e, t, n, r) {
|
|
90
90
|
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
91
|
-
let i =
|
|
91
|
+
let i = et(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
92
92
|
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
93
93
|
}
|
|
94
94
|
switch (t) {
|
|
@@ -103,28 +103,28 @@ function et(e, t, n, r) {
|
|
|
103
103
|
default: return;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
106
|
+
function R(e, t) {
|
|
107
|
+
if (L(e)) {
|
|
108
108
|
if (e.kind === "comparison") {
|
|
109
|
-
let n =
|
|
110
|
-
if (typeof n != "string" || !n.startsWith(
|
|
109
|
+
let n = Ye(e.left);
|
|
110
|
+
if (typeof n != "string" || !n.startsWith(Ze) || typeof e.operator != "string" || !$e(e.right)) return;
|
|
111
111
|
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
112
|
-
return
|
|
112
|
+
return tt(Qe(t, n.slice(5)), e.operator, e.right, r);
|
|
113
113
|
}
|
|
114
114
|
if (e.kind === "logical") {
|
|
115
|
-
let n =
|
|
115
|
+
let n = R(e.left, t), r = R(e.right, t);
|
|
116
116
|
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
function nt(e) {
|
|
121
|
-
return e.every((e) =>
|
|
121
|
+
return e.every((e) => R(e, {}) !== void 0);
|
|
122
122
|
}
|
|
123
123
|
function rt(e, t) {
|
|
124
|
-
if (nt(e)) return e.findIndex((e) =>
|
|
124
|
+
if (nt(e)) return e.findIndex((e) => R(e, t) === !0);
|
|
125
125
|
}
|
|
126
126
|
function it(e, t) {
|
|
127
|
-
if (!
|
|
127
|
+
if (!L(e) || !Array.isArray(e.alternatives) || !L(t)) return;
|
|
128
128
|
let n = rt(e.alternatives, t);
|
|
129
129
|
if (n !== void 0) {
|
|
130
130
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
@@ -132,7 +132,7 @@ function it(e, t) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
function at(e, t) {
|
|
135
|
-
if (e.startsWith(
|
|
135
|
+
if (e.startsWith(Ze) && L(t)) return Qe(t, e.slice(5));
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/stageSession.ts
|
|
@@ -573,12 +573,12 @@ function U(e, t, n) {
|
|
|
573
573
|
e
|
|
574
574
|
]) {
|
|
575
575
|
if (!r) continue;
|
|
576
|
-
let t =
|
|
576
|
+
let t = Fe(r);
|
|
577
577
|
if (Mt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
function Mt(e) {
|
|
581
|
-
return typeof e == "function" && e.prototype instanceof
|
|
581
|
+
return typeof e == "function" && e.prototype instanceof Pe;
|
|
582
582
|
}
|
|
583
583
|
function Nt() {
|
|
584
584
|
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
@@ -589,7 +589,10 @@ function Nt() {
|
|
|
589
589
|
return "";
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
|
|
592
|
+
function Pt(e, t) {
|
|
593
|
+
return e.setApiBasePath(t || Nt()), e;
|
|
594
|
+
}
|
|
595
|
+
async function Ft(e, t, n) {
|
|
593
596
|
let r = U(e);
|
|
594
597
|
if (!r) return {
|
|
595
598
|
isSuccess: !1,
|
|
@@ -599,9 +602,9 @@ async function Pt(e, t, n) {
|
|
|
599
602
|
let i = new r();
|
|
600
603
|
i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath || Nt()), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
601
604
|
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
602
|
-
return
|
|
605
|
+
return It(e, await i.execute());
|
|
603
606
|
}
|
|
604
|
-
function
|
|
607
|
+
function It(e, t) {
|
|
605
608
|
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) => ({
|
|
606
609
|
member: t,
|
|
607
610
|
message: e.message
|
|
@@ -617,53 +620,53 @@ function Ft(e, t) {
|
|
|
617
620
|
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
618
621
|
};
|
|
619
622
|
}
|
|
620
|
-
function
|
|
621
|
-
let e = r(
|
|
622
|
-
return n((t, n) =>
|
|
623
|
+
function Lt() {
|
|
624
|
+
let e = r(Ne);
|
|
625
|
+
return n((t, n) => Ft(t, n, e), [e]);
|
|
623
626
|
}
|
|
624
627
|
//#endregion
|
|
625
628
|
//#region src/stageNavigation.ts
|
|
626
|
-
function
|
|
629
|
+
function Rt(e, t = {}) {
|
|
627
630
|
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
628
631
|
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
629
632
|
}
|
|
630
633
|
function W(e, t = {}) {
|
|
631
634
|
if (!globalThis.location) return;
|
|
632
|
-
let n =
|
|
635
|
+
let n = Rt(e, t);
|
|
633
636
|
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
634
637
|
}
|
|
635
|
-
function
|
|
638
|
+
function zt(e) {
|
|
636
639
|
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && typeof e != "object").map(([e, t]) => [e, String(t)]));
|
|
637
640
|
}
|
|
638
641
|
//#endregion
|
|
639
642
|
//#region src/stageFormSchema.ts
|
|
640
|
-
var
|
|
641
|
-
function
|
|
643
|
+
var Bt = 8;
|
|
644
|
+
function Vt(e) {
|
|
642
645
|
if (!e) return [];
|
|
643
646
|
try {
|
|
644
|
-
return
|
|
647
|
+
return Ht(JSON.parse(e), 0);
|
|
645
648
|
} catch {
|
|
646
649
|
return [];
|
|
647
650
|
}
|
|
648
651
|
}
|
|
649
|
-
function
|
|
650
|
-
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 =
|
|
651
|
-
return Object.entries(i).map(([e, i]) =>
|
|
652
|
+
function Ht(e, t) {
|
|
653
|
+
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 = Xt(e.properties) ? e.properties : {};
|
|
654
|
+
return Object.entries(i).map(([e, i]) => Ut(e, i, !n || r.has(e), t));
|
|
652
655
|
}
|
|
653
|
-
function
|
|
656
|
+
function Ut(e, t, n, r) {
|
|
654
657
|
return {
|
|
655
658
|
name: e,
|
|
656
659
|
identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
657
660
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
658
661
|
required: n,
|
|
659
|
-
...
|
|
662
|
+
...Wt(t, r)
|
|
660
663
|
};
|
|
661
664
|
}
|
|
662
|
-
function
|
|
665
|
+
function Wt(e, t) {
|
|
663
666
|
let n = e?.type;
|
|
664
667
|
if (Array.isArray(n)) {
|
|
665
668
|
let r = n.filter((e) => e !== "null");
|
|
666
|
-
return r.length === 1 ?
|
|
669
|
+
return r.length === 1 ? Wt({
|
|
667
670
|
...e,
|
|
668
671
|
type: r[0]
|
|
669
672
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -674,8 +677,8 @@ function Ut(e, t) {
|
|
|
674
677
|
type: "date",
|
|
675
678
|
withTime: e.format === "date-time"
|
|
676
679
|
};
|
|
677
|
-
if (n === "array") return
|
|
678
|
-
if (n === "object") return
|
|
680
|
+
if (n === "array") return Gt(e, t);
|
|
681
|
+
if (n === "object") return Kt(e, t);
|
|
679
682
|
if (n === void 0 || n === "string") {
|
|
680
683
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
681
684
|
return t.length > 0 ? {
|
|
@@ -685,54 +688,54 @@ function Ut(e, t) {
|
|
|
685
688
|
}
|
|
686
689
|
return { unsupportedReason: `type ${String(n)}` };
|
|
687
690
|
}
|
|
688
|
-
function
|
|
691
|
+
function Gt(e, t) {
|
|
689
692
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
690
|
-
if (t >=
|
|
691
|
-
let r =
|
|
693
|
+
if (t >= Bt || e?.items === void 0) return n;
|
|
694
|
+
let r = Ut("", e.items, !0, t + 1);
|
|
692
695
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
693
696
|
}
|
|
694
|
-
function
|
|
697
|
+
function Kt(e, t) {
|
|
695
698
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
696
|
-
if (t >=
|
|
697
|
-
let r =
|
|
699
|
+
if (t >= Bt || !Xt(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
700
|
+
let r = Ht(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
698
701
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
699
702
|
}
|
|
700
703
|
function G(e) {
|
|
701
704
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
|
702
705
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
703
706
|
}
|
|
704
|
-
function
|
|
707
|
+
function qt(e, t, n) {
|
|
705
708
|
if (t != null) {
|
|
706
|
-
if (e.members &&
|
|
709
|
+
if (e.members && Xt(t)) for (let r of e.members) {
|
|
707
710
|
let e = t[r.name], i = G(r.name);
|
|
708
|
-
if (
|
|
711
|
+
if (Jt(e)) {
|
|
709
712
|
if (r.required) return `${n}: ${i} is required`;
|
|
710
713
|
continue;
|
|
711
714
|
}
|
|
712
|
-
let a =
|
|
715
|
+
let a = qt(r, e, `${n} ${i.toLowerCase()}`);
|
|
713
716
|
if (a) return a;
|
|
714
717
|
}
|
|
715
718
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
716
|
-
let t =
|
|
719
|
+
let t = Jt(i) ? `${n} ${r + 1} is required` : qt(e.item, i, `${n} ${r + 1}`);
|
|
717
720
|
if (t) return t;
|
|
718
721
|
}
|
|
719
722
|
}
|
|
720
723
|
}
|
|
721
|
-
function
|
|
724
|
+
function Jt(e) {
|
|
722
725
|
return e == null || e === "";
|
|
723
726
|
}
|
|
724
|
-
function
|
|
725
|
-
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 &&
|
|
727
|
+
function Yt(e, t) {
|
|
728
|
+
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 && Xt(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
726
729
|
let r = e.members?.find((e) => e.name === t);
|
|
727
|
-
return [t, r ?
|
|
728
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
730
|
+
return [t, r ? Yt(r, n) : n];
|
|
731
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => Yt(e.item, t)) : t;
|
|
729
732
|
}
|
|
730
|
-
function
|
|
733
|
+
function Xt(e) {
|
|
731
734
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
732
735
|
}
|
|
733
736
|
//#endregion
|
|
734
737
|
//#region src/StageValueFields.tsx
|
|
735
|
-
var
|
|
738
|
+
var Zt = Le((e) => /* @__PURE__ */ P(Qt, {
|
|
736
739
|
descriptor: e.descriptor,
|
|
737
740
|
label: e.title ?? G(e.descriptor.name),
|
|
738
741
|
value: e.value,
|
|
@@ -740,22 +743,22 @@ var Xt = Ie((e) => /* @__PURE__ */ P(Zt, {
|
|
|
740
743
|
onBlur: e.onBlur,
|
|
741
744
|
invalid: e.invalid
|
|
742
745
|
}), { defaultValue: void 0 });
|
|
743
|
-
function
|
|
744
|
-
return e.members ? /* @__PURE__ */ P(
|
|
746
|
+
function Qt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
747
|
+
return e.members ? /* @__PURE__ */ P($t, {
|
|
745
748
|
descriptor: e,
|
|
746
749
|
label: t,
|
|
747
750
|
value: n,
|
|
748
751
|
onChange: r,
|
|
749
752
|
onBlur: i,
|
|
750
753
|
invalid: a
|
|
751
|
-
}) : e.item ? /* @__PURE__ */ P(
|
|
754
|
+
}) : e.item ? /* @__PURE__ */ P(en, {
|
|
752
755
|
descriptor: e,
|
|
753
756
|
label: t,
|
|
754
757
|
value: n,
|
|
755
758
|
onChange: r,
|
|
756
759
|
onBlur: i,
|
|
757
760
|
invalid: a
|
|
758
|
-
}) : /* @__PURE__ */ P(
|
|
761
|
+
}) : /* @__PURE__ */ P(tn, {
|
|
759
762
|
descriptor: e,
|
|
760
763
|
label: t,
|
|
761
764
|
value: n,
|
|
@@ -764,12 +767,12 @@ function Zt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
764
767
|
invalid: a
|
|
765
768
|
});
|
|
766
769
|
}
|
|
767
|
-
function
|
|
768
|
-
let o =
|
|
770
|
+
function $t({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
771
|
+
let o = an(n) ? n : {};
|
|
769
772
|
return /* @__PURE__ */ F("fieldset", {
|
|
770
773
|
className: "stage-record-field",
|
|
771
774
|
"data-invalid": a ? "true" : void 0,
|
|
772
|
-
children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(
|
|
775
|
+
children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(Qt, {
|
|
773
776
|
descriptor: e,
|
|
774
777
|
label: G(e.name),
|
|
775
778
|
value: o[e.name],
|
|
@@ -781,7 +784,7 @@ function Qt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
781
784
|
}, e.name))]
|
|
782
785
|
});
|
|
783
786
|
}
|
|
784
|
-
function
|
|
787
|
+
function en({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
785
788
|
let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
|
|
786
789
|
return /* @__PURE__ */ F("fieldset", {
|
|
787
790
|
className: "stage-list-field",
|
|
@@ -794,7 +797,7 @@ function $t({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
794
797
|
}),
|
|
795
798
|
s.map((e, n) => /* @__PURE__ */ F("div", {
|
|
796
799
|
className: "stage-list-field__row",
|
|
797
|
-
children: [/* @__PURE__ */ P(
|
|
800
|
+
children: [/* @__PURE__ */ P(Qt, {
|
|
798
801
|
descriptor: o,
|
|
799
802
|
label: `${t} ${n + 1}`,
|
|
800
803
|
value: e,
|
|
@@ -810,13 +813,13 @@ function $t({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
810
813
|
/* @__PURE__ */ P("button", {
|
|
811
814
|
type: "button",
|
|
812
815
|
"aria-label": `Add ${t}`,
|
|
813
|
-
onClick: () => c([...s,
|
|
816
|
+
onClick: () => c([...s, nn(o)]),
|
|
814
817
|
children: "Add"
|
|
815
818
|
})
|
|
816
819
|
]
|
|
817
820
|
});
|
|
818
821
|
}
|
|
819
|
-
function
|
|
822
|
+
function tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
820
823
|
let o = {
|
|
821
824
|
"aria-invalid": a ? !0 : void 0,
|
|
822
825
|
onBlur: i
|
|
@@ -862,7 +865,7 @@ function en({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
862
865
|
...o,
|
|
863
866
|
type: e.withTime ? "datetime-local" : "date",
|
|
864
867
|
value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
|
|
865
|
-
onChange: (t) => r(t.target.value === "" ? void 0 :
|
|
868
|
+
onChange: (t) => r(t.target.value === "" ? void 0 : rn(t.target.value, e.withTime === !0))
|
|
866
869
|
})]
|
|
867
870
|
});
|
|
868
871
|
default: return /* @__PURE__ */ F("label", {
|
|
@@ -876,94 +879,95 @@ function en({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
876
879
|
});
|
|
877
880
|
}
|
|
878
881
|
}
|
|
879
|
-
function
|
|
882
|
+
function nn(e) {
|
|
880
883
|
return e.members ? {} : void 0;
|
|
881
884
|
}
|
|
882
|
-
function
|
|
885
|
+
function rn(e, t) {
|
|
883
886
|
if (!t) return e;
|
|
884
887
|
let n = new Date(e);
|
|
885
888
|
return Number.isNaN(n.getTime()) ? e : n.toISOString();
|
|
886
889
|
}
|
|
887
|
-
function
|
|
890
|
+
function an(e) {
|
|
888
891
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
889
892
|
}
|
|
890
893
|
//#endregion
|
|
891
894
|
//#region src/StageCommandForm.tsx
|
|
892
|
-
var
|
|
893
|
-
function
|
|
894
|
-
let t = z(), n = r(
|
|
895
|
-
...
|
|
896
|
-
...
|
|
897
|
-
...
|
|
895
|
+
var on = e(void 0);
|
|
896
|
+
function sn({ element: e }) {
|
|
897
|
+
let t = z(), n = r(Ne), i = r(on), a = o(() => ln(e), [e]), s = o(() => jn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? un(a, s) : [], [a, s]), d = a ? U(a.command, q(e, "typeName"), q(e, "route")) : void 0, f = bn(e, u, t.resolveArgument), p = vn(e, s, t), m = JSON.stringify(p ?? null), h = o(() => p, [m]), g = o(() => ({
|
|
898
|
+
...h,
|
|
899
|
+
...mn(u, s, t.parameters),
|
|
900
|
+
...pn(u, t.parameters)
|
|
898
901
|
}), [
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
+
h,
|
|
903
|
+
u,
|
|
904
|
+
s,
|
|
902
905
|
t.parameters
|
|
903
|
-
]),
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
]),
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
]),
|
|
912
|
-
return
|
|
906
|
+
]), _ = o(() => a ? dn(a, u, s) : void 0, [
|
|
907
|
+
a,
|
|
908
|
+
u,
|
|
909
|
+
s
|
|
910
|
+
]), v = o(() => a ? kn(u, s) : [], [
|
|
911
|
+
a,
|
|
912
|
+
u,
|
|
913
|
+
s
|
|
914
|
+
]), y = o(() => a ? An(a.layout, u) : [], [a, u]), [b, x] = c([]);
|
|
915
|
+
return a ? !d && !t.routesReady ? /* @__PURE__ */ F("p", {
|
|
913
916
|
className: "stage-note",
|
|
914
917
|
children: [
|
|
915
918
|
"The modeled command “",
|
|
916
|
-
|
|
919
|
+
a.command,
|
|
917
920
|
"” is waiting for Stage routes."
|
|
918
921
|
]
|
|
919
|
-
}) :
|
|
920
|
-
form:
|
|
921
|
-
messages: [`The modeled command “${
|
|
922
|
-
}) :
|
|
923
|
-
form:
|
|
924
|
-
messages:
|
|
922
|
+
}) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(cn, {
|
|
923
|
+
form: a,
|
|
924
|
+
messages: [`The modeled command “${a.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
925
|
+
}) : v.length > 0 ? /* @__PURE__ */ P(cn, {
|
|
926
|
+
form: a,
|
|
927
|
+
messages: v
|
|
925
928
|
}) : /* @__PURE__ */ P("section", {
|
|
926
929
|
className: "stage-command-form",
|
|
927
|
-
"data-command":
|
|
928
|
-
"data-generation-mode":
|
|
929
|
-
children: /* @__PURE__ */ F(
|
|
930
|
-
command:
|
|
931
|
-
initialValues:
|
|
932
|
-
currentValues:
|
|
930
|
+
"data-command": a.command,
|
|
931
|
+
"data-generation-mode": a.generationMode,
|
|
932
|
+
children: /* @__PURE__ */ F(Ie, {
|
|
933
|
+
command: d,
|
|
934
|
+
initialValues: g,
|
|
935
|
+
currentValues: f,
|
|
933
936
|
validateOn: "both",
|
|
934
937
|
validateAllFieldsOnChange: !0,
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
938
|
+
onBeforeExecute: (e) => Pt(e, n.apiBasePath),
|
|
939
|
+
onFieldValidate: (e, t, n, r) => On(u, s, t, r),
|
|
940
|
+
onValidationFailure: (e) => x(e.map((e) => e.message)),
|
|
941
|
+
onException: (e) => x(e),
|
|
942
|
+
onFailed: (e) => x(It(a.command, e).messages),
|
|
939
943
|
onSuccess: () => {
|
|
940
|
-
|
|
941
|
-
let
|
|
942
|
-
|
|
944
|
+
x([]), t.refreshAfterCommand();
|
|
945
|
+
let n = q(e, "navigateToScreen");
|
|
946
|
+
n && W(n, {}), i?.();
|
|
943
947
|
},
|
|
944
948
|
children: [
|
|
945
|
-
|
|
949
|
+
y.map((e) => /* @__PURE__ */ P("p", {
|
|
946
950
|
role: "alert",
|
|
947
951
|
className: "stage-form-error",
|
|
948
952
|
children: e
|
|
949
953
|
}, e)),
|
|
950
|
-
|
|
951
|
-
|
|
954
|
+
_,
|
|
955
|
+
b.map((e) => /* @__PURE__ */ P("p", {
|
|
952
956
|
role: "alert",
|
|
953
957
|
className: "stage-form-error",
|
|
954
958
|
children: e
|
|
955
959
|
}, e)),
|
|
956
960
|
/* @__PURE__ */ F("button", {
|
|
957
961
|
type: "submit",
|
|
958
|
-
children: ["Execute ",
|
|
962
|
+
children: ["Execute ", a.label]
|
|
959
963
|
})
|
|
960
964
|
]
|
|
961
|
-
},
|
|
965
|
+
}, m)
|
|
962
966
|
}) : /* @__PURE__ */ F("p", {
|
|
963
967
|
className: "stage-note",
|
|
964
968
|
children: [
|
|
965
969
|
"The modeled command “",
|
|
966
|
-
|
|
970
|
+
a.command,
|
|
967
971
|
"” is not registered by this Stage."
|
|
968
972
|
]
|
|
969
973
|
}) : /* @__PURE__ */ P("p", {
|
|
@@ -971,7 +975,7 @@ function on({ element: e }) {
|
|
|
971
975
|
children: "This form is missing its command metadata."
|
|
972
976
|
});
|
|
973
977
|
}
|
|
974
|
-
function
|
|
978
|
+
function cn({ form: e, messages: t }) {
|
|
975
979
|
return /* @__PURE__ */ P("section", {
|
|
976
980
|
className: "stage-command-form",
|
|
977
981
|
"data-command": e.command,
|
|
@@ -983,7 +987,7 @@ function sn({ form: e, messages: t }) {
|
|
|
983
987
|
}, e))
|
|
984
988
|
});
|
|
985
989
|
}
|
|
986
|
-
function
|
|
990
|
+
function ln(e) {
|
|
987
991
|
let t = q(e, "command");
|
|
988
992
|
if (!t) return;
|
|
989
993
|
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(J) : [];
|
|
@@ -991,21 +995,21 @@ function cn(e) {
|
|
|
991
995
|
command: t,
|
|
992
996
|
label: q(e, "label", t),
|
|
993
997
|
fields: n,
|
|
994
|
-
generationMode:
|
|
995
|
-
layout:
|
|
998
|
+
generationMode: Sn(e.properties.generationMode),
|
|
999
|
+
layout: Cn(e.properties.layout)
|
|
996
1000
|
};
|
|
997
1001
|
}
|
|
998
|
-
function
|
|
1002
|
+
function un(e, t) {
|
|
999
1003
|
return e.generationMode === d.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1000
1004
|
name: e.name,
|
|
1001
1005
|
label: e.name
|
|
1002
1006
|
}));
|
|
1003
1007
|
}
|
|
1004
|
-
function
|
|
1005
|
-
let r = e.layout, i = r ?
|
|
1006
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
1007
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1008
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1008
|
+
function dn(e, t, n) {
|
|
1009
|
+
let r = e.layout, i = r ? wn(r, t) : [];
|
|
1010
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => fn(e, n));
|
|
1011
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Tn(r, i), s = {
|
|
1012
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => En(t + 1, r.columns)).join(" "),
|
|
1009
1013
|
columnGap: K(r.columnGap),
|
|
1010
1014
|
rowGap: K(r.rowGap)
|
|
1011
1015
|
}, c = /* @__PURE__ */ new Set();
|
|
@@ -1014,18 +1018,18 @@ function un(e, t, n) {
|
|
|
1014
1018
|
style: s,
|
|
1015
1019
|
children: [i.map((e) => {
|
|
1016
1020
|
let t = a.get(e.field);
|
|
1017
|
-
return t ? (c.add(t.name),
|
|
1018
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
1021
|
+
return t ? (c.add(t.name), fn(t, n, e)) : null;
|
|
1022
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => fn(e, n))]
|
|
1019
1023
|
});
|
|
1020
1024
|
}
|
|
1021
|
-
function
|
|
1025
|
+
function fn(e, t, n) {
|
|
1022
1026
|
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 = (() => {
|
|
1023
1027
|
if (i?.options) {
|
|
1024
1028
|
let e = i.options.map((e) => ({
|
|
1025
1029
|
value: e,
|
|
1026
1030
|
label: G(e)
|
|
1027
1031
|
}));
|
|
1028
|
-
return /* @__PURE__ */ P(
|
|
1032
|
+
return /* @__PURE__ */ P(Be, {
|
|
1029
1033
|
value: o,
|
|
1030
1034
|
fieldName: r,
|
|
1031
1035
|
title: a,
|
|
@@ -1035,7 +1039,7 @@ function dn(e, t, n) {
|
|
|
1035
1039
|
optionLabel: "label"
|
|
1036
1040
|
});
|
|
1037
1041
|
}
|
|
1038
|
-
if (i?.members || i?.item) return /* @__PURE__ */ P(
|
|
1042
|
+
if (i?.members || i?.item) return /* @__PURE__ */ P(Zt, {
|
|
1039
1043
|
value: o,
|
|
1040
1044
|
fieldName: r,
|
|
1041
1045
|
title: a,
|
|
@@ -1043,33 +1047,33 @@ function dn(e, t, n) {
|
|
|
1043
1047
|
descriptor: i
|
|
1044
1048
|
});
|
|
1045
1049
|
switch (i?.type ?? "text") {
|
|
1046
|
-
case "number": return /* @__PURE__ */ P(
|
|
1050
|
+
case "number": return /* @__PURE__ */ P(He, {
|
|
1047
1051
|
value: o,
|
|
1048
1052
|
fieldName: r,
|
|
1049
1053
|
title: a,
|
|
1050
1054
|
required: s
|
|
1051
1055
|
});
|
|
1052
|
-
case "boolean": return /* @__PURE__ */ P(
|
|
1056
|
+
case "boolean": return /* @__PURE__ */ P(ze, {
|
|
1053
1057
|
value: o,
|
|
1054
1058
|
fieldName: r,
|
|
1055
1059
|
label: a,
|
|
1056
1060
|
required: s
|
|
1057
1061
|
});
|
|
1058
|
-
case "date": return /* @__PURE__ */ P(
|
|
1062
|
+
case "date": return /* @__PURE__ */ P(Re, {
|
|
1059
1063
|
value: o,
|
|
1060
1064
|
fieldName: r,
|
|
1061
1065
|
title: a,
|
|
1062
1066
|
required: s,
|
|
1063
1067
|
showIcon: !0
|
|
1064
1068
|
});
|
|
1065
|
-
default: return /* @__PURE__ */ P(
|
|
1069
|
+
default: return /* @__PURE__ */ P(Ve, {
|
|
1066
1070
|
value: o,
|
|
1067
1071
|
fieldName: r,
|
|
1068
1072
|
title: a,
|
|
1069
1073
|
required: s
|
|
1070
1074
|
});
|
|
1071
1075
|
}
|
|
1072
|
-
})(), l =
|
|
1076
|
+
})(), l = Dn(n);
|
|
1073
1077
|
return /* @__PURE__ */ P("span", {
|
|
1074
1078
|
className: "stage-command-form__field",
|
|
1075
1079
|
"data-field": e.name,
|
|
@@ -1080,7 +1084,7 @@ function dn(e, t, n) {
|
|
|
1080
1084
|
children: c
|
|
1081
1085
|
}, e.name);
|
|
1082
1086
|
}
|
|
1083
|
-
function
|
|
1087
|
+
function pn(e, t) {
|
|
1084
1088
|
let n = {};
|
|
1085
1089
|
for (let r of e) {
|
|
1086
1090
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1088,27 +1092,27 @@ function fn(e, t) {
|
|
|
1088
1092
|
}
|
|
1089
1093
|
return n;
|
|
1090
1094
|
}
|
|
1091
|
-
function
|
|
1095
|
+
function mn(e, t, n) {
|
|
1092
1096
|
let r = new Set(e.map((e) => e.sourceProperty ?? e.name)), i = t.some((e) => e.identity), a = {};
|
|
1093
1097
|
for (let e of t) {
|
|
1094
1098
|
if (!e.identifier || !e.required || r.has(e.name)) continue;
|
|
1095
|
-
let t =
|
|
1099
|
+
let t = gn(e, n) ?? (e.identity || !i ? ct(e.identifier) : void 0);
|
|
1096
1100
|
t !== void 0 && (a[e.name] = t);
|
|
1097
1101
|
}
|
|
1098
1102
|
return a;
|
|
1099
1103
|
}
|
|
1100
|
-
function mn(e, t) {
|
|
1101
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 || hn(e, t) !== void 0;
|
|
1102
|
-
}
|
|
1103
1104
|
function hn(e, t) {
|
|
1105
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || gn(e, t) !== void 0;
|
|
1106
|
+
}
|
|
1107
|
+
function gn(e, t) {
|
|
1104
1108
|
if (e.identifier) return t[e.name] || st(e.identifier);
|
|
1105
1109
|
}
|
|
1106
|
-
function
|
|
1110
|
+
function _n(e) {
|
|
1107
1111
|
let t = e.properties.populateSource;
|
|
1108
1112
|
return J(t) ? t : void 0;
|
|
1109
1113
|
}
|
|
1110
|
-
function
|
|
1111
|
-
let r =
|
|
1114
|
+
function vn(e, t, n) {
|
|
1115
|
+
let r = _n(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, yn(e, r?.path ?? e, t, n)]), s = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
|
|
1112
1116
|
scope: `populate:${q(e, "command")}`,
|
|
1113
1117
|
name: i,
|
|
1114
1118
|
route: i ? n.routes?.queries[i] : void 0,
|
|
@@ -1121,12 +1125,12 @@ function _n(e, t, n) {
|
|
|
1121
1125
|
let e = {};
|
|
1122
1126
|
for (let n of t) {
|
|
1123
1127
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1124
|
-
t != null && (e[n.name] =
|
|
1128
|
+
t != null && (e[n.name] = Yt(n, t));
|
|
1125
1129
|
}
|
|
1126
1130
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1127
1131
|
}, [d, t]);
|
|
1128
1132
|
}
|
|
1129
|
-
function
|
|
1133
|
+
function yn(e, t, n, r) {
|
|
1130
1134
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1131
1135
|
if (i) return i;
|
|
1132
1136
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
@@ -1134,45 +1138,45 @@ function vn(e, t, n, r) {
|
|
|
1134
1138
|
let o = r.resolveBinding({ path: t });
|
|
1135
1139
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1136
1140
|
}
|
|
1137
|
-
function
|
|
1138
|
-
let r = o(() =>
|
|
1141
|
+
function bn(e, t, n) {
|
|
1142
|
+
let r = o(() => xn(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1139
1143
|
return o(() => {
|
|
1140
1144
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1141
1145
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1142
1146
|
}, [r, a]);
|
|
1143
1147
|
}
|
|
1144
|
-
function
|
|
1148
|
+
function xn(e, t) {
|
|
1145
1149
|
let n = e.properties.arguments;
|
|
1146
1150
|
if (!Array.isArray(n)) return [];
|
|
1147
1151
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1148
1152
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1149
1153
|
}
|
|
1150
|
-
function
|
|
1154
|
+
function Sn(e) {
|
|
1151
1155
|
return e === d.Manual ? d.Manual : d.Auto;
|
|
1152
1156
|
}
|
|
1153
|
-
function
|
|
1157
|
+
function Cn(e) {
|
|
1154
1158
|
if (!J(e)) return;
|
|
1155
1159
|
let t = e;
|
|
1156
1160
|
return {
|
|
1157
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1158
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1159
|
-
columnGap:
|
|
1160
|
-
rowGap:
|
|
1161
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(Mn) : [],
|
|
1162
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Nn) : [],
|
|
1163
|
+
columnGap: Pn(t.columnGap) ? t.columnGap : void 0,
|
|
1164
|
+
rowGap: Pn(t.rowGap) ? t.rowGap : void 0
|
|
1161
1165
|
};
|
|
1162
1166
|
}
|
|
1163
|
-
function
|
|
1167
|
+
function wn(e, t) {
|
|
1164
1168
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1165
|
-
for (let e of t) !n.has(e.name) &&
|
|
1169
|
+
for (let e of t) !n.has(e.name) && Nn(e.placement) && n.set(e.name, e.placement);
|
|
1166
1170
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1167
1171
|
}
|
|
1168
|
-
function
|
|
1172
|
+
function Tn(e, t) {
|
|
1169
1173
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1170
1174
|
}
|
|
1171
|
-
function
|
|
1175
|
+
function En(e, t) {
|
|
1172
1176
|
let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
|
|
1173
1177
|
return n?.width?.unit === f.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
|
|
1174
1178
|
}
|
|
1175
|
-
function
|
|
1179
|
+
function Dn(e) {
|
|
1176
1180
|
if (e) return {
|
|
1177
1181
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1178
1182
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
@@ -1187,36 +1191,36 @@ function K(e) {
|
|
|
1187
1191
|
case f.Auto: return "auto";
|
|
1188
1192
|
}
|
|
1189
1193
|
}
|
|
1190
|
-
function
|
|
1194
|
+
function On(e, t, n, r) {
|
|
1191
1195
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1192
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1196
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? qt(a, r, i?.label ?? n) : void 0;
|
|
1193
1197
|
}
|
|
1194
|
-
function
|
|
1198
|
+
function kn(e, t) {
|
|
1195
1199
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1196
1200
|
return e.flatMap((e) => {
|
|
1197
1201
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1198
1202
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1199
1203
|
});
|
|
1200
1204
|
}
|
|
1201
|
-
function
|
|
1205
|
+
function An(e, t) {
|
|
1202
1206
|
if (!e) return [];
|
|
1203
|
-
let n =
|
|
1207
|
+
let n = wn(e, t).filter((e) => e.width?.unit === f.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 === f.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.`);
|
|
1204
1208
|
return [...n, ...r];
|
|
1205
1209
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return
|
|
1210
|
+
function jn(e) {
|
|
1211
|
+
return Vt(q(e, "schema"));
|
|
1208
1212
|
}
|
|
1209
1213
|
function q(e, t, n = "") {
|
|
1210
1214
|
let r = e.properties[t];
|
|
1211
1215
|
return typeof r == "string" ? r : n;
|
|
1212
1216
|
}
|
|
1213
|
-
function
|
|
1217
|
+
function Mn(e) {
|
|
1214
1218
|
return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1215
1219
|
}
|
|
1216
|
-
function
|
|
1220
|
+
function Nn(e) {
|
|
1217
1221
|
return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1218
1222
|
}
|
|
1219
|
-
function
|
|
1223
|
+
function Pn(e) {
|
|
1220
1224
|
return J(e) && Object.values(f).includes(e.unit);
|
|
1221
1225
|
}
|
|
1222
1226
|
function J(e) {
|
|
@@ -1224,20 +1228,20 @@ function J(e) {
|
|
|
1224
1228
|
}
|
|
1225
1229
|
//#endregion
|
|
1226
1230
|
//#region src/StageGuardedAction.tsx
|
|
1227
|
-
function
|
|
1231
|
+
function Fn(e) {
|
|
1228
1232
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1229
1233
|
}
|
|
1230
1234
|
function Y(e, t) {
|
|
1231
1235
|
let n = e.properties[t];
|
|
1232
1236
|
return typeof n == "string" ? n : "";
|
|
1233
1237
|
}
|
|
1234
|
-
function
|
|
1238
|
+
function In(e) {
|
|
1235
1239
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1236
1240
|
}
|
|
1237
|
-
function
|
|
1238
|
-
let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries[n] : void 0) ?? Y(e, "itemRoute"), i =
|
|
1241
|
+
function Ln(e) {
|
|
1242
|
+
let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries[n] : void 0) ?? Y(e, "itemRoute"), i = Fn(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1239
1243
|
for (let [e, n] of Object.entries(i)) {
|
|
1240
|
-
let r =
|
|
1244
|
+
let r = Fn(n) ? t.resolveBinding(n) : n;
|
|
1241
1245
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1242
1246
|
}
|
|
1243
1247
|
let s = B({
|
|
@@ -1253,17 +1257,17 @@ function In(e) {
|
|
|
1253
1257
|
item: s.rows.length === 1 ? s.rows[0] : void 0
|
|
1254
1258
|
};
|
|
1255
1259
|
}
|
|
1256
|
-
function
|
|
1257
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(
|
|
1260
|
+
function Rn(e, t) {
|
|
1261
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(Ye(n) ?? "", t)]));
|
|
1258
1262
|
}
|
|
1259
|
-
function
|
|
1260
|
-
let n = z(), r =
|
|
1263
|
+
function zn({ element: e, interactions: t }) {
|
|
1264
|
+
let n = z(), r = Ln(e), i = Lt(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Fn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1261
1265
|
if (!nt(m) || !h || !r.hasSource) {
|
|
1262
|
-
let n = r.hasSource ? `${
|
|
1266
|
+
let n = r.hasSource ? `${Xe}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Xe}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1263
1267
|
return /* @__PURE__ */ F("div", {
|
|
1264
1268
|
className: "stage-guarded-action",
|
|
1265
1269
|
"data-scene-id": e.id,
|
|
1266
|
-
children: [/* @__PURE__ */ P(
|
|
1270
|
+
children: [/* @__PURE__ */ P(Oe, {
|
|
1267
1271
|
type: "button",
|
|
1268
1272
|
disabled: !0,
|
|
1269
1273
|
title: n,
|
|
@@ -1282,7 +1286,7 @@ function Rn({ element: e, interactions: t }) {
|
|
|
1282
1286
|
let v = _.command, y = U(v), b = r.item, x = async () => {
|
|
1283
1287
|
if (!y) return;
|
|
1284
1288
|
u(!0);
|
|
1285
|
-
let t = await i(v,
|
|
1289
|
+
let t = await i(v, Rn(_, b));
|
|
1286
1290
|
if (u(!1), s(t.messages), !t.isSuccess) return;
|
|
1287
1291
|
n.refreshAfterCommand();
|
|
1288
1292
|
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? at(`item.${a}`, b) : void 0;
|
|
@@ -1292,7 +1296,7 @@ function Rn({ element: e, interactions: t }) {
|
|
|
1292
1296
|
className: "stage-guarded-action",
|
|
1293
1297
|
"data-scene-id": e.id,
|
|
1294
1298
|
"data-command": v,
|
|
1295
|
-
children: [/* @__PURE__ */ P(
|
|
1299
|
+
children: [/* @__PURE__ */ P(Oe, {
|
|
1296
1300
|
...t,
|
|
1297
1301
|
type: "button",
|
|
1298
1302
|
disabled: !y || l,
|
|
@@ -1306,7 +1310,7 @@ function Rn({ element: e, interactions: t }) {
|
|
|
1306
1310
|
}, e))]
|
|
1307
1311
|
});
|
|
1308
1312
|
}
|
|
1309
|
-
function
|
|
1313
|
+
function Bn(e) {
|
|
1310
1314
|
let t = oe(), r = s(void 0), a = o(() => v(ie(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
|
|
1311
1315
|
i(() => () => clearTimeout(r.current), []);
|
|
1312
1316
|
let c = n((e) => {
|
|
@@ -1334,7 +1338,7 @@ function zn(e) {
|
|
|
1334
1338
|
}
|
|
1335
1339
|
//#endregion
|
|
1336
1340
|
//#region src/stageComponents.tsx
|
|
1337
|
-
var
|
|
1341
|
+
var Vn = "Stage:commandForm";
|
|
1338
1342
|
function X(e, t, n = {}) {
|
|
1339
1343
|
return {
|
|
1340
1344
|
id: e,
|
|
@@ -1347,15 +1351,15 @@ function Z(e, t, n = "") {
|
|
|
1347
1351
|
let r = e.properties[t];
|
|
1348
1352
|
return typeof r == "string" ? r : n;
|
|
1349
1353
|
}
|
|
1350
|
-
function
|
|
1354
|
+
function Hn(e, t) {
|
|
1351
1355
|
let n = e.properties.queryArguments;
|
|
1352
|
-
if (!
|
|
1356
|
+
if (!Kn(n)) return {
|
|
1353
1357
|
values: {},
|
|
1354
1358
|
ready: !0
|
|
1355
1359
|
};
|
|
1356
1360
|
let r = {}, i = !0;
|
|
1357
1361
|
for (let [e, a] of Object.entries(n)) {
|
|
1358
|
-
let n =
|
|
1362
|
+
let n = Gn(a) ? t.resolveBinding(a) : a;
|
|
1359
1363
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
1360
1364
|
}
|
|
1361
1365
|
return {
|
|
@@ -1363,7 +1367,7 @@ function Vn(e, t) {
|
|
|
1363
1367
|
ready: i
|
|
1364
1368
|
};
|
|
1365
1369
|
}
|
|
1366
|
-
function
|
|
1370
|
+
function Un(e, t) {
|
|
1367
1371
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
1368
1372
|
let t = e.properties;
|
|
1369
1373
|
return {
|
|
@@ -1379,14 +1383,14 @@ function Hn(e, t) {
|
|
|
1379
1383
|
function Q(e, t) {
|
|
1380
1384
|
return e[t] ?? e.id ?? e.key;
|
|
1381
1385
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), a = (Z(e, "query") ? n.routes?.queries[Z(e, "query")] : void 0) ?? Z(e, "route"), s = o(() =>
|
|
1386
|
+
function Wn({ element: e, slots: t }) {
|
|
1387
|
+
let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), a = (Z(e, "query") ? n.routes?.queries[Z(e, "query")] : void 0) ?? Z(e, "route"), s = o(() => Hn(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
|
|
1384
1388
|
scope: e.id,
|
|
1385
1389
|
name: r,
|
|
1386
1390
|
route: a || void 0,
|
|
1387
1391
|
arguments: s.values,
|
|
1388
1392
|
ready: s.ready
|
|
1389
|
-
}), d =
|
|
1393
|
+
}), d = Un(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, _ = Bn(e);
|
|
1390
1394
|
i(() => {
|
|
1391
1395
|
if (!h) return;
|
|
1392
1396
|
let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
|
|
@@ -1436,21 +1440,21 @@ function Un({ element: e, slots: t }) {
|
|
|
1436
1440
|
className: "stage-table",
|
|
1437
1441
|
"data-scene-id": e.id,
|
|
1438
1442
|
children: [
|
|
1439
|
-
u && /* @__PURE__ */ P(
|
|
1443
|
+
u && /* @__PURE__ */ P(Ae, {
|
|
1440
1444
|
element: X(`${e.id}-loading`, {
|
|
1441
1445
|
severity: "info",
|
|
1442
1446
|
text: "Loading…"
|
|
1443
1447
|
}),
|
|
1444
1448
|
slots: {}
|
|
1445
1449
|
}),
|
|
1446
|
-
l && /* @__PURE__ */ P(
|
|
1450
|
+
l && /* @__PURE__ */ P(Ae, {
|
|
1447
1451
|
element: X(`${e.id}-error`, {
|
|
1448
1452
|
severity: "error",
|
|
1449
1453
|
text: l
|
|
1450
1454
|
}),
|
|
1451
1455
|
slots: {}
|
|
1452
1456
|
}),
|
|
1453
|
-
h && /* @__PURE__ */ P(
|
|
1457
|
+
h && /* @__PURE__ */ P(Oe, {
|
|
1454
1458
|
type: "button",
|
|
1455
1459
|
size: "small",
|
|
1456
1460
|
onClick: () => {
|
|
@@ -1493,28 +1497,28 @@ function Un({ element: e, slots: t }) {
|
|
|
1493
1497
|
}), t.columns]
|
|
1494
1498
|
});
|
|
1495
1499
|
}
|
|
1496
|
-
function Wn(e) {
|
|
1497
|
-
return Gn(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1498
|
-
}
|
|
1499
1500
|
function Gn(e) {
|
|
1501
|
+
return Kn(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1502
|
+
}
|
|
1503
|
+
function Kn(e) {
|
|
1500
1504
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1501
1505
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1506
|
+
function qn({ element: e, interactions: t, slots: n }) {
|
|
1507
|
+
return In(e) ? /* @__PURE__ */ P(zn, {
|
|
1504
1508
|
element: e,
|
|
1505
1509
|
interactions: t
|
|
1506
|
-
}) : /* @__PURE__ */ P(
|
|
1510
|
+
}) : /* @__PURE__ */ P(Jn, {
|
|
1507
1511
|
element: e,
|
|
1508
1512
|
interactions: t,
|
|
1509
1513
|
slots: n
|
|
1510
1514
|
});
|
|
1511
1515
|
}
|
|
1512
|
-
function
|
|
1516
|
+
function Jn({ element: e, interactions: t }) {
|
|
1513
1517
|
let n = Z(e, "label", Z(e, "command"));
|
|
1514
|
-
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(
|
|
1518
|
+
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(Yn, {
|
|
1515
1519
|
element: e,
|
|
1516
1520
|
label: n
|
|
1517
|
-
}) : /* @__PURE__ */ P(
|
|
1521
|
+
}) : /* @__PURE__ */ P(Oe, {
|
|
1518
1522
|
type: "button",
|
|
1519
1523
|
"data-scene-id": e.id,
|
|
1520
1524
|
disabled: !0,
|
|
@@ -1523,15 +1527,15 @@ function qn({ element: e, interactions: t }) {
|
|
|
1523
1527
|
children: n
|
|
1524
1528
|
});
|
|
1525
1529
|
}
|
|
1526
|
-
function
|
|
1527
|
-
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(
|
|
1530
|
+
function Yn({ element: e, label: t }) {
|
|
1531
|
+
let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(on.Provider, {
|
|
1528
1532
|
value: a,
|
|
1529
|
-
children: /* @__PURE__ */ P(
|
|
1533
|
+
children: /* @__PURE__ */ P(sn, { element: e })
|
|
1530
1534
|
});
|
|
1531
1535
|
return /* @__PURE__ */ P("div", {
|
|
1532
1536
|
className: "stage-action",
|
|
1533
1537
|
"data-scene-id": e.id,
|
|
1534
|
-
children: /* @__PURE__ */ P(
|
|
1538
|
+
children: /* @__PURE__ */ P(ke, {
|
|
1535
1539
|
element: X(e.id, {
|
|
1536
1540
|
visible: !1,
|
|
1537
1541
|
header: t,
|
|
@@ -1541,13 +1545,13 @@ function Jn({ element: e, label: t }) {
|
|
|
1541
1545
|
}, r)
|
|
1542
1546
|
});
|
|
1543
1547
|
}
|
|
1544
|
-
function
|
|
1545
|
-
let t = e.element ?? X("slice-dialog", {}), r = se(), { routes: i, parameters: a } = z(), s = O(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() =>
|
|
1548
|
+
function Xn(e) {
|
|
1549
|
+
let t = e.element ?? X("slice-dialog", {}), r = se(), { routes: i, parameters: a } = z(), s = O(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() => Vt(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
|
|
1546
1550
|
if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
|
|
1547
1551
|
element: e.element,
|
|
1548
1552
|
slots: e.slots ?? {}
|
|
1549
1553
|
}) : /* @__PURE__ */ P(re, {});
|
|
1550
|
-
let p = d.filter((e) => !
|
|
1554
|
+
let p = d.filter((e) => !hn(e, a)), m = X(`slice-dialog-${c}`, {
|
|
1551
1555
|
command: c,
|
|
1552
1556
|
label: l,
|
|
1553
1557
|
schema: u,
|
|
@@ -1569,9 +1573,9 @@ function Yn(e) {
|
|
|
1569
1573
|
children: l
|
|
1570
1574
|
})
|
|
1571
1575
|
}),
|
|
1572
|
-
/* @__PURE__ */ P(
|
|
1576
|
+
/* @__PURE__ */ P(on.Provider, {
|
|
1573
1577
|
value: f,
|
|
1574
|
-
children: /* @__PURE__ */ P(
|
|
1578
|
+
children: /* @__PURE__ */ P(sn, { element: m })
|
|
1575
1579
|
}),
|
|
1576
1580
|
/* @__PURE__ */ P("footer", {
|
|
1577
1581
|
className: "scene-slice-dialog-footer",
|
|
@@ -1585,7 +1589,7 @@ function Yn(e) {
|
|
|
1585
1589
|
]
|
|
1586
1590
|
});
|
|
1587
1591
|
}
|
|
1588
|
-
function
|
|
1592
|
+
function Zn(e) {
|
|
1589
1593
|
let { element: t } = e;
|
|
1590
1594
|
if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
|
|
1591
1595
|
let n = Z(t, "name", t.id), r = {
|
|
@@ -1599,25 +1603,25 @@ function Xn(e) {
|
|
|
1599
1603
|
return /* @__PURE__ */ P("span", {
|
|
1600
1604
|
className: "stage-toolbar-action",
|
|
1601
1605
|
"data-scene-toolbar-item": n,
|
|
1602
|
-
children: /* @__PURE__ */ P(
|
|
1606
|
+
children: /* @__PURE__ */ P(qn, {
|
|
1603
1607
|
element: r,
|
|
1604
1608
|
interactions: e.interactions,
|
|
1605
1609
|
slots: e.slots
|
|
1606
1610
|
})
|
|
1607
1611
|
});
|
|
1608
1612
|
}
|
|
1609
|
-
var
|
|
1613
|
+
var Qn = {
|
|
1610
1614
|
...E,
|
|
1611
|
-
"core:table":
|
|
1612
|
-
"core:action":
|
|
1613
|
-
"core:toolbarItem":
|
|
1614
|
-
"core:sliceDialog":
|
|
1615
|
-
[
|
|
1615
|
+
"core:table": Wn,
|
|
1616
|
+
"core:action": qn,
|
|
1617
|
+
"core:toolbarItem": Zn,
|
|
1618
|
+
"core:sliceDialog": Xn,
|
|
1619
|
+
[Vn]: sn
|
|
1616
1620
|
};
|
|
1617
1621
|
//#endregion
|
|
1618
1622
|
//#region src/useStrings.ts
|
|
1619
|
-
function
|
|
1620
|
-
let e =
|
|
1623
|
+
function $n() {
|
|
1624
|
+
let e = I(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1621
1625
|
return i(() => {
|
|
1622
1626
|
let t = new AbortController();
|
|
1623
1627
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1634,11 +1638,11 @@ function Qn() {
|
|
|
1634
1638
|
dictionary: o
|
|
1635
1639
|
};
|
|
1636
1640
|
}
|
|
1637
|
-
var
|
|
1638
|
-
function
|
|
1639
|
-
return
|
|
1641
|
+
var er = /* @__PURE__ */ new Set(["core:table"]);
|
|
1642
|
+
function tr(e) {
|
|
1643
|
+
return nr(e, /* @__PURE__ */ new Map(), void 0);
|
|
1640
1644
|
}
|
|
1641
|
-
function
|
|
1645
|
+
function nr(e, t, n) {
|
|
1642
1646
|
let r = e;
|
|
1643
1647
|
if (!r.slots) return e;
|
|
1644
1648
|
let i = !1, a = {};
|
|
@@ -1647,7 +1651,7 @@ function tr(e, t, n) {
|
|
|
1647
1651
|
a[e] = o.map((e) => {
|
|
1648
1652
|
let t = e, n = $(t, "typeName");
|
|
1649
1653
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1650
|
-
let a =
|
|
1654
|
+
let a = nr(ir(rr(t, r), s), r, s);
|
|
1651
1655
|
return a !== e && (i = !0), a;
|
|
1652
1656
|
});
|
|
1653
1657
|
}
|
|
@@ -1656,8 +1660,8 @@ function tr(e, t, n) {
|
|
|
1656
1660
|
slots: a
|
|
1657
1661
|
} : e;
|
|
1658
1662
|
}
|
|
1659
|
-
function
|
|
1660
|
-
if (
|
|
1663
|
+
function rr(e, t) {
|
|
1664
|
+
if (!er.has(e.componentName)) return e;
|
|
1661
1665
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1662
1666
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1663
1667
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -1666,7 +1670,7 @@ function nr(e, t) {
|
|
|
1666
1670
|
properties: a
|
|
1667
1671
|
};
|
|
1668
1672
|
}
|
|
1669
|
-
function
|
|
1673
|
+
function ir(e, t) {
|
|
1670
1674
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || t.properties?.isCollection === !0 || e.properties.itemQuery !== void 0) return e;
|
|
1671
1675
|
let n = { ...e.properties }, r = $(t, "query"), i = $(t, "by");
|
|
1672
1676
|
return r && (n.itemQuery = r), $(t, "route") && (n.itemRoute = t.properties.route), n.itemArguments = i ? { [i]: { path: `screen.keys.${i}` } } : {}, {
|
|
@@ -1680,7 +1684,7 @@ function $(e, t) {
|
|
|
1680
1684
|
}
|
|
1681
1685
|
//#endregion
|
|
1682
1686
|
//#region src/stageQueryBindings.tsx
|
|
1683
|
-
function
|
|
1687
|
+
function ar(e) {
|
|
1684
1688
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1685
1689
|
if (Array.isArray(e)) {
|
|
1686
1690
|
e.forEach(n);
|
|
@@ -1700,7 +1704,7 @@ function ir(e) {
|
|
|
1700
1704
|
};
|
|
1701
1705
|
return r(e), [...t];
|
|
1702
1706
|
}
|
|
1703
|
-
function
|
|
1707
|
+
function or(e) {
|
|
1704
1708
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
1705
1709
|
let n = e.properties?.[t];
|
|
1706
1710
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -1719,7 +1723,7 @@ function ar(e) {
|
|
|
1719
1723
|
};
|
|
1720
1724
|
return r(e), [...t.values()];
|
|
1721
1725
|
}
|
|
1722
|
-
function
|
|
1726
|
+
function sr({ source: e }) {
|
|
1723
1727
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, s = o(() => e.by ? a ? { [e.by]: a } : {} : {
|
|
1724
1728
|
...i,
|
|
1725
1729
|
...r
|
|
@@ -1739,7 +1743,7 @@ function or({ source: e }) {
|
|
|
1739
1743
|
list: !0
|
|
1740
1744
|
}), null;
|
|
1741
1745
|
}
|
|
1742
|
-
function
|
|
1746
|
+
function cr({ name: e }) {
|
|
1743
1747
|
let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
|
|
1744
1748
|
...i,
|
|
1745
1749
|
...r
|
|
@@ -1753,11 +1757,11 @@ function sr({ name: e }) {
|
|
|
1753
1757
|
list: !0
|
|
1754
1758
|
}), null;
|
|
1755
1759
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let t = o(() =>
|
|
1758
|
-
return /* @__PURE__ */ F(De, { children: [t.map((e) => /* @__PURE__ */ P(
|
|
1760
|
+
function lr({ element: e }) {
|
|
1761
|
+
let t = o(() => ar(e), [e]), n = o(() => or(e), [e]);
|
|
1762
|
+
return /* @__PURE__ */ F(De, { children: [t.map((e) => /* @__PURE__ */ P(cr, { name: e }, e)), n.map((e) => /* @__PURE__ */ P(sr, { source: e }, e.typeName))] });
|
|
1759
1763
|
}
|
|
1760
|
-
function
|
|
1764
|
+
function ur(e) {
|
|
1761
1765
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1762
1766
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
1763
1767
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -1770,7 +1774,7 @@ function lr(e) {
|
|
|
1770
1774
|
]);
|
|
1771
1775
|
if (t.has(s)) continue;
|
|
1772
1776
|
t.add(s);
|
|
1773
|
-
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l =
|
|
1777
|
+
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = pr(r.destination) ? r.destination : void 0;
|
|
1774
1778
|
n.push({
|
|
1775
1779
|
label: i,
|
|
1776
1780
|
targetScreen: a,
|
|
@@ -1778,7 +1782,7 @@ function lr(e) {
|
|
|
1778
1782
|
order: c,
|
|
1779
1783
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
1780
1784
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
1781
|
-
...l &&
|
|
1785
|
+
...l && mr(l) ? { destination: l } : {}
|
|
1782
1786
|
});
|
|
1783
1787
|
}
|
|
1784
1788
|
return n.map((e, t) => ({
|
|
@@ -1786,7 +1790,7 @@ function lr(e) {
|
|
|
1786
1790
|
index: t
|
|
1787
1791
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
1788
1792
|
}
|
|
1789
|
-
function
|
|
1793
|
+
function dr(e) {
|
|
1790
1794
|
let t = {
|
|
1791
1795
|
label: "",
|
|
1792
1796
|
children: []
|
|
@@ -1811,21 +1815,21 @@ function ur(e) {
|
|
|
1811
1815
|
}
|
|
1812
1816
|
return t.children;
|
|
1813
1817
|
}
|
|
1814
|
-
function
|
|
1818
|
+
function fr(e, t) {
|
|
1815
1819
|
for (let n of e) {
|
|
1816
1820
|
if (n.screen === t) return [n.label];
|
|
1817
|
-
let e =
|
|
1821
|
+
let e = fr(n.children, t);
|
|
1818
1822
|
if (e.length > 0) return [n.label, ...e];
|
|
1819
1823
|
}
|
|
1820
1824
|
return [];
|
|
1821
1825
|
}
|
|
1822
|
-
function
|
|
1826
|
+
function pr(e) {
|
|
1823
1827
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1824
1828
|
}
|
|
1825
|
-
function
|
|
1829
|
+
function mr(e) {
|
|
1826
1830
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
1827
1831
|
}
|
|
1828
|
-
function
|
|
1832
|
+
function hr(e, t, n) {
|
|
1829
1833
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
1830
1834
|
label: e.name,
|
|
1831
1835
|
targetScreen: e.name,
|
|
@@ -1834,8 +1838,8 @@ function mr(e, t, n) {
|
|
|
1834
1838
|
}
|
|
1835
1839
|
//#endregion
|
|
1836
1840
|
//#region src/blueprint.ts
|
|
1837
|
-
var
|
|
1838
|
-
function
|
|
1841
|
+
var gr = "Stage:locale";
|
|
1842
|
+
function _r(e) {
|
|
1839
1843
|
let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
|
|
1840
1844
|
return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
|
|
1841
1845
|
...t,
|
|
@@ -1843,27 +1847,27 @@ function gr(e) {
|
|
|
1843
1847
|
packages: n
|
|
1844
1848
|
};
|
|
1845
1849
|
}
|
|
1846
|
-
var
|
|
1850
|
+
var vr = {
|
|
1847
1851
|
...fe,
|
|
1848
|
-
PrimeReact:
|
|
1852
|
+
PrimeReact: Me.components
|
|
1849
1853
|
};
|
|
1850
|
-
function
|
|
1854
|
+
function yr(e) {
|
|
1851
1855
|
return {
|
|
1852
1856
|
...E,
|
|
1853
|
-
...
|
|
1857
|
+
...je,
|
|
1854
1858
|
...me,
|
|
1855
1859
|
...Se,
|
|
1856
1860
|
...e
|
|
1857
1861
|
};
|
|
1858
1862
|
}
|
|
1859
|
-
function
|
|
1863
|
+
function br(e) {
|
|
1860
1864
|
return e ? {
|
|
1861
1865
|
...e,
|
|
1862
|
-
...
|
|
1863
|
-
} :
|
|
1866
|
+
...vr
|
|
1867
|
+
} : vr;
|
|
1864
1868
|
}
|
|
1865
|
-
var
|
|
1866
|
-
function
|
|
1869
|
+
var xr = "Stage:navigationTree";
|
|
1870
|
+
function Sr(e, t, n) {
|
|
1867
1871
|
return N(e, j.Logo, {
|
|
1868
1872
|
label: t,
|
|
1869
1873
|
initials: t.slice(0, 1).toUpperCase() || "S",
|
|
@@ -1871,31 +1875,31 @@ function xr(e, t, n) {
|
|
|
1871
1875
|
...n ? { lightImageUrl: n } : {}
|
|
1872
1876
|
});
|
|
1873
1877
|
}
|
|
1874
|
-
function
|
|
1875
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
1878
|
+
function Cr(e, t, n, r, i, a = !1, o = !0) {
|
|
1879
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = ur(e), u = hr(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = dr([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => xe({
|
|
1876
1880
|
label: e.name,
|
|
1877
1881
|
targetScreen: e.name,
|
|
1878
1882
|
icon: "pi pi-table",
|
|
1879
1883
|
group: "Screens",
|
|
1880
1884
|
order: n
|
|
1881
|
-
}, t)), p = dr(
|
|
1885
|
+
}, t)), p = fr(dr(l), t), m = e.find((e) => e.name === t)?.path?.length ? fr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", xr, {
|
|
1882
1886
|
nodes: d,
|
|
1883
1887
|
activeScreen: t
|
|
1884
1888
|
}) : N("menu-screens", j.Menu, {
|
|
1885
1889
|
title: "Screens",
|
|
1886
1890
|
label: "Screens"
|
|
1887
1891
|
}, { items: f }), _ = [];
|
|
1888
|
-
n.length > 1 && _.push(N("topbar-locale",
|
|
1892
|
+
n.length > 1 && _.push(N("topbar-locale", gr, {
|
|
1889
1893
|
locales: n,
|
|
1890
1894
|
locale: r
|
|
1891
1895
|
})), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
|
|
1892
1896
|
let v = { regionNavigation: a };
|
|
1893
1897
|
return {
|
|
1894
1898
|
[M.Topbar]: [N("topbar", j.Topbar, v, {
|
|
1895
|
-
logo: [
|
|
1899
|
+
logo: [Sr("topbar-logo", c, i?.image)],
|
|
1896
1900
|
end: _
|
|
1897
1901
|
})],
|
|
1898
|
-
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [
|
|
1902
|
+
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [Sr("sidebar-logo", c, i?.image)] })],
|
|
1899
1903
|
...a ? {} : { [M.Menu]: [g] },
|
|
1900
1904
|
[M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
|
|
1901
1905
|
homeTargetScreen: s,
|
|
@@ -1912,26 +1916,26 @@ function Sr(e, t, n, r, i, a = !1, o = !0) {
|
|
|
1912
1916
|
})]
|
|
1913
1917
|
};
|
|
1914
1918
|
}
|
|
1915
|
-
function
|
|
1919
|
+
function wr(e) {
|
|
1916
1920
|
return `#/${encodeURIComponent(e)}`;
|
|
1917
1921
|
}
|
|
1918
1922
|
//#endregion
|
|
1919
1923
|
//#region src/StageChrome.tsx
|
|
1920
|
-
var
|
|
1924
|
+
var Tr = e({
|
|
1921
1925
|
locales: [],
|
|
1922
1926
|
locale: "",
|
|
1923
1927
|
setLocale: () => void 0,
|
|
1924
1928
|
activity: ""
|
|
1925
1929
|
});
|
|
1926
|
-
function
|
|
1927
|
-
return /* @__PURE__ */ P(
|
|
1930
|
+
function Er({ state: e, children: t }) {
|
|
1931
|
+
return /* @__PURE__ */ P(Tr.Provider, {
|
|
1928
1932
|
value: e,
|
|
1929
1933
|
children: t
|
|
1930
1934
|
});
|
|
1931
1935
|
}
|
|
1932
|
-
var
|
|
1933
|
-
function
|
|
1934
|
-
let { locales: e, locale: t, setLocale: n } = r(
|
|
1936
|
+
var Dr = "Stage:activity";
|
|
1937
|
+
function Or() {
|
|
1938
|
+
let { locales: e, locale: t, setLocale: n } = r(Tr);
|
|
1935
1939
|
return e.length < 2 ? null : /* @__PURE__ */ P("select", {
|
|
1936
1940
|
className: "stage-locale",
|
|
1937
1941
|
"aria-label": "Locale",
|
|
@@ -1943,19 +1947,19 @@ function Dr() {
|
|
|
1943
1947
|
}, e))
|
|
1944
1948
|
});
|
|
1945
1949
|
}
|
|
1946
|
-
function
|
|
1950
|
+
function kr({ element: e }) {
|
|
1947
1951
|
let t = e.properties ?? {};
|
|
1948
1952
|
return /* @__PURE__ */ P("nav", {
|
|
1949
1953
|
className: "stage-navigation-tree",
|
|
1950
1954
|
"aria-label": "Navigation",
|
|
1951
1955
|
"data-scene-id": e.id,
|
|
1952
|
-
children: /* @__PURE__ */ P(
|
|
1956
|
+
children: /* @__PURE__ */ P(Ar, {
|
|
1953
1957
|
nodes: t.nodes ?? [],
|
|
1954
1958
|
activeScreen: t.activeScreen
|
|
1955
1959
|
})
|
|
1956
1960
|
});
|
|
1957
1961
|
}
|
|
1958
|
-
function
|
|
1962
|
+
function Ar({ nodes: e, activeScreen: t }) {
|
|
1959
1963
|
return /* @__PURE__ */ P("ul", {
|
|
1960
1964
|
role: "tree",
|
|
1961
1965
|
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
|
|
@@ -1964,13 +1968,13 @@ function kr({ nodes: e, activeScreen: t }) {
|
|
|
1964
1968
|
children: [/* @__PURE__ */ P("span", {
|
|
1965
1969
|
className: "stage-navigation-group",
|
|
1966
1970
|
children: e.label
|
|
1967
|
-
}), /* @__PURE__ */ P(
|
|
1971
|
+
}), /* @__PURE__ */ P(Ar, {
|
|
1968
1972
|
nodes: e.children,
|
|
1969
1973
|
activeScreen: t
|
|
1970
1974
|
})]
|
|
1971
1975
|
}, e.label) : /* @__PURE__ */ P("li", {
|
|
1972
1976
|
role: "treeitem",
|
|
1973
|
-
children: /* @__PURE__ */ P(
|
|
1977
|
+
children: /* @__PURE__ */ P(jr, {
|
|
1974
1978
|
node: e,
|
|
1975
1979
|
screen: e.screen,
|
|
1976
1980
|
activeScreen: t
|
|
@@ -1978,12 +1982,12 @@ function kr({ nodes: e, activeScreen: t }) {
|
|
|
1978
1982
|
}, `${e.screen}:${e.label}`))
|
|
1979
1983
|
});
|
|
1980
1984
|
}
|
|
1981
|
-
function
|
|
1982
|
-
let i = r(te), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s &&
|
|
1985
|
+
function jr({ node: e, screen: t, activeScreen: n }) {
|
|
1986
|
+
let i = r(te), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && mr(o) ? (e) => {
|
|
1983
1987
|
e.preventDefault(), i.navigate(o);
|
|
1984
1988
|
} : void 0;
|
|
1985
1989
|
return /* @__PURE__ */ F("a", {
|
|
1986
|
-
href: s ? o.route :
|
|
1990
|
+
href: s ? o.route : wr(t),
|
|
1987
1991
|
rel: s ? "noreferrer" : void 0,
|
|
1988
1992
|
"aria-current": t === n ? "page" : void 0,
|
|
1989
1993
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
@@ -1997,7 +2001,7 @@ function Ar({ node: e, screen: t, activeScreen: n }) {
|
|
|
1997
2001
|
}), a !== "icon" && e.label]
|
|
1998
2002
|
});
|
|
1999
2003
|
}
|
|
2000
|
-
function
|
|
2004
|
+
function Mr({ element: e }) {
|
|
2001
2005
|
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(te), i = le(), a = z(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
|
|
2002
2006
|
return /* @__PURE__ */ F("div", {
|
|
2003
2007
|
"data-scene-outlet": t,
|
|
@@ -2018,15 +2022,15 @@ function jr({ element: e }) {
|
|
|
2018
2022
|
})]
|
|
2019
2023
|
});
|
|
2020
2024
|
}
|
|
2021
|
-
function
|
|
2022
|
-
let { activity: e } = r(
|
|
2025
|
+
function Nr() {
|
|
2026
|
+
let { activity: e } = r(Tr);
|
|
2023
2027
|
return e ? /* @__PURE__ */ P("p", {
|
|
2024
2028
|
className: "stage-activity",
|
|
2025
2029
|
role: "status",
|
|
2026
2030
|
children: e
|
|
2027
2031
|
}) : null;
|
|
2028
2032
|
}
|
|
2029
|
-
function
|
|
2033
|
+
function Pr() {
|
|
2030
2034
|
let e = k(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
2031
2035
|
return i(() => {
|
|
2032
2036
|
let r = e?.isDark ? "dark" : "light";
|
|
@@ -2037,25 +2041,25 @@ function Nr() {
|
|
|
2037
2041
|
n
|
|
2038
2042
|
]), null;
|
|
2039
2043
|
}
|
|
2040
|
-
var
|
|
2041
|
-
[
|
|
2042
|
-
[
|
|
2043
|
-
[
|
|
2044
|
-
"core:outlet":
|
|
2045
|
-
},
|
|
2044
|
+
var Fr = {
|
|
2045
|
+
[gr]: Or,
|
|
2046
|
+
[xr]: kr,
|
|
2047
|
+
[Dr]: Nr,
|
|
2048
|
+
"core:outlet": Mr
|
|
2049
|
+
}, Ir = [
|
|
2046
2050
|
"navigationMode",
|
|
2047
2051
|
"menuTheme",
|
|
2048
2052
|
"showFooter"
|
|
2049
|
-
],
|
|
2050
|
-
function
|
|
2053
|
+
], Lr = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2054
|
+
function Rr(e, t, n = !1) {
|
|
2051
2055
|
let r = [], i = t.options ?? {}, a = {
|
|
2052
2056
|
showFooter: !0,
|
|
2053
2057
|
followsSystem: !1,
|
|
2054
2058
|
problems: r
|
|
2055
2059
|
};
|
|
2056
2060
|
for (let [e, n] of Object.entries(i)) {
|
|
2057
|
-
if (!
|
|
2058
|
-
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${
|
|
2061
|
+
if (!Ir.includes(e)) {
|
|
2062
|
+
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Ir.join(", ")}.`);
|
|
2059
2063
|
continue;
|
|
2060
2064
|
}
|
|
2061
2065
|
if (e === "navigationMode") {
|
|
@@ -2072,9 +2076,9 @@ function Lr(e, t, n = !1) {
|
|
|
2072
2076
|
let e = a.followsSystem ? n : o.colorScheme === l.Dark;
|
|
2073
2077
|
a.colorScheme = e ? A.Dark : A.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
2074
2078
|
}
|
|
2075
|
-
return o?.accent !== void 0 && (
|
|
2079
|
+
return o?.accent !== void 0 && (Lr.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
|
|
2076
2080
|
}
|
|
2077
|
-
function
|
|
2081
|
+
function zr(e, t) {
|
|
2078
2082
|
if (e?.root === void 0) return [];
|
|
2079
2083
|
let n = /* @__PURE__ */ new Set([
|
|
2080
2084
|
m.RootTemplateUnknown,
|
|
@@ -2086,7 +2090,7 @@ function Rr(e, t) {
|
|
|
2086
2090
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
2087
2091
|
return r.length === 0 && t.origin !== h.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;
|
|
2088
2092
|
}
|
|
2089
|
-
function
|
|
2093
|
+
function Br(e) {
|
|
2090
2094
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
2091
2095
|
0,
|
|
2092
2096
|
2,
|
|
@@ -2094,7 +2098,7 @@ function zr(e) {
|
|
|
2094
2098
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
2095
2099
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
2096
2100
|
}
|
|
2097
|
-
function
|
|
2101
|
+
function Vr(e, t) {
|
|
2098
2102
|
if (t === void 0) return e;
|
|
2099
2103
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
2100
2104
|
0,
|
|
@@ -2106,18 +2110,18 @@ function Br(e, t) {
|
|
|
2106
2110
|
tokens: {
|
|
2107
2111
|
...e.tokens,
|
|
2108
2112
|
"primary.color": t,
|
|
2109
|
-
"primary.contrastColor":
|
|
2113
|
+
"primary.contrastColor": Br(t),
|
|
2110
2114
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
2111
2115
|
}
|
|
2112
2116
|
}));
|
|
2113
2117
|
}
|
|
2114
2118
|
//#endregion
|
|
2115
2119
|
//#region src/StageShellSettings.tsx
|
|
2116
|
-
var
|
|
2117
|
-
function
|
|
2120
|
+
var Hr = "(prefers-color-scheme: dark)";
|
|
2121
|
+
function Ur() {
|
|
2118
2122
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
2119
2123
|
}
|
|
2120
|
-
function
|
|
2124
|
+
function Wr({ settings: e, onSystemSchemeChange: t }) {
|
|
2121
2125
|
let n = s(we());
|
|
2122
2126
|
n.current = we();
|
|
2123
2127
|
let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
|
|
@@ -2131,16 +2135,16 @@ function Ur({ settings: e, onSystemSchemeChange: t }) {
|
|
|
2131
2135
|
c
|
|
2132
2136
|
]), i(() => {
|
|
2133
2137
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
2134
|
-
let n = globalThis.matchMedia(
|
|
2138
|
+
let n = globalThis.matchMedia(Hr), r = (e) => t(e.matches);
|
|
2135
2139
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
2136
2140
|
}, [e.followsSystem, t]), null;
|
|
2137
2141
|
}
|
|
2138
2142
|
//#endregion
|
|
2139
2143
|
//#region src/stageNavigationModel.ts
|
|
2140
|
-
function
|
|
2144
|
+
function Gr(e) {
|
|
2141
2145
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
2142
2146
|
}
|
|
2143
|
-
function
|
|
2147
|
+
function Kr(e) {
|
|
2144
2148
|
let t = /* @__PURE__ */ new Map();
|
|
2145
2149
|
for (let n of e) {
|
|
2146
2150
|
let e = (n.path ?? []).join(".");
|
|
@@ -2153,35 +2157,35 @@ function Gr(e) {
|
|
|
2153
2157
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
2154
2158
|
};
|
|
2155
2159
|
}
|
|
2156
|
-
function
|
|
2160
|
+
function qr(e) {
|
|
2157
2161
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
2158
2162
|
}
|
|
2159
|
-
function
|
|
2163
|
+
function Jr(e, t) {
|
|
2160
2164
|
return {
|
|
2161
2165
|
structure: e.structure ?? { modules: [] },
|
|
2162
2166
|
navigation: e.navigation ?? {
|
|
2163
2167
|
application: { regions: [] },
|
|
2164
2168
|
modules: []
|
|
2165
2169
|
},
|
|
2166
|
-
screenFor:
|
|
2167
|
-
moduleOf:
|
|
2170
|
+
screenFor: Kr(e.screens),
|
|
2171
|
+
moduleOf: qr(e.screens),
|
|
2168
2172
|
...t ? { isVisible: t } : {}
|
|
2169
2173
|
};
|
|
2170
2174
|
}
|
|
2171
2175
|
//#endregion
|
|
2172
2176
|
//#region src/stageSlices.ts
|
|
2173
|
-
function
|
|
2174
|
-
return (t) =>
|
|
2177
|
+
function Yr(e) {
|
|
2178
|
+
return (t) => Vt(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
2175
2179
|
name: e.name,
|
|
2176
2180
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
2177
|
-
label:
|
|
2181
|
+
label: Xr(e.name),
|
|
2178
2182
|
required: e.required
|
|
2179
2183
|
}));
|
|
2180
2184
|
}
|
|
2181
|
-
function
|
|
2185
|
+
function Xr(e) {
|
|
2182
2186
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
2183
2187
|
}
|
|
2184
|
-
function
|
|
2188
|
+
function Zr(e, t, n) {
|
|
2185
2189
|
return { invoke: async (r, i, a) => {
|
|
2186
2190
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
2187
2191
|
if (!U(o)) return {
|
|
@@ -2202,15 +2206,15 @@ function Xr(e, t, n) {
|
|
|
2202
2206
|
}
|
|
2203
2207
|
//#endregion
|
|
2204
2208
|
//#region src/App.tsx
|
|
2205
|
-
function
|
|
2206
|
-
return
|
|
2209
|
+
function Qr(e = {}) {
|
|
2210
|
+
return yr({
|
|
2207
2211
|
...e,
|
|
2208
|
-
...
|
|
2209
|
-
...
|
|
2212
|
+
...Qn,
|
|
2213
|
+
...Fr
|
|
2210
2214
|
});
|
|
2211
2215
|
}
|
|
2212
|
-
function
|
|
2213
|
-
return N(`form-${e}-${t.name}`,
|
|
2216
|
+
function $r(e, t) {
|
|
2217
|
+
return N(`form-${e}-${t.name}`, Vn, {
|
|
2214
2218
|
command: t.forCommand,
|
|
2215
2219
|
label: t.name,
|
|
2216
2220
|
generationMode: t.generationMode,
|
|
@@ -2218,43 +2222,43 @@ function Qr(e, t) {
|
|
|
2218
2222
|
fields: t.fields
|
|
2219
2223
|
});
|
|
2220
2224
|
}
|
|
2221
|
-
function
|
|
2225
|
+
function ei(e, t) {
|
|
2222
2226
|
let n = e.screens[0];
|
|
2223
2227
|
return _e(e, n, {
|
|
2224
|
-
profile:
|
|
2228
|
+
profile: _r(e.uiProfiles),
|
|
2225
2229
|
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2226
2230
|
});
|
|
2227
2231
|
}
|
|
2228
|
-
function
|
|
2229
|
-
let s =
|
|
2232
|
+
function ti(e, t, n, r, i, a, o = !0) {
|
|
2233
|
+
let s = Gr(e.navigation), c = e.navigation?.application.logo ? {
|
|
2230
2234
|
title: e.navigation.application.logo.title,
|
|
2231
2235
|
image: e.navigation.application.logo.image || void 0
|
|
2232
2236
|
} : void 0;
|
|
2233
2237
|
return {
|
|
2234
|
-
profile:
|
|
2235
|
-
catalog:
|
|
2238
|
+
profile: _r(e.uiProfiles),
|
|
2239
|
+
catalog: br(r),
|
|
2236
2240
|
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
2237
|
-
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]:
|
|
2238
|
-
form:
|
|
2239
|
-
trailing: [N("activity",
|
|
2241
|
+
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Cr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Cr(e.screens, r.name, t, n, c, s, o),
|
|
2242
|
+
form: $r,
|
|
2243
|
+
trailing: [N("activity", Dr)],
|
|
2240
2244
|
decorate: (e) => {
|
|
2241
|
-
let t =
|
|
2245
|
+
let t = tr(e);
|
|
2242
2246
|
return i ? y(t, i) : t;
|
|
2243
2247
|
}
|
|
2244
2248
|
};
|
|
2245
2249
|
}
|
|
2246
|
-
function
|
|
2247
|
-
return pe(e, t,
|
|
2250
|
+
function ni(e, t, n, r, i, a) {
|
|
2251
|
+
return pe(e, t, ti(e, n, r, i, void 0, a)).element;
|
|
2248
2252
|
}
|
|
2249
|
-
function
|
|
2253
|
+
function ri() {
|
|
2250
2254
|
try {
|
|
2251
2255
|
return globalThis.localStorage ?? null;
|
|
2252
2256
|
} catch {
|
|
2253
2257
|
return null;
|
|
2254
2258
|
}
|
|
2255
2259
|
}
|
|
2256
|
-
function
|
|
2257
|
-
let s =
|
|
2260
|
+
function ii({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
|
|
2261
|
+
let s = I(), l = o(() => Qr(e), [e]), [u, d] = c(), [f, p] = c(""), m = Je(), h = $n();
|
|
2258
2262
|
return i(() => {
|
|
2259
2263
|
let e = new AbortController();
|
|
2260
2264
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2266,7 +2270,7 @@ function ri({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2266
2270
|
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2267
2271
|
className: "stage-message",
|
|
2268
2272
|
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2269
|
-
}) : u ? /* @__PURE__ */ P(
|
|
2273
|
+
}) : u ? /* @__PURE__ */ P(ai, {
|
|
2270
2274
|
scene: u,
|
|
2271
2275
|
registry: l,
|
|
2272
2276
|
routeState: m,
|
|
@@ -2279,16 +2283,16 @@ function ri({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2279
2283
|
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2280
2284
|
});
|
|
2281
2285
|
}
|
|
2282
|
-
function
|
|
2283
|
-
let u = o(() => D(), []), [d, f] = c(
|
|
2286
|
+
function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
|
|
2287
|
+
let u = o(() => D(), []), [d, f] = c(Ur), p = e.screens[0]?.name ?? "", m = o(() => _r(e.uiProfiles), [e]), h = o(() => p ? ei(e, s) : void 0, [
|
|
2284
2288
|
e,
|
|
2285
2289
|
s,
|
|
2286
2290
|
p
|
|
2287
|
-
]), g = o(() => h ?
|
|
2291
|
+
]), g = o(() => h ? zr(m, h) : [], [m, h]), _ = o(() => h ? Rr(m, h, d) : void 0, [
|
|
2288
2292
|
m,
|
|
2289
2293
|
h,
|
|
2290
2294
|
d
|
|
2291
|
-
]), v = o(() =>
|
|
2295
|
+
]), v = o(() => Vr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => ti(e, i.locales, i.locale, a, i.dictionary, s, y), [
|
|
2292
2296
|
e,
|
|
2293
2297
|
i.locales,
|
|
2294
2298
|
i.locale,
|
|
@@ -2296,7 +2300,7 @@ function ii({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2296
2300
|
a,
|
|
2297
2301
|
s,
|
|
2298
2302
|
y
|
|
2299
|
-
]), x = n((e) => f(e), []), S = o(() =>
|
|
2303
|
+
]), x = n((e) => f(e), []), S = o(() => Jr(e, l), [e, l]), C = e;
|
|
2300
2304
|
return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
|
|
2301
2305
|
className: "stage-message",
|
|
2302
2306
|
role: "alert",
|
|
@@ -2313,8 +2317,8 @@ function ii({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2313
2317
|
registry: t,
|
|
2314
2318
|
initialScreen: p,
|
|
2315
2319
|
history: u,
|
|
2316
|
-
layoutConfigStorage:
|
|
2317
|
-
scope: (t, n) => /* @__PURE__ */ P(
|
|
2320
|
+
layoutConfigStorage: ri(),
|
|
2321
|
+
scope: (t, n) => /* @__PURE__ */ P(oi, {
|
|
2318
2322
|
scene: e,
|
|
2319
2323
|
routeState: r,
|
|
2320
2324
|
strings: i,
|
|
@@ -2324,13 +2328,13 @@ function ii({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2324
2328
|
onSystemSchemeChange: x,
|
|
2325
2329
|
children: n
|
|
2326
2330
|
}),
|
|
2327
|
-
renderScreen: (e, n) => /* @__PURE__ */ P(
|
|
2331
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(ci, {
|
|
2328
2332
|
element: e,
|
|
2329
2333
|
configuration: n,
|
|
2330
2334
|
registry: t
|
|
2331
2335
|
}),
|
|
2332
|
-
renderDialog: () => /* @__PURE__ */ P(
|
|
2333
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(
|
|
2336
|
+
renderDialog: () => /* @__PURE__ */ P(Xn, {}),
|
|
2337
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(li, {
|
|
2334
2338
|
template: e,
|
|
2335
2339
|
content: n,
|
|
2336
2340
|
registry: t,
|
|
@@ -2342,7 +2346,7 @@ function ii({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2342
2346
|
children: [/* @__PURE__ */ P("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ P("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
2343
2347
|
});
|
|
2344
2348
|
}
|
|
2345
|
-
function
|
|
2349
|
+
function oi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2346
2350
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2347
2351
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2348
2352
|
let e = (e) => {
|
|
@@ -2362,11 +2366,11 @@ function ai({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2362
2366
|
}, [p, e]), /* @__PURE__ */ F(de, {
|
|
2363
2367
|
themes: a,
|
|
2364
2368
|
children: [
|
|
2365
|
-
o && /* @__PURE__ */ P(
|
|
2369
|
+
o && /* @__PURE__ */ P(Wr, {
|
|
2366
2370
|
settings: o,
|
|
2367
2371
|
onSystemSchemeChange: s
|
|
2368
2372
|
}),
|
|
2369
|
-
/* @__PURE__ */ P(
|
|
2373
|
+
/* @__PURE__ */ P(Pr, {}),
|
|
2370
2374
|
/* @__PURE__ */ P(mt, {
|
|
2371
2375
|
routes: t.routes,
|
|
2372
2376
|
routesReady: t.ready,
|
|
@@ -2374,7 +2378,7 @@ function ai({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2374
2378
|
locale: n.locale,
|
|
2375
2379
|
locales: n.locales,
|
|
2376
2380
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2377
|
-
children: /* @__PURE__ */ P(
|
|
2381
|
+
children: /* @__PURE__ */ P(si, {
|
|
2378
2382
|
activity: d,
|
|
2379
2383
|
routesReady: t.ready,
|
|
2380
2384
|
scene: e,
|
|
@@ -2386,12 +2390,12 @@ function ai({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2386
2390
|
]
|
|
2387
2391
|
});
|
|
2388
2392
|
}
|
|
2389
|
-
function
|
|
2390
|
-
let s = z(), c = ce(), l =
|
|
2393
|
+
function si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2394
|
+
let s = z(), c = ce(), l = Lt(), d = o(() => Zr(l, t, s.refreshAfterCommand), [
|
|
2391
2395
|
l,
|
|
2392
2396
|
t,
|
|
2393
2397
|
s.refreshAfterCommand
|
|
2394
|
-
]), f = o(() =>
|
|
2398
|
+
]), f = o(() => Yr(n.commandSchemas), [n.commandSchemas]), p = ae({
|
|
2395
2399
|
executeCommand: async (e, n) => {
|
|
2396
2400
|
let i = U(e);
|
|
2397
2401
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
@@ -2410,7 +2414,7 @@ function oi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2410
2414
|
};
|
|
2411
2415
|
},
|
|
2412
2416
|
navigate: (e, t) => {
|
|
2413
|
-
n.screens.some((t) => t.name === e) ? W(e,
|
|
2417
|
+
n.screens.some((t) => t.name === e) ? W(e, zt(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
2414
2418
|
},
|
|
2415
2419
|
navigateBack: () => globalThis.history?.back(),
|
|
2416
2420
|
openDialog: async (e) => {
|
|
@@ -2427,7 +2431,7 @@ function oi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2427
2431
|
refreshQuery: async (e) => s.refreshQuery(e),
|
|
2428
2432
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
2429
2433
|
});
|
|
2430
|
-
return /* @__PURE__ */ P(
|
|
2434
|
+
return /* @__PURE__ */ P(Er, {
|
|
2431
2435
|
state: {
|
|
2432
2436
|
locales: i.locales,
|
|
2433
2437
|
locale: i.locale,
|
|
@@ -2452,9 +2456,9 @@ function oi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2452
2456
|
})
|
|
2453
2457
|
});
|
|
2454
2458
|
}
|
|
2455
|
-
function
|
|
2459
|
+
function ci({ element: e, configuration: t, registry: n }) {
|
|
2456
2460
|
let r = z(), i = jt();
|
|
2457
|
-
return /* @__PURE__ */ F(De, { children: [/* @__PURE__ */ P(
|
|
2461
|
+
return /* @__PURE__ */ F(De, { children: [/* @__PURE__ */ P(lr, { element: e }), /* @__PURE__ */ P(w, {
|
|
2458
2462
|
element: e,
|
|
2459
2463
|
registry: n,
|
|
2460
2464
|
resolveBinding: r.resolveBinding,
|
|
@@ -2463,7 +2467,7 @@ function si({ element: e, configuration: t, registry: n }) {
|
|
|
2463
2467
|
configuration: t
|
|
2464
2468
|
})] });
|
|
2465
2469
|
}
|
|
2466
|
-
function
|
|
2470
|
+
function li({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
2467
2471
|
let o = z(), s = jt(), c = y(t, r.dictionary);
|
|
2468
2472
|
return i(() => {
|
|
2469
2473
|
let e = (e) => {
|
|
@@ -2493,9 +2497,9 @@ function ci({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2493
2497
|
}
|
|
2494
2498
|
//#endregion
|
|
2495
2499
|
//#region src/stageTheme.ts
|
|
2496
|
-
var
|
|
2497
|
-
preset:
|
|
2498
|
-
options: { darkModeSelector:
|
|
2500
|
+
var ui = "[data-scene-color-scheme='dark']", di = {
|
|
2501
|
+
preset: Ue,
|
|
2502
|
+
options: { darkModeSelector: ui }
|
|
2499
2503
|
};
|
|
2500
2504
|
//#endregion
|
|
2501
|
-
export {
|
|
2505
|
+
export { ii as App, ii as StageApplication, sn as StageCommandForm, mt as StageDataProvider, zn as StageGuardedAction, qe as StageSourceProvider, ni as composeStageScreen, Zr as createStageSliceInvoker, ht as dataChanged, Ft as executeRegisteredCommand, U as registeredCommand, Yr as sliceFieldsFrom, Qr as stageApplicationRegistry, ti as stageComposition, ui as stageDarkSelector, Ge as stageEndpoints, ei as stageShellOf, di as stageTheme, We as staticStageSource, Lt as useStageCommandExecutor, z as useStageData, B as useStageQuery, I as useStageSource };
|