@declarion/react 0.36.3 → 0.36.5
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-lib/{DraggableChildrenTable-ChUh120M.js → DraggableChildrenTable-BfErdVdt.js} +35 -35
- package/dist-lib/{Grid-DT9wV-D7.js → Grid-D0ckegd1.js} +41 -41
- package/dist-lib/{LayoutRenderer-0UKE3pp6.js → LayoutRenderer-BGeN0rwC.js} +465 -465
- package/dist-lib/{MarkdownRenderer-CvURrJCu.js → MarkdownRenderer-14LG1clY.js} +1 -1
- package/dist-lib/{RefreshControl-CX_D6PcA.js → RefreshControl-Bpd9kw0G.js} +45 -45
- package/dist-lib/{SmartDetailPage.impl-Ccz4TqfJ.js → SmartDetailPage.impl-BaXAi7OH.js} +234 -234
- package/dist-lib/{SmartRecordListPage.impl-Y0w4oIe3.js → SmartRecordListPage.impl-CgiZWbF3.js} +189 -189
- package/dist-lib/index.d.ts +1 -1
- package/dist-lib/index.js +1510 -1526
- package/dist-lib/{registry-D_zbJrLC.js → registry-KMbQkTF6.js} +1036 -1034
- package/dist-lib/testing.d.ts +8 -0
- package/dist-lib/testing.js +63 -60
- package/dist-lib/{ActionRunner-BrXXs8ga.js → useCurrentScreen-Bgp6_vne.js} +18 -2
- package/dist-lib/{useProperties-C_1KM72K.js → useProperties-DMT162ot.js} +68 -68
- package/dist-lib/{value-BBnVc95O.js → value-CUVtVjKI.js} +22 -22
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-BWO6QtNF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as t, Gn as n, Hn as r, Kn as i, Nn as a, Pn as o, Wn as s, _t as c, et as l, i as u, jt as d, ot as f, un as p, xn as m } from "./useCurrentScreen-Bgp6_vne.js";
|
|
3
3
|
import { useCallback as h, useEffect as g, useId as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
4
4
|
import { useLocation as x } from "react-router-dom";
|
|
5
5
|
import { useQuery as S, useQueryClient as C } from "@tanstack/react-query";
|
|
@@ -182,7 +182,7 @@ function ce(e) {
|
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/api/params.ts
|
|
184
184
|
async function le() {
|
|
185
|
-
let e = (await
|
|
185
|
+
let e = (await d("/api/params/public")).data;
|
|
186
186
|
if (Array.isArray(e)) return { parameters: e };
|
|
187
187
|
let t = e ?? {};
|
|
188
188
|
return {
|
|
@@ -193,7 +193,7 @@ async function le() {
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
async function z(e) {
|
|
196
|
-
return (await
|
|
196
|
+
return (await d(`/api/params/${encodeURIComponent(e)}`)).data;
|
|
197
197
|
}
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/hooks/useParams.ts
|
|
@@ -214,7 +214,7 @@ function V(e, t = {}) {
|
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
function H(e) {
|
|
217
|
-
let t =
|
|
217
|
+
let t = c((e) => e.isAuthenticated), n = B(), r = V(e, { enabled: t }), i = ue(n.data?.parameters, e);
|
|
218
218
|
if (t && r.data?.found) return {
|
|
219
219
|
value: r.data.value,
|
|
220
220
|
found: !0,
|
|
@@ -394,11 +394,11 @@ function me(e) {
|
|
|
394
394
|
return e.length > 1 && e.endsWith("/") ? e.replace(/\/+$/, "") || "/" : e;
|
|
395
395
|
}
|
|
396
396
|
function Q(e) {
|
|
397
|
-
let t = me(e.pathname), n = e.search ?? "", r = n.startsWith("?") ? n.slice(1) : n,
|
|
398
|
-
for (let e of
|
|
399
|
-
|
|
400
|
-
let
|
|
401
|
-
return
|
|
397
|
+
let t = me(e.pathname), n = e.search ?? "", r = n.startsWith("?") ? n.slice(1) : n, i = new URLSearchParams(r);
|
|
398
|
+
for (let e of l) i.delete(e);
|
|
399
|
+
i.sort();
|
|
400
|
+
let a = i.toString();
|
|
401
|
+
return a ? `${t}?${a}` : t;
|
|
402
402
|
}
|
|
403
403
|
function he(e) {
|
|
404
404
|
return me(e.pathname);
|
|
@@ -453,20 +453,20 @@ var Ce = "record-documents";
|
|
|
453
453
|
//#endregion
|
|
454
454
|
//#region src/hooks/useBrandingChrome.ts
|
|
455
455
|
function we() {
|
|
456
|
-
let e =
|
|
457
|
-
return (e.enabled ?
|
|
456
|
+
let e = t(), n = G();
|
|
457
|
+
return (e.enabled ? n?.embed?.viewport : n?.full?.viewport) ?? "auto";
|
|
458
458
|
}
|
|
459
459
|
function Te(e) {
|
|
460
|
-
let
|
|
460
|
+
let n = t(), r = G();
|
|
461
461
|
return v(() => {
|
|
462
|
-
let
|
|
462
|
+
let t = { ...n.enabled ? r?.embed?.surfaces?.[e] : r?.full?.surfaces?.[e] };
|
|
463
463
|
return {
|
|
464
|
-
...
|
|
465
|
-
isVisible: (e) =>
|
|
464
|
+
...t,
|
|
465
|
+
isVisible: (e) => t[e] !== !1
|
|
466
466
|
};
|
|
467
467
|
}, [
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
r,
|
|
469
|
+
n.enabled,
|
|
470
470
|
e
|
|
471
471
|
]);
|
|
472
472
|
}
|
|
@@ -499,19 +499,19 @@ function ke(e, t) {
|
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region src/components/pages/DocumentsMenu.tsx
|
|
501
501
|
var Ae = "document-templates-available";
|
|
502
|
-
function je({ entityCode:
|
|
503
|
-
let { run: m } =
|
|
504
|
-
queryKey: [Ae,
|
|
505
|
-
queryFn: async () => (await
|
|
502
|
+
function je({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selectedIds: c = [], capability: l, canManageTemplates: d = !1 }) {
|
|
503
|
+
let { run: m } = u(), h = y(null), [g, _] = b(!1), x = n === "detail" ? !!l?.generate_one : !!l?.generate_many, C = d && !x, { data: D, isLoading: O, error: k } = S({
|
|
504
|
+
queryKey: [Ae, t],
|
|
505
|
+
queryFn: async () => (await f("document.templates.available", { entity: t })).result?.templates ?? [],
|
|
506
506
|
enabled: g || C,
|
|
507
507
|
staleTime: 6e4
|
|
508
|
-
}), A = O, j = v(() => (D ?? []).filter((e) =>
|
|
508
|
+
}), A = O, j = v(() => (D ?? []).filter((e) => n === "detail" ? e.input_mode === "one" || e.input_mode === "global" : e.input_mode === "many" || e.input_mode === "global"), [n, D]), M = C && j.length > 0, N = x || M;
|
|
509
509
|
function P() {
|
|
510
510
|
_((e) => !e);
|
|
511
511
|
}
|
|
512
512
|
function F(e) {
|
|
513
513
|
if (e.input_mode === "global") return [{ kind: "global" }];
|
|
514
|
-
if (
|
|
514
|
+
if (n === "detail") return e.input_mode === "one" && a.length === 1 ? [{
|
|
515
515
|
kind: "one",
|
|
516
516
|
objectIds: a
|
|
517
517
|
}] : [];
|
|
@@ -520,15 +520,15 @@ function je({ entityCode: n, scope: i, objectIds: a = [], viewState: s, selected
|
|
|
520
520
|
return s && e.push({
|
|
521
521
|
kind: "current_view",
|
|
522
522
|
query: Oe(s)
|
|
523
|
-
}),
|
|
523
|
+
}), c.length > 0 && e.push({
|
|
524
524
|
kind: "selected",
|
|
525
|
-
objectIds:
|
|
525
|
+
objectIds: c
|
|
526
526
|
}), e;
|
|
527
527
|
}
|
|
528
528
|
return [];
|
|
529
529
|
}
|
|
530
530
|
function I(e, t, n) {
|
|
531
|
-
let r = Me(e), i =
|
|
531
|
+
let r = Me(e), i = p(e.name) || e.code;
|
|
532
532
|
_(!1), m({
|
|
533
533
|
action: r,
|
|
534
534
|
title: i,
|
|
@@ -541,11 +541,11 @@ function je({ entityCode: n, scope: i, objectIds: a = [], viewState: s, selected
|
|
|
541
541
|
return Object.keys(r).length > 0 && (i.params = r), "objectIds" in t && (i.object_ids = t.objectIds), "query" in t && (i.query = {
|
|
542
542
|
scope: "current_view",
|
|
543
543
|
query: t.query
|
|
544
|
-
}),
|
|
544
|
+
}), f("document.generate", i);
|
|
545
545
|
}
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
return N ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(
|
|
548
|
+
return N ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(i, {
|
|
549
549
|
ref: h,
|
|
550
550
|
kind: "ghost",
|
|
551
551
|
size: "sm",
|
|
@@ -553,45 +553,45 @@ function je({ entityCode: n, scope: i, objectIds: a = [], viewState: s, selected
|
|
|
553
553
|
onClick: P,
|
|
554
554
|
disabled: A,
|
|
555
555
|
children: "Generate"
|
|
556
|
-
}), /* @__PURE__ */ E(
|
|
556
|
+
}), /* @__PURE__ */ E(r, {
|
|
557
557
|
open: g,
|
|
558
558
|
anchor: h.current,
|
|
559
559
|
onClose: () => _(!1),
|
|
560
560
|
align: "end",
|
|
561
561
|
width: 300,
|
|
562
562
|
children: [
|
|
563
|
-
A && /* @__PURE__ */ T(
|
|
563
|
+
A && /* @__PURE__ */ T(o, {
|
|
564
564
|
disabled: !0,
|
|
565
565
|
icon: /* @__PURE__ */ T(e.loader, { size: 12 }),
|
|
566
566
|
children: "Loading templates..."
|
|
567
567
|
}),
|
|
568
|
-
k && /* @__PURE__ */ T(
|
|
568
|
+
k && /* @__PURE__ */ T(o, {
|
|
569
569
|
disabled: !0,
|
|
570
570
|
icon: /* @__PURE__ */ T(e.warning, { size: 12 }),
|
|
571
571
|
children: k instanceof Error ? k.message : String(k)
|
|
572
572
|
}),
|
|
573
|
-
!A && !k && j.length === 0 && /* @__PURE__ */ T(
|
|
573
|
+
!A && !k && j.length === 0 && /* @__PURE__ */ T(o, {
|
|
574
574
|
disabled: !0,
|
|
575
575
|
icon: /* @__PURE__ */ T(e.file, { size: 12 }),
|
|
576
576
|
children: "No document templates"
|
|
577
577
|
}),
|
|
578
578
|
!A && !k && j.map((t) => {
|
|
579
579
|
let n = F(t);
|
|
580
|
-
return n.length === 0 ? null : Ne(t).flatMap((
|
|
580
|
+
return n.length === 0 ? null : Ne(t).flatMap((r) => n.map((n) => r.available ? /* @__PURE__ */ T(o, {
|
|
581
581
|
icon: /* @__PURE__ */ T(e.file, { size: 12 }),
|
|
582
|
-
onClick: () => I(t, n,
|
|
583
|
-
title:
|
|
584
|
-
children: Pe(t, n,
|
|
585
|
-
}, `${t.source}:${t.code}:${n.kind}:${
|
|
582
|
+
onClick: () => I(t, n, r.format),
|
|
583
|
+
title: p(t.description),
|
|
584
|
+
children: Pe(t, n, r.format)
|
|
585
|
+
}, `${t.source}:${t.code}:${n.kind}:${r.format}`) : /* @__PURE__ */ E(o, {
|
|
586
586
|
disabled: !0,
|
|
587
587
|
icon: /* @__PURE__ */ T(e.file, { size: 12 }),
|
|
588
|
-
title:
|
|
588
|
+
title: r.disabled_reason,
|
|
589
589
|
children: [
|
|
590
|
-
Pe(t, n,
|
|
590
|
+
Pe(t, n, r.format),
|
|
591
591
|
" - ",
|
|
592
|
-
|
|
592
|
+
r.disabled_reason || "Unavailable"
|
|
593
593
|
]
|
|
594
|
-
}, `${t.source}:${t.code}:${n.kind}:${
|
|
594
|
+
}, `${t.source}:${t.code}:${n.kind}:${r.format}:disabled`)));
|
|
595
595
|
})
|
|
596
596
|
]
|
|
597
597
|
})] }) : null;
|
|
@@ -618,7 +618,7 @@ function Ne(e) {
|
|
|
618
618
|
}));
|
|
619
619
|
}
|
|
620
620
|
function Pe(e, t, n) {
|
|
621
|
-
let r =
|
|
621
|
+
let r = p(e.name) || e.code, i = n ? ` (${n.toUpperCase()})` : "";
|
|
622
622
|
switch (t.kind) {
|
|
623
623
|
case "one": return `${r}${i}`;
|
|
624
624
|
case "selected": return `${r}${i} - selected rows`;
|
|
@@ -808,11 +808,11 @@ function Ze({ liveObject: t, realtime: r = !0 }) {
|
|
|
808
808
|
alignItems: "center",
|
|
809
809
|
gap: 8
|
|
810
810
|
},
|
|
811
|
-
children: [/* @__PURE__ */ T(
|
|
811
|
+
children: [/* @__PURE__ */ T(n, {
|
|
812
812
|
icon: t.isFetching ? /* @__PURE__ */ T("span", {
|
|
813
813
|
"data-testid": "refresh-spinner",
|
|
814
814
|
style: { display: "inline-flex" },
|
|
815
|
-
children: /* @__PURE__ */ T(
|
|
815
|
+
children: /* @__PURE__ */ T(a, { size: 14 })
|
|
816
816
|
}) : /* @__PURE__ */ T(e.refresh, { size: 14 }),
|
|
817
817
|
title: "Refresh",
|
|
818
818
|
disabled: t.isLoading || t.isFetching,
|
|
@@ -822,7 +822,7 @@ function Ze({ liveObject: t, realtime: r = !0 }) {
|
|
|
822
822
|
}), r && /* @__PURE__ */ T("span", {
|
|
823
823
|
"data-testid": "live-indicator",
|
|
824
824
|
title: t.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
|
|
825
|
-
children: /* @__PURE__ */ T(
|
|
825
|
+
children: /* @__PURE__ */ T(s, {
|
|
826
826
|
tone: t.isLive ? "emerald" : "amber",
|
|
827
827
|
size: "xs",
|
|
828
828
|
dot: !0,
|