@burojs/ui-shadcn 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bulk-summary-CrEij5vq.cjs → bulk-summary-2HLgz7Il.cjs} +31 -5
- package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
- package/dist/{bulk-summary-BWSAS7k2.js → bulk-summary-D6A0ua21.js} +32 -6
- package/dist/bulk-summary-D6A0ua21.js.map +1 -0
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js → candidates-relation-picker-QvoY2bOQ.js} +3 -3
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js.map → candidates-relation-picker-QvoY2bOQ.js.map} +1 -1
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs → candidates-relation-picker-pEAWKQEY.cjs} +3 -3
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs.map → candidates-relation-picker-pEAWKQEY.cjs.map} +1 -1
- package/dist/{check-confirm-dialog-2j0gOd7x.js → check-confirm-dialog-B-CbJTln.js} +68 -8
- package/dist/{check-confirm-dialog-2j0gOd7x.js.map → check-confirm-dialog-B-CbJTln.js.map} +1 -1
- package/dist/{check-confirm-dialog-C-NHgMST.cjs → check-confirm-dialog-W-8WOmGh.cjs} +72 -6
- package/dist/check-confirm-dialog-W-8WOmGh.cjs.map +1 -0
- package/dist/{filter-builder-DaWHUZuV.js → filter-builder-04nas3eq.js} +127 -61
- package/dist/filter-builder-04nas3eq.js.map +1 -0
- package/dist/{filter-builder-DFu0JP-1.cjs → filter-builder-DQX-TMFh.cjs} +140 -68
- package/dist/filter-builder-DQX-TMFh.cjs.map +1 -0
- package/dist/{flow-runtime-DyqTmK3H.js → flow-runtime-BEIyym7d.js} +7 -4
- package/dist/{flow-runtime-DyqTmK3H.js.map → flow-runtime-BEIyym7d.js.map} +1 -1
- package/dist/{flow-runtime-BpmrIUb6.cjs → flow-runtime-DyNIYfUP.cjs} +7 -4
- package/dist/{flow-runtime-BpmrIUb6.cjs.map → flow-runtime-DyNIYfUP.cjs.map} +1 -1
- package/dist/{flow-screen-DCdli6Ha.js → flow-screen-DY1Z9PbG.js} +56 -15
- package/dist/flow-screen-DY1Z9PbG.js.map +1 -0
- package/dist/{flow-screen-Bcz9NF2V.cjs → flow-screen-FE5Xhb3t.cjs} +54 -13
- package/dist/flow-screen-FE5Xhb3t.cjs.map +1 -0
- package/dist/index.cjs +564 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +235 -95
- package/dist/index.d.ts +235 -95
- package/dist/index.js +562 -169
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-C0rI9B7f.js → inline-flow-host-D6u-RlsV.js} +3 -3
- package/dist/{inline-flow-host-C0rI9B7f.js.map → inline-flow-host-D6u-RlsV.js.map} +1 -1
- package/dist/{inline-flow-host-3vw7LzzD.cjs → inline-flow-host-yVLo6-sM.cjs} +3 -3
- package/dist/{inline-flow-host-3vw7LzzD.cjs.map → inline-flow-host-yVLo6-sM.cjs.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js → lazy-relation-picker-dialog-BaORufxQ.js} +2 -2
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js.map → lazy-relation-picker-dialog-BaORufxQ.js.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs → lazy-relation-picker-dialog-C_VlGlDz.cjs} +2 -2
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs.map → lazy-relation-picker-dialog-C_VlGlDz.cjs.map} +1 -1
- package/dist/{page-flow-route-BHUEpn0I.js → page-flow-route-CyMzUidK.js} +8 -9
- package/dist/page-flow-route-CyMzUidK.js.map +1 -0
- package/dist/{page-flow-route-DS8IVTVH.cjs → page-flow-route-OFx7h7Ja.cjs} +8 -9
- package/dist/page-flow-route-OFx7h7Ja.cjs.map +1 -0
- package/dist/{place-node-CNb3w-c7.cjs → place-node-BZF5Af6x.cjs} +224 -151
- package/dist/place-node-BZF5Af6x.cjs.map +1 -0
- package/dist/{place-node-CfzQvh4Y.js → place-node-DRjmJGQ_.js} +210 -125
- package/dist/place-node-DRjmJGQ_.js.map +1 -0
- package/dist/{related-list-cards-BIqqY69Y.js → related-list-cards-2hLitVkg.js} +3 -3
- package/dist/{related-list-cards-BIqqY69Y.js.map → related-list-cards-2hLitVkg.js.map} +1 -1
- package/dist/{related-list-cards-CelMxl4q.cjs → related-list-cards-xVvgSlu-.cjs} +3 -3
- package/dist/{related-list-cards-CelMxl4q.cjs.map → related-list-cards-xVvgSlu-.cjs.map} +1 -1
- package/dist/related-list-timeline-CxJqe6eK.js +167 -0
- package/dist/related-list-timeline-CxJqe6eK.js.map +1 -0
- package/dist/related-list-timeline-Dsf5WewG.cjs +167 -0
- package/dist/related-list-timeline-Dsf5WewG.cjs.map +1 -0
- package/dist/{related-rows-MPnLCmPF.cjs → related-rows-DDhp9axl.cjs} +4 -4
- package/dist/{related-rows-MPnLCmPF.cjs.map → related-rows-DDhp9axl.cjs.map} +1 -1
- package/dist/{related-rows--uP2iKQC.js → related-rows-DL6CWsrj.js} +4 -4
- package/dist/{related-rows--uP2iKQC.js.map → related-rows-DL6CWsrj.js.map} +1 -1
- package/dist/{relation-create-C43cdPQt.js → relation-create-6WicROWA.js} +33 -5
- package/dist/relation-create-6WicROWA.js.map +1 -0
- package/dist/{relation-create-DDEYcKfw.cjs → relation-create-_SFuPQGM.cjs} +37 -3
- package/dist/relation-create-_SFuPQGM.cjs.map +1 -0
- package/dist/{relation-many-picker-DzuGJpEl.cjs → relation-many-picker-BBNsmkaX.cjs} +18 -11
- package/dist/relation-many-picker-BBNsmkaX.cjs.map +1 -0
- package/dist/{relation-many-picker-BJhaEqxz.js → relation-many-picker-mGEQDWo2.js} +18 -11
- package/dist/relation-many-picker-mGEQDWo2.js.map +1 -0
- package/dist/{relation-picker-D-tBBZW_.js → relation-picker-BbO41cFV.js} +19 -11
- package/dist/relation-picker-BbO41cFV.js.map +1 -0
- package/dist/{relation-picker-dialog-DoEY8EkH.js → relation-picker-dialog-BgSG_8bU.js} +5 -5
- package/dist/relation-picker-dialog-BgSG_8bU.js.map +1 -0
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs → relation-picker-dialog-Duqy2r0n.cjs} +5 -5
- package/dist/relation-picker-dialog-Duqy2r0n.cjs.map +1 -0
- package/dist/{relation-picker-DaIMzf2H.cjs → relation-picker-jk9D_uwn.cjs} +19 -11
- package/dist/relation-picker-jk9D_uwn.cjs.map +1 -0
- package/dist/{relation-select-Cr3CfNLy.cjs → relation-select-C3aV18kT.cjs} +2 -2
- package/dist/{relation-select-Cr3CfNLy.cjs.map → relation-select-C3aV18kT.cjs.map} +1 -1
- package/dist/{relation-select-B8Fq4o-t.js → relation-select-CjQT9LpS.js} +2 -2
- package/dist/{relation-select-B8Fq4o-t.js.map → relation-select-CjQT9LpS.js.map} +1 -1
- package/dist/{resource-page-router-Diw6S6TK.js → resource-page-router-CzaNATSp.js} +209 -30
- package/dist/resource-page-router-CzaNATSp.js.map +1 -0
- package/dist/{resource-page-router-C_kGW2o_.cjs → resource-page-router-dmVIeu5s.cjs} +235 -32
- package/dist/resource-page-router-dmVIeu5s.cjs.map +1 -0
- package/dist/{success-notices-Dl3M1fZP.cjs → success-notices-Cl4b6MLQ.cjs} +3 -2
- package/dist/success-notices-Cl4b6MLQ.cjs.map +1 -0
- package/dist/{success-notices-LDEgEkc4.js → success-notices-CrcWOGSo.js} +3 -2
- package/dist/success-notices-CrcWOGSo.js.map +1 -0
- package/dist/{use-dialog-filter-state-B_MqzHaT.js → use-dialog-filter-state-CJoeY-1j.js} +2 -2
- package/dist/{use-dialog-filter-state-B_MqzHaT.js.map → use-dialog-filter-state-CJoeY-1j.js.map} +1 -1
- package/dist/{use-dialog-filter-state-tNvqAAjh.cjs → use-dialog-filter-state-lsTJxrB4.cjs} +2 -2
- package/dist/{use-dialog-filter-state-tNvqAAjh.cjs.map → use-dialog-filter-state-lsTJxrB4.cjs.map} +1 -1
- package/dist/use-record-subtitle-BJ9rnj6F.cjs +67 -0
- package/dist/use-record-subtitle-BJ9rnj6F.cjs.map +1 -0
- package/dist/use-record-subtitle-w3ZhXNlf.js +50 -0
- package/dist/use-record-subtitle-w3ZhXNlf.js.map +1 -0
- package/package.json +9 -9
- package/dist/bulk-summary-BWSAS7k2.js.map +0 -1
- package/dist/bulk-summary-CrEij5vq.cjs.map +0 -1
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +0 -1
- package/dist/filter-builder-DFu0JP-1.cjs.map +0 -1
- package/dist/filter-builder-DaWHUZuV.js.map +0 -1
- package/dist/flow-screen-Bcz9NF2V.cjs.map +0 -1
- package/dist/flow-screen-DCdli6Ha.js.map +0 -1
- package/dist/page-flow-route-BHUEpn0I.js.map +0 -1
- package/dist/page-flow-route-DS8IVTVH.cjs.map +0 -1
- package/dist/place-node-CNb3w-c7.cjs.map +0 -1
- package/dist/place-node-CfzQvh4Y.js.map +0 -1
- package/dist/related-list-timeline-CRh7xwLD.js +0 -141
- package/dist/related-list-timeline-CRh7xwLD.js.map +0 -1
- package/dist/related-list-timeline-DsLdi8sv.cjs +0 -141
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +0 -1
- package/dist/relation-create-C43cdPQt.js.map +0 -1
- package/dist/relation-create-DDEYcKfw.cjs.map +0 -1
- package/dist/relation-many-picker-BJhaEqxz.js.map +0 -1
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +0 -1
- package/dist/relation-picker-D-tBBZW_.js.map +0 -1
- package/dist/relation-picker-DaIMzf2H.cjs.map +0 -1
- package/dist/relation-picker-dialog-9Vg5vvR1.cjs.map +0 -1
- package/dist/relation-picker-dialog-DoEY8EkH.js.map +0 -1
- package/dist/resource-page-router-C_kGW2o_.cjs.map +0 -1
- package/dist/resource-page-router-Diw6S6TK.js.map +0 -1
- package/dist/success-notices-Dl3M1fZP.cjs.map +0 -1
- package/dist/success-notices-LDEgEkc4.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { l as cn } from "./use-theme-dnE3Od3I.js";
|
|
2
2
|
import { l as useLinkComponent } from "./toaster-Ct_YHGs6.js";
|
|
3
|
-
import {
|
|
3
|
+
import { A as useLoaded, O as loadPageFlowRoute, T as loadFailedText, s as canonicalResourceName, t as CheckConfirmDialog, y as FlowBoundary } from "./check-confirm-dialog-B-CbJTln.js";
|
|
4
4
|
import { t as Button } from "./button-MWVeZaqj.js";
|
|
5
|
-
import { b as
|
|
5
|
+
import { b as LoadError, m as useRowTitle, x as RecordState, y as InvalidRouteId } from "./relation-create-6WicROWA.js";
|
|
6
6
|
import { t as Skeleton } from "./skeleton-U2noefj5.js";
|
|
7
|
-
import { Ct as
|
|
8
|
-
import { t as useNoticeSink } from "./success-notices-
|
|
9
|
-
import { FORM_SLOT, addressesCapability, builtinFrames, canonicalEntityNodeKey, compilePageScreen, declaredText, dtoFields, evaluateVisible, fieldSensitivity, formatEntityRef, hasListPage, hrefFor, humanizeKey, isCustomPageDef, isScreenFailure, issueOfInput, matchPath, navHrefFor, normalizeEntityRef, normalizeIssueInputs, pageParamNames, parsePageParams, resolveNavLabel, resourceKey, routeResourceKey, routeServerIssues, scopeColumnOf, snapshotAppFrames, snapshotBlockLookup, snapshotFrameLookup, successNoticesOf } from "@burojs/core";
|
|
10
|
-
import { ActionRouteContext, ComponentsContext, FrameCheckContext, RecordFrameContext, RecordScopeProvider, ResourceContext, RouteSourceContext, ScreenStateProvider, maybeThen, pageAccessFor, policyRecordOf, recordKeyOf, resolveRoute, retryRecordRead, settle, useApp, useApplicationSnapshot, useAvailabilityResolver, useChromeT, useComponent, useCtx, useCurrentUserId, useFieldAccess, useFormController, useFrameImplementations, useFrameT, useI18nCaps, useList, useNavigationGuardText, useOne, useOptionalDataRuntime, useOptionalRouterAdapter, useOptionalT, usePageAccess, usePageScreen, usePermissions, usePlatformStorage, useProjectedRecord, usePublishDocVariant, useQuickEntry, useRecordFrame, useRecordTitle, useRouteListImplementation, useRouteNavigate, useRouteRecordId, useScope, useT, useTestIds, useTranslate, useVisibilityCtx } from "@burojs/react";
|
|
7
|
+
import { Ct as useShownItemActions, G as RouteScreenClaimContext, H as ScreenTree, J as FormControlProvider, K as RouteScreenContext, Mt as FieldDisplay, S as useFrameChrome, U as useTabsUrlState, W as QuickScreenClaimContext, X as useFormControlOf, d as resolveFrameView, g as UndeclaredTypeNotice, gt as PageHeader, h as TypeChromeDrawnContext, i as RouteListContext, kt as DeepLinkScope, m as HeaderTypeNotice, n as viewOf, p as ChangeTypeButton, q as useIsRouteScreen, t as selectImplementation, u as isBuiltinRecordView, v as FormActions, x as FrameChromeContext } from "./place-node-DRjmJGQ_.js";
|
|
8
|
+
import { t as useNoticeSink } from "./success-notices-CrcWOGSo.js";
|
|
9
|
+
import { FORM_SLOT, addressesCapability, builtinFrames, canonicalEntityNodeKey, compilePageScreen, declaredText, dtoFields, evaluateVisible, fieldSensitivity, formatEntityRef, hasListPage, hrefFor, humanizeKey, isCustomPageDef, isScreenFailure, issueOfInput, matchPath, navHrefFor, nodeKind, normalizeEntityRef, normalizeIssueInputs, pageParamNames, parsePageParams, permissionsUndecided, resolveNavLabel, resolveResourceLabel, resolveResourceNavLabel, resourceKey, routeResourceKey, routeServerIssues, scopeColumnOf, snapshotAppFrames, snapshotBlockLookup, snapshotFrameLookup, successNoticesOf } from "@burojs/core";
|
|
10
|
+
import { ActionRouteContext, ComponentsContext, FrameCheckContext, ORIGIN_DEPTH, RecordFrameContext, RecordScopeProvider, ResourceContext, RouteSourceContext, ScreenStateProvider, maybeThen, pageAccessFor, policyRecordOf, recordKeyOf, recordRouteAvailable, resolveRoute, retryRecordRead, settle, useApp, useApplicationSnapshot, useAvailabilityResolver, useChromeT, useComponent, useCtx, useCurrentUserId, useFieldAccess, useFormController, useFrameImplementations, useFrameT, useI18nCaps, useList, useNavigationGuardText, useOne, useOptionalDataRuntime, useOptionalRouterAdapter, useOptionalT, usePageAccess, usePageScreen, usePermissions, usePlatformStorage, useProjectedRecord, usePublishDocVariant, useQuickEntry, useRecordFrame, useRecordTitle, useReturnTarget, useRouteListImplementation, useRouteNavigate, useRouteRecordId, useScope, useT, useTestIds, useTranslate, useVisibilityCtx } from "@burojs/react";
|
|
11
11
|
import { Suspense, createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/resource-key.ts
|
|
@@ -18,6 +18,66 @@ function canonicalResourceKey$1(def) {
|
|
|
18
18
|
return canonicalNavKey(def);
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
|
+
//#region src/layout/build-nav-items.ts
|
|
22
|
+
function groupNavHref(registry, group, isVisible) {
|
|
23
|
+
let href;
|
|
24
|
+
try {
|
|
25
|
+
href = navHrefFor(registry, group, { isVisible });
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return matchPath(registry, href, { isVisible }) === null ? void 0 : href;
|
|
30
|
+
}
|
|
31
|
+
function buildNavItems(args) {
|
|
32
|
+
const { registry, caps, groupName, match, isVisible, entryFilter, icons } = args;
|
|
33
|
+
const chain = match?.groupChain ?? [];
|
|
34
|
+
const qualifiedMatch = match;
|
|
35
|
+
const activeLeaf = qualifiedMatch == null ? void 0 : qualifiedMatch.kind === "group-index" ? canonicalNavKey({
|
|
36
|
+
name: qualifiedMatch.target ?? qualifiedMatch.name,
|
|
37
|
+
ref: qualifiedMatch.targetRef
|
|
38
|
+
}) : canonicalNavKey(qualifiedMatch);
|
|
39
|
+
const isEligible = (node) => isVisible(node) && (entryFilter ? entryFilter(node) : true);
|
|
40
|
+
const out = [];
|
|
41
|
+
for (const child of registry.groups.childrenOf(groupName)) {
|
|
42
|
+
if (!isEligible(child)) continue;
|
|
43
|
+
const kind = nodeKind(child);
|
|
44
|
+
const childKey = canonicalNavKey(child);
|
|
45
|
+
if (kind === "group") {
|
|
46
|
+
const href = groupNavHref(registry, childKey, isEligible);
|
|
47
|
+
if (href === void 0) continue;
|
|
48
|
+
const label = resolveNavLabel(caps, `groups.${childKey}`, declaredText("chrome", child, "label"));
|
|
49
|
+
const active = chain.some((g) => canonicalNavKey(g) === childKey);
|
|
50
|
+
out.push({
|
|
51
|
+
kind: "group",
|
|
52
|
+
name: childKey,
|
|
53
|
+
label,
|
|
54
|
+
href,
|
|
55
|
+
icon: icons?.group?.(childKey),
|
|
56
|
+
active
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const href = navHrefFor(registry, childKey, { isVisible: isEligible });
|
|
61
|
+
if (kind === "custom-page") out.push({
|
|
62
|
+
kind: "custom-page",
|
|
63
|
+
name: childKey,
|
|
64
|
+
label: resolveNavLabel(caps, `pages.${childKey}`, declaredText("chrome", child, "label")),
|
|
65
|
+
href,
|
|
66
|
+
icon: icons?.page?.(childKey),
|
|
67
|
+
active: activeLeaf === childKey
|
|
68
|
+
});
|
|
69
|
+
else out.push({
|
|
70
|
+
kind: "resource",
|
|
71
|
+
name: childKey,
|
|
72
|
+
label: resolveResourceNavLabel(caps, childKey, child),
|
|
73
|
+
href,
|
|
74
|
+
icon: icons?.resource?.(childKey),
|
|
75
|
+
active: activeLeaf === childKey
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
21
81
|
//#region src/layout/layouts/secondary-sidebar-layout.tsx
|
|
22
82
|
function Row({ it }) {
|
|
23
83
|
const RouterLink = useLinkComponent();
|
|
@@ -951,15 +1011,21 @@ function RecordFrameHost(props) {
|
|
|
951
1011
|
edited
|
|
952
1012
|
]);
|
|
953
1013
|
const notify = useNoticeSink(resource);
|
|
1014
|
+
const routeScreen = useIsRouteScreen();
|
|
1015
|
+
const leavesOnCreate = mode === "create" && routeScreen;
|
|
1016
|
+
const [created, setCreated] = useState(false);
|
|
1017
|
+
const createdRef = useRef(false);
|
|
954
1018
|
const latest = useRef({
|
|
955
1019
|
controller,
|
|
956
1020
|
onSuccess: props.onSuccess,
|
|
957
|
-
notify
|
|
1021
|
+
notify,
|
|
1022
|
+
leavesOnCreate
|
|
958
1023
|
});
|
|
959
1024
|
latest.current = {
|
|
960
1025
|
controller,
|
|
961
1026
|
onSuccess: props.onSuccess,
|
|
962
|
-
notify
|
|
1027
|
+
notify,
|
|
1028
|
+
leavesOnCreate
|
|
963
1029
|
};
|
|
964
1030
|
const mounted = useRef(true);
|
|
965
1031
|
useEffect(() => {
|
|
@@ -969,6 +1035,7 @@ function RecordFrameHost(props) {
|
|
|
969
1035
|
};
|
|
970
1036
|
}, []);
|
|
971
1037
|
const submit = useCallback(async () => {
|
|
1038
|
+
if (createdRef.current) return;
|
|
972
1039
|
setSubmitError(void 0);
|
|
973
1040
|
setSubmitApplied(void 0);
|
|
974
1041
|
setFailed(NO_ISSUES);
|
|
@@ -976,6 +1043,10 @@ function RecordFrameHost(props) {
|
|
|
976
1043
|
atFailure.current = {};
|
|
977
1044
|
const outcome = await latest.current.controller.submit();
|
|
978
1045
|
if (!mounted.current) return;
|
|
1046
|
+
if (latest.current.leavesOnCreate && (outcome.status === "submitted" || outcome.status === "failed" && outcome.applied === "yes")) {
|
|
1047
|
+
createdRef.current = true;
|
|
1048
|
+
setCreated(true);
|
|
1049
|
+
}
|
|
979
1050
|
if (outcome.status === "submitted") {
|
|
980
1051
|
const notices = successNoticesOf(outcome.result);
|
|
981
1052
|
if (notices.length > 0) latest.current.notify(notices);
|
|
@@ -1015,7 +1086,6 @@ function RecordFrameHost(props) {
|
|
|
1015
1086
|
]);
|
|
1016
1087
|
const { chooseType } = props;
|
|
1017
1088
|
const typedAndAccepted = mode === "create" && controller.typeOffer !== null && controller.failure === null;
|
|
1018
|
-
const routeScreen = useIsRouteScreen();
|
|
1019
1089
|
const adapter = useOptionalRouterAdapter();
|
|
1020
1090
|
const hostRouter = routeScreen ? adapter : null;
|
|
1021
1091
|
const guardText = useNavigationGuardText();
|
|
@@ -1057,6 +1127,7 @@ function RecordFrameHost(props) {
|
|
|
1057
1127
|
submitError,
|
|
1058
1128
|
...submitApplied === void 0 ? {} : { submitApplied },
|
|
1059
1129
|
serverIssues: shownFailed,
|
|
1130
|
+
...created ? { created: true } : {},
|
|
1060
1131
|
submit,
|
|
1061
1132
|
root
|
|
1062
1133
|
}), [
|
|
@@ -1070,6 +1141,7 @@ function RecordFrameHost(props) {
|
|
|
1070
1141
|
submitError,
|
|
1071
1142
|
submitApplied,
|
|
1072
1143
|
shownFailed,
|
|
1144
|
+
created,
|
|
1073
1145
|
submit
|
|
1074
1146
|
]);
|
|
1075
1147
|
usePublishDocVariant(mode === "show" ? resource : void 0, record);
|
|
@@ -1257,6 +1329,24 @@ function usePublishedRecordTrail(key) {
|
|
|
1257
1329
|
return current !== null && current.key === key ? current : null;
|
|
1258
1330
|
}
|
|
1259
1331
|
//#endregion
|
|
1332
|
+
//#region src/layout/record-targets.ts
|
|
1333
|
+
function isShowAvailable(registry, resource) {
|
|
1334
|
+
return recordRouteAvailable(registry, resource, "show");
|
|
1335
|
+
}
|
|
1336
|
+
function showTarget(resource, id) {
|
|
1337
|
+
return {
|
|
1338
|
+
resource,
|
|
1339
|
+
action: "show",
|
|
1340
|
+
params: { id }
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
function listTarget(resource) {
|
|
1344
|
+
return {
|
|
1345
|
+
resource,
|
|
1346
|
+
action: "list"
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
//#endregion
|
|
1260
1350
|
//#region src/layout/route-trail.ts
|
|
1261
1351
|
function useTrailContext() {
|
|
1262
1352
|
const app = useApp();
|
|
@@ -1270,21 +1360,13 @@ function useTrailContext() {
|
|
|
1270
1360
|
t
|
|
1271
1361
|
};
|
|
1272
1362
|
}
|
|
1273
|
-
function groupCrumbHref(registry, group, isVisible) {
|
|
1274
|
-
let href;
|
|
1275
|
-
try {
|
|
1276
|
-
href = navHrefFor(registry, group, { isVisible });
|
|
1277
|
-
} catch {
|
|
1278
|
-
return;
|
|
1279
|
-
}
|
|
1280
|
-
return matchPath(registry, href, { isVisible }) === null ? void 0 : href;
|
|
1281
|
-
}
|
|
1282
1363
|
function groupCrumbs(ctx, chain) {
|
|
1283
1364
|
return chain.map((group) => {
|
|
1284
1365
|
const key = canonicalNavKey(group);
|
|
1285
1366
|
return {
|
|
1286
1367
|
label: resolveNavLabel(ctx.caps, `groups.${key}`, declaredText("chrome", group, "label")),
|
|
1287
|
-
href:
|
|
1368
|
+
href: groupNavHref(ctx.registry, key, ctx.isVisible),
|
|
1369
|
+
jump: true
|
|
1288
1370
|
};
|
|
1289
1371
|
});
|
|
1290
1372
|
}
|
|
@@ -1300,8 +1382,68 @@ function recordActionOf(match) {
|
|
|
1300
1382
|
default: return;
|
|
1301
1383
|
}
|
|
1302
1384
|
}
|
|
1385
|
+
function pathOf(href) {
|
|
1386
|
+
const path = href.split(/[?#]/, 1)[0] ?? "";
|
|
1387
|
+
return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
1388
|
+
}
|
|
1389
|
+
function originTrail(ctx, origin, depth = ORIGIN_DEPTH) {
|
|
1390
|
+
const match = matchPath(ctx.registry, pathOf(origin.href), { isVisible: ctx.isVisible });
|
|
1391
|
+
if (match === null) return void 0;
|
|
1392
|
+
switch (match.kind) {
|
|
1393
|
+
case "resource": {
|
|
1394
|
+
const key = canonicalNavKey(match);
|
|
1395
|
+
if (match.action === "list") return {
|
|
1396
|
+
leading: groupCrumbs(ctx, match.groupChain),
|
|
1397
|
+
resource: key,
|
|
1398
|
+
resourceHref: origin.href,
|
|
1399
|
+
segments: []
|
|
1400
|
+
};
|
|
1401
|
+
const def = ctx.registry.get(key);
|
|
1402
|
+
const crumb = {
|
|
1403
|
+
label: match.action === "create" ? ctx.t("breadcrumbs.create") : origin.title || (match.id === void 0 ? "" : `#${match.id}`),
|
|
1404
|
+
href: origin.href
|
|
1405
|
+
};
|
|
1406
|
+
const parent = depth > 1 && origin.origin !== void 0 ? originTrail(ctx, origin.origin, depth - 1) : void 0;
|
|
1407
|
+
if (parent !== void 0) return {
|
|
1408
|
+
...parent,
|
|
1409
|
+
segments: [...parent.segments, crumb]
|
|
1410
|
+
};
|
|
1411
|
+
return {
|
|
1412
|
+
leading: groupCrumbs(ctx, match.groupChain),
|
|
1413
|
+
resource: key,
|
|
1414
|
+
...def !== void 0 && hasListPage(def) ? { resourceHref: hrefFor(ctx.registry, key) } : {},
|
|
1415
|
+
segments: [crumb]
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
case "custom-page": {
|
|
1419
|
+
const trail = headerTrail(ctx, match);
|
|
1420
|
+
if (trail === null || trail.pageLabel === void 0) return void 0;
|
|
1421
|
+
return {
|
|
1422
|
+
leading: trail.leadingSegments ?? [],
|
|
1423
|
+
segments: [{
|
|
1424
|
+
label: trail.pageLabel,
|
|
1425
|
+
href: origin.href
|
|
1426
|
+
}]
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
case "group-index": {
|
|
1430
|
+
const crumbs = groupCrumbs(ctx, match.groupChain);
|
|
1431
|
+
const own = crumbs[crumbs.length - 1];
|
|
1432
|
+
if (own === void 0) return void 0;
|
|
1433
|
+
return {
|
|
1434
|
+
leading: crumbs.slice(0, -1),
|
|
1435
|
+
segments: [{
|
|
1436
|
+
label: own.label,
|
|
1437
|
+
href: origin.href
|
|
1438
|
+
}]
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
default: return;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1303
1444
|
function recordTrail(ctx, input) {
|
|
1304
|
-
const { resource, action, id } = input;
|
|
1445
|
+
const { resource, action, id, origin } = input;
|
|
1446
|
+
if (origin !== void 0 && (action === "create" || id !== "")) return originRooted(ctx, input, origin);
|
|
1305
1447
|
const leadingSegments = nonEmpty(groupCrumbs(ctx, input.groupChain));
|
|
1306
1448
|
if (action !== "create" && id === "") return {
|
|
1307
1449
|
resource,
|
|
@@ -1321,6 +1463,42 @@ function recordTrail(ctx, input) {
|
|
|
1321
1463
|
middleSegments
|
|
1322
1464
|
};
|
|
1323
1465
|
}
|
|
1466
|
+
function originRooted(ctx, input, origin) {
|
|
1467
|
+
const { resource, action, id } = input;
|
|
1468
|
+
const recordLabel = input.title || id;
|
|
1469
|
+
const drawn = new Set(origin.segments.flatMap((crumb) => crumb.href === void 0 ? [] : [pathOf(crumb.href)]));
|
|
1470
|
+
const own = action === "edit" ? [isShowAvailable(ctx.registry, resource) ? {
|
|
1471
|
+
label: recordLabel,
|
|
1472
|
+
href: resolveRoute(showTarget(resource, id), ctx.registry)
|
|
1473
|
+
} : { label: recordLabel }].filter((crumb) => crumb.href === void 0 || !drawn.has(pathOf(crumb.href))) : [];
|
|
1474
|
+
const pageLabel = action === "create" ? ctx.t("breadcrumbs.create") : action === "edit" ? ctx.t("breadcrumbs.edit") : recordLabel;
|
|
1475
|
+
const recordId = action === "create" ? void 0 : id;
|
|
1476
|
+
const middleSegments = nonEmpty([...origin.segments, ...own]);
|
|
1477
|
+
if (origin.resource !== void 0 && ctx.registry.get(origin.resource) === ctx.registry.get(resource)) return {
|
|
1478
|
+
resource,
|
|
1479
|
+
recordId,
|
|
1480
|
+
pageLabel,
|
|
1481
|
+
leadingSegments: nonEmpty([...origin.leading]),
|
|
1482
|
+
...origin.resourceHref === void 0 ? {} : { resourceHref: origin.resourceHref },
|
|
1483
|
+
middleSegments
|
|
1484
|
+
};
|
|
1485
|
+
const def = origin.resource === void 0 ? void 0 : ctx.registry.get(origin.resource);
|
|
1486
|
+
const resourceCrumb = origin.resource === void 0 ? [] : [{
|
|
1487
|
+
label: resolveResourceLabel(ctx.caps, origin.resource, "plural", def),
|
|
1488
|
+
...origin.resourceHref === void 0 ? {} : { href: origin.resourceHref }
|
|
1489
|
+
}];
|
|
1490
|
+
return {
|
|
1491
|
+
resource,
|
|
1492
|
+
recordId,
|
|
1493
|
+
pageLabel,
|
|
1494
|
+
rootSegments: [
|
|
1495
|
+
...origin.leading,
|
|
1496
|
+
...resourceCrumb,
|
|
1497
|
+
...origin.segments,
|
|
1498
|
+
...own
|
|
1499
|
+
]
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1324
1502
|
function recordTrailRoute(registry, match) {
|
|
1325
1503
|
if (match === null || match.kind !== "resource") return null;
|
|
1326
1504
|
const resource = canonicalNavKey(match);
|
|
@@ -1514,10 +1692,9 @@ function RecordShow({ resource, id, recordId, record, shown }) {
|
|
|
1514
1692
|
})] });
|
|
1515
1693
|
}
|
|
1516
1694
|
function RecordEdit({ resource, id, recordId, record, shown }) {
|
|
1517
|
-
const app = useApp();
|
|
1518
1695
|
const navigate = useRouteNavigate();
|
|
1519
1696
|
const mounted = useMountedRef();
|
|
1520
|
-
const back =
|
|
1697
|
+
const back = useReturnTarget(resource, "edit", id);
|
|
1521
1698
|
return jsxs("div", { children: [jsx(RecordRouteHeader, {
|
|
1522
1699
|
resource,
|
|
1523
1700
|
action: "edit",
|
|
@@ -1528,9 +1705,9 @@ function RecordEdit({ resource, id, recordId, record, shown }) {
|
|
|
1528
1705
|
mode: "edit",
|
|
1529
1706
|
recordId,
|
|
1530
1707
|
record,
|
|
1531
|
-
onCancel: () => navigate(back),
|
|
1708
|
+
onCancel: () => navigate(back, { origin: "inherit" }),
|
|
1532
1709
|
onSuccess: () => {
|
|
1533
|
-
if (mounted.current) navigate(back);
|
|
1710
|
+
if (mounted.current) navigate(back, { origin: "inherit" });
|
|
1534
1711
|
}
|
|
1535
1712
|
})] });
|
|
1536
1713
|
}
|
|
@@ -1544,6 +1721,7 @@ function RecordCreate({ resource, defaults }) {
|
|
|
1544
1721
|
const mounted = useMountedRef();
|
|
1545
1722
|
const adapter = useOptionalRouterAdapter();
|
|
1546
1723
|
const list = listTarget(resource);
|
|
1724
|
+
const back = useReturnTarget(resource, "create");
|
|
1547
1725
|
const type = adapter?.searchParams.get("type") ?? void 0;
|
|
1548
1726
|
return jsxs("div", { children: [jsx(RecordRouteHeader, {
|
|
1549
1727
|
resource,
|
|
@@ -1556,11 +1734,11 @@ function RecordCreate({ resource, defaults }) {
|
|
|
1556
1734
|
mode: "create",
|
|
1557
1735
|
...type === void 0 ? {} : { type },
|
|
1558
1736
|
...defaults === void 0 ? {} : { defaults },
|
|
1559
|
-
onCancel: () => navigate(
|
|
1737
|
+
onCancel: () => navigate(back, { origin: "inherit" }),
|
|
1560
1738
|
onSuccess: (result) => {
|
|
1561
1739
|
if (!mounted.current) return;
|
|
1562
1740
|
const id = createdId(result);
|
|
1563
|
-
navigate(id
|
|
1741
|
+
navigate(id !== void 0 && isShowAvailable(app.registry, resource) ? showTarget(resource, id) : list, { origin: "inherit" });
|
|
1564
1742
|
}
|
|
1565
1743
|
})
|
|
1566
1744
|
})] });
|
|
@@ -1584,7 +1762,7 @@ function RecordRead({ resource, action, id, recordId }) {
|
|
|
1584
1762
|
name: "show"
|
|
1585
1763
|
});
|
|
1586
1764
|
const showHidden = showRuled && read !== null && typeof read === "object" && showAvailability("show", read).state !== "available";
|
|
1587
|
-
const showSettled = !showRuled || !query.isPlaceholderData && permissions
|
|
1765
|
+
const showSettled = !showRuled || !query.isPlaceholderData && !permissionsUndecided(permissions) && permissions?.status !== "error";
|
|
1588
1766
|
useRecordVisit(resource, projected.status === "ready" && showSettled && !showHidden ? projected.value : null, { isCurrentData: !query.isPlaceholderData });
|
|
1589
1767
|
const route = useMemo(() => Object.freeze({ id }), [id]);
|
|
1590
1768
|
const availability = useAvailabilityResolver(resource, "edit");
|
|
@@ -1593,7 +1771,7 @@ function RecordRead({ resource, action, id, recordId }) {
|
|
|
1593
1771
|
if (record === null || typeof record !== "object") return jsx(RecordState, { state: "not-found" });
|
|
1594
1772
|
const loaded = record;
|
|
1595
1773
|
if (showRuled) {
|
|
1596
|
-
if (query.isPlaceholderData || permissions
|
|
1774
|
+
if (query.isPlaceholderData || permissionsUndecided(permissions)) return jsx(RecordState, { state: "loading" });
|
|
1597
1775
|
if (permissions?.status === "error") return jsx(RecordState, { state: "not-found" });
|
|
1598
1776
|
if (showHidden) return jsx(RecordState, { state: "not-found" });
|
|
1599
1777
|
}
|
|
@@ -1602,6 +1780,7 @@ function RecordRead({ resource, action, id, recordId }) {
|
|
|
1602
1780
|
if (action === "edit") {
|
|
1603
1781
|
const edit = availability("edit", loaded).state;
|
|
1604
1782
|
if (edit === "hidden" || edit === "absent") return jsx(RecordState, { state: "not-found" });
|
|
1783
|
+
if (edit === "undecided") return jsx(RecordState, { state: "loading" });
|
|
1605
1784
|
}
|
|
1606
1785
|
return jsx(RouteSourceContext.Provider, {
|
|
1607
1786
|
value: route,
|
|
@@ -1826,6 +2005,6 @@ function NavAreaPage() {
|
|
|
1826
2005
|
});
|
|
1827
2006
|
}
|
|
1828
2007
|
//#endregion
|
|
1829
|
-
export {
|
|
2008
|
+
export { useLayoutResolver as A, useMatch as C, BUILTIN_LAYOUTS as D, useResourceVisible as E, groupNavHref as F, canonicalNavKey as I, canonicalResourceKey$1 as L, TabsLayout as M, SecondarySidebarLayout as N, layoutSlot as O, buildNavItems as P, useHref as S, usePageAllowed as T, RecordScreen as _, useRecordVisit as a, ResourceListPage as b, headerTrail as c, recordTrailRoute as d, useTrailContext as f, usePublishedRecordTrail as g, usePublishRecordTrail as h, RecordPage as i, useReportUnresolvedLayouts as j, useLayout as k, originTrail as l, recordTrailKey as m, NavAreaPage as n, RECENT_LABEL_KEYS as o, isShowAvailable as p, ResourcePageRouter as r, readRecentRecords as s, NavAreaNotFound as t, recordTrail as u, useResourceDimensionOptions as v, useNavVisible as w, NavChromeMountedProvider as x, PlannedBody as y };
|
|
1830
2009
|
|
|
1831
|
-
//# sourceMappingURL=resource-page-router-
|
|
2010
|
+
//# sourceMappingURL=resource-page-router-CzaNATSp.js.map
|