@burojs/ui-shadcn 0.7.0 → 0.8.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-y5M6_oe4.cjs → candidates-relation-picker-C47mF260.cjs} +3 -3
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs.map → candidates-relation-picker-C47mF260.cjs.map} +1 -1
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js → candidates-relation-picker-CGXItMN0.js} +3 -3
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js.map → candidates-relation-picker-CGXItMN0.js.map} +1 -1
- package/dist/{check-confirm-dialog-C-NHgMST.cjs → check-confirm-dialog-BT04Mieo.cjs} +13 -6
- package/dist/check-confirm-dialog-BT04Mieo.cjs.map +1 -0
- package/dist/{check-confirm-dialog-2j0gOd7x.js → check-confirm-dialog-CtiRzOAt.js} +14 -7
- package/dist/{check-confirm-dialog-2j0gOd7x.js.map → check-confirm-dialog-CtiRzOAt.js.map} +1 -1
- package/dist/{filter-builder-DFu0JP-1.cjs → filter-builder-ByGhxLf_.cjs} +127 -63
- package/dist/filter-builder-ByGhxLf_.cjs.map +1 -0
- package/dist/{filter-builder-DaWHUZuV.js → filter-builder-z3Axzf9Y.js} +114 -56
- package/dist/filter-builder-z3Axzf9Y.js.map +1 -0
- package/dist/{flow-runtime-BpmrIUb6.cjs → flow-runtime-BVFjMU5-.cjs} +6 -3
- package/dist/{flow-runtime-BpmrIUb6.cjs.map → flow-runtime-BVFjMU5-.cjs.map} +1 -1
- package/dist/{flow-runtime-DyqTmK3H.js → flow-runtime-DrUWyTS0.js} +6 -3
- package/dist/{flow-runtime-DyqTmK3H.js.map → flow-runtime-DrUWyTS0.js.map} +1 -1
- package/dist/{flow-screen-DCdli6Ha.js → flow-screen-3fk6J33y.js} +6 -4
- package/dist/flow-screen-3fk6J33y.js.map +1 -0
- package/dist/{flow-screen-Bcz9NF2V.cjs → flow-screen-6y5E_HT6.cjs} +5 -3
- package/dist/flow-screen-6y5E_HT6.cjs.map +1 -0
- package/dist/index.cjs +518 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +187 -86
- package/dist/index.d.ts +187 -86
- package/dist/index.js +519 -108
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-3vw7LzzD.cjs → inline-flow-host-C4KmZIYE.cjs} +3 -3
- package/dist/{inline-flow-host-3vw7LzzD.cjs.map → inline-flow-host-C4KmZIYE.cjs.map} +1 -1
- package/dist/{inline-flow-host-C0rI9B7f.js → inline-flow-host-YnnvWjdU.js} +3 -3
- package/dist/{inline-flow-host-C0rI9B7f.js.map → inline-flow-host-YnnvWjdU.js.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs → lazy-relation-picker-dialog-BAKBRn3V.cjs} +2 -2
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs.map → lazy-relation-picker-dialog-BAKBRn3V.cjs.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js → lazy-relation-picker-dialog-DN4bvQfg.js} +2 -2
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js.map → lazy-relation-picker-dialog-DN4bvQfg.js.map} +1 -1
- package/dist/{page-flow-route-BHUEpn0I.js → page-flow-route-CtEfqAvU.js} +5 -6
- package/dist/page-flow-route-CtEfqAvU.js.map +1 -0
- package/dist/{page-flow-route-DS8IVTVH.cjs → page-flow-route-DEjAxHe3.cjs} +6 -7
- package/dist/page-flow-route-DEjAxHe3.cjs.map +1 -0
- package/dist/{place-node-CfzQvh4Y.js → place-node-BdxT-30h.js} +149 -108
- package/dist/place-node-BdxT-30h.js.map +1 -0
- package/dist/{place-node-CNb3w-c7.cjs → place-node-Bhl8B3fF.cjs} +163 -134
- package/dist/place-node-Bhl8B3fF.cjs.map +1 -0
- package/dist/{related-list-cards-CelMxl4q.cjs → related-list-cards-Bc_vfCE_.cjs} +3 -3
- package/dist/{related-list-cards-CelMxl4q.cjs.map → related-list-cards-Bc_vfCE_.cjs.map} +1 -1
- package/dist/{related-list-cards-BIqqY69Y.js → related-list-cards-BvkD5OcC.js} +3 -3
- package/dist/{related-list-cards-BIqqY69Y.js.map → related-list-cards-BvkD5OcC.js.map} +1 -1
- package/dist/related-list-timeline-DCrwN9oO.js +167 -0
- package/dist/related-list-timeline-DCrwN9oO.js.map +1 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs +167 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs.map +1 -0
- package/dist/{related-rows-MPnLCmPF.cjs → related-rows-BW9Jr07T.cjs} +3 -3
- package/dist/{related-rows-MPnLCmPF.cjs.map → related-rows-BW9Jr07T.cjs.map} +1 -1
- package/dist/{related-rows--uP2iKQC.js → related-rows-CPE-9FFr.js} +3 -3
- package/dist/{related-rows--uP2iKQC.js.map → related-rows-CPE-9FFr.js.map} +1 -1
- package/dist/{relation-many-picker-BJhaEqxz.js → relation-many-picker-BlrGRwMV.js} +10 -5
- package/dist/relation-many-picker-BlrGRwMV.js.map +1 -0
- package/dist/{relation-many-picker-DzuGJpEl.cjs → relation-many-picker-Br-zBHxT.cjs} +10 -5
- package/dist/relation-many-picker-Br-zBHxT.cjs.map +1 -0
- package/dist/{relation-picker-DaIMzf2H.cjs → relation-picker-ADjxI_TI.cjs} +11 -6
- package/dist/relation-picker-ADjxI_TI.cjs.map +1 -0
- package/dist/{relation-picker-dialog-DoEY8EkH.js → relation-picker-dialog-CyKliBkN.js} +2 -2
- package/dist/{relation-picker-dialog-DoEY8EkH.js.map → relation-picker-dialog-CyKliBkN.js.map} +1 -1
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs → relation-picker-dialog-DimVQF9Y.cjs} +2 -2
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs.map → relation-picker-dialog-DimVQF9Y.cjs.map} +1 -1
- package/dist/{relation-picker-D-tBBZW_.js → relation-picker-x7P5HKie.js} +11 -6
- package/dist/relation-picker-x7P5HKie.js.map +1 -0
- package/dist/{resource-page-router-Diw6S6TK.js → resource-page-router-BRpUnhay.js} +144 -17
- package/dist/resource-page-router-BRpUnhay.js.map +1 -0
- package/dist/{resource-page-router-C_kGW2o_.cjs → resource-page-router-qEd2xb55.cjs} +158 -19
- package/dist/resource-page-router-qEd2xb55.cjs.map +1 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs +70 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs.map +1 -0
- package/dist/use-record-subtitle-gIaCGgbI.js +53 -0
- package/dist/use-record-subtitle-gIaCGgbI.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-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/resource-page-router-C_kGW2o_.cjs.map +0 -1
- package/dist/resource-page-router-Diw6S6TK.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_use_theme = require("./use-theme-DFlpXils.cjs");
|
|
2
2
|
const require_toaster = require("./toaster-BbByOytP.cjs");
|
|
3
|
-
const require_check_confirm_dialog = require("./check-confirm-dialog-
|
|
3
|
+
const require_check_confirm_dialog = require("./check-confirm-dialog-BT04Mieo.cjs");
|
|
4
4
|
const require_button = require("./button-BxnnE28H.cjs");
|
|
5
5
|
const require_relation_create = require("./relation-create-DDEYcKfw.cjs");
|
|
6
6
|
const require_skeleton = require("./skeleton-_1gP7wan.cjs");
|
|
7
|
-
const require_place_node = require("./place-node-
|
|
7
|
+
const require_place_node = require("./place-node-Bhl8B3fF.cjs");
|
|
8
8
|
const require_success_notices = require("./success-notices-Dl3M1fZP.cjs");
|
|
9
9
|
let _burojs_core = require("@burojs/core");
|
|
10
10
|
let _burojs_react = require("@burojs/react");
|
|
@@ -951,15 +951,21 @@ function RecordFrameHost(props) {
|
|
|
951
951
|
edited
|
|
952
952
|
]);
|
|
953
953
|
const notify = require_success_notices.useNoticeSink(resource);
|
|
954
|
+
const routeScreen = require_place_node.useIsRouteScreen();
|
|
955
|
+
const leavesOnCreate = mode === "create" && routeScreen;
|
|
956
|
+
const [created, setCreated] = (0, react.useState)(false);
|
|
957
|
+
const createdRef = (0, react.useRef)(false);
|
|
954
958
|
const latest = (0, react.useRef)({
|
|
955
959
|
controller,
|
|
956
960
|
onSuccess: props.onSuccess,
|
|
957
|
-
notify
|
|
961
|
+
notify,
|
|
962
|
+
leavesOnCreate
|
|
958
963
|
});
|
|
959
964
|
latest.current = {
|
|
960
965
|
controller,
|
|
961
966
|
onSuccess: props.onSuccess,
|
|
962
|
-
notify
|
|
967
|
+
notify,
|
|
968
|
+
leavesOnCreate
|
|
963
969
|
};
|
|
964
970
|
const mounted = (0, react.useRef)(true);
|
|
965
971
|
(0, react.useEffect)(() => {
|
|
@@ -969,6 +975,7 @@ function RecordFrameHost(props) {
|
|
|
969
975
|
};
|
|
970
976
|
}, []);
|
|
971
977
|
const submit = (0, react.useCallback)(async () => {
|
|
978
|
+
if (createdRef.current) return;
|
|
972
979
|
setSubmitError(void 0);
|
|
973
980
|
setSubmitApplied(void 0);
|
|
974
981
|
setFailed(NO_ISSUES);
|
|
@@ -976,6 +983,10 @@ function RecordFrameHost(props) {
|
|
|
976
983
|
atFailure.current = {};
|
|
977
984
|
const outcome = await latest.current.controller.submit();
|
|
978
985
|
if (!mounted.current) return;
|
|
986
|
+
if (latest.current.leavesOnCreate && (outcome.status === "submitted" || outcome.status === "failed" && outcome.applied === "yes")) {
|
|
987
|
+
createdRef.current = true;
|
|
988
|
+
setCreated(true);
|
|
989
|
+
}
|
|
979
990
|
if (outcome.status === "submitted") {
|
|
980
991
|
const notices = (0, _burojs_core.successNoticesOf)(outcome.result);
|
|
981
992
|
if (notices.length > 0) latest.current.notify(notices);
|
|
@@ -1015,7 +1026,6 @@ function RecordFrameHost(props) {
|
|
|
1015
1026
|
]);
|
|
1016
1027
|
const { chooseType } = props;
|
|
1017
1028
|
const typedAndAccepted = mode === "create" && controller.typeOffer !== null && controller.failure === null;
|
|
1018
|
-
const routeScreen = require_place_node.useIsRouteScreen();
|
|
1019
1029
|
const adapter = (0, _burojs_react.useOptionalRouterAdapter)();
|
|
1020
1030
|
const hostRouter = routeScreen ? adapter : null;
|
|
1021
1031
|
const guardText = (0, _burojs_react.useNavigationGuardText)();
|
|
@@ -1057,6 +1067,7 @@ function RecordFrameHost(props) {
|
|
|
1057
1067
|
submitError,
|
|
1058
1068
|
...submitApplied === void 0 ? {} : { submitApplied },
|
|
1059
1069
|
serverIssues: shownFailed,
|
|
1070
|
+
...created ? { created: true } : {},
|
|
1060
1071
|
submit,
|
|
1061
1072
|
root
|
|
1062
1073
|
}), [
|
|
@@ -1070,6 +1081,7 @@ function RecordFrameHost(props) {
|
|
|
1070
1081
|
submitError,
|
|
1071
1082
|
submitApplied,
|
|
1072
1083
|
shownFailed,
|
|
1084
|
+
created,
|
|
1073
1085
|
submit
|
|
1074
1086
|
]);
|
|
1075
1087
|
(0, _burojs_react.usePublishDocVariant)(mode === "show" ? resource : void 0, record);
|
|
@@ -1257,6 +1269,24 @@ function usePublishedRecordTrail(key) {
|
|
|
1257
1269
|
return current !== null && current.key === key ? current : null;
|
|
1258
1270
|
}
|
|
1259
1271
|
//#endregion
|
|
1272
|
+
//#region src/layout/record-targets.ts
|
|
1273
|
+
function isShowAvailable(registry, resource) {
|
|
1274
|
+
return (0, _burojs_react.recordRouteAvailable)(registry, resource, "show");
|
|
1275
|
+
}
|
|
1276
|
+
function showTarget(resource, id) {
|
|
1277
|
+
return {
|
|
1278
|
+
resource,
|
|
1279
|
+
action: "show",
|
|
1280
|
+
params: { id }
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
function listTarget(resource) {
|
|
1284
|
+
return {
|
|
1285
|
+
resource,
|
|
1286
|
+
action: "list"
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
//#endregion
|
|
1260
1290
|
//#region src/layout/route-trail.ts
|
|
1261
1291
|
function useTrailContext() {
|
|
1262
1292
|
const app = (0, _burojs_react.useApp)();
|
|
@@ -1284,7 +1314,8 @@ function groupCrumbs(ctx, chain) {
|
|
|
1284
1314
|
const key = canonicalNavKey(group);
|
|
1285
1315
|
return {
|
|
1286
1316
|
label: (0, _burojs_core.resolveNavLabel)(ctx.caps, `groups.${key}`, (0, _burojs_core.declaredText)("chrome", group, "label")),
|
|
1287
|
-
href: groupCrumbHref(ctx.registry, key, ctx.isVisible)
|
|
1317
|
+
href: groupCrumbHref(ctx.registry, key, ctx.isVisible),
|
|
1318
|
+
jump: true
|
|
1288
1319
|
};
|
|
1289
1320
|
});
|
|
1290
1321
|
}
|
|
@@ -1300,17 +1331,77 @@ function recordActionOf(match) {
|
|
|
1300
1331
|
default: return;
|
|
1301
1332
|
}
|
|
1302
1333
|
}
|
|
1334
|
+
function pathOf(href) {
|
|
1335
|
+
const path = href.split(/[?#]/, 1)[0] ?? "";
|
|
1336
|
+
return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
1337
|
+
}
|
|
1338
|
+
function originTrail(ctx, origin, depth = _burojs_react.ORIGIN_DEPTH) {
|
|
1339
|
+
const match = (0, _burojs_core.matchPath)(ctx.registry, pathOf(origin.href), { isVisible: ctx.isVisible });
|
|
1340
|
+
if (match === null) return void 0;
|
|
1341
|
+
switch (match.kind) {
|
|
1342
|
+
case "resource": {
|
|
1343
|
+
const key = canonicalNavKey(match);
|
|
1344
|
+
if (match.action === "list") return {
|
|
1345
|
+
leading: groupCrumbs(ctx, match.groupChain),
|
|
1346
|
+
resource: key,
|
|
1347
|
+
resourceHref: origin.href,
|
|
1348
|
+
segments: []
|
|
1349
|
+
};
|
|
1350
|
+
const def = ctx.registry.get(key);
|
|
1351
|
+
const crumb = {
|
|
1352
|
+
label: match.action === "create" ? ctx.t("breadcrumbs.create") : origin.title || (match.id === void 0 ? "" : `#${match.id}`),
|
|
1353
|
+
href: origin.href
|
|
1354
|
+
};
|
|
1355
|
+
const parent = depth > 1 && origin.origin !== void 0 ? originTrail(ctx, origin.origin, depth - 1) : void 0;
|
|
1356
|
+
if (parent !== void 0) return {
|
|
1357
|
+
...parent,
|
|
1358
|
+
segments: [...parent.segments, crumb]
|
|
1359
|
+
};
|
|
1360
|
+
return {
|
|
1361
|
+
leading: groupCrumbs(ctx, match.groupChain),
|
|
1362
|
+
resource: key,
|
|
1363
|
+
...def !== void 0 && (0, _burojs_core.hasListPage)(def) ? { resourceHref: (0, _burojs_core.hrefFor)(ctx.registry, key) } : {},
|
|
1364
|
+
segments: [crumb]
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
case "custom-page": {
|
|
1368
|
+
const trail = headerTrail(ctx, match);
|
|
1369
|
+
if (trail === null || trail.pageLabel === void 0) return void 0;
|
|
1370
|
+
return {
|
|
1371
|
+
leading: trail.leadingSegments ?? [],
|
|
1372
|
+
segments: [{
|
|
1373
|
+
label: trail.pageLabel,
|
|
1374
|
+
href: origin.href
|
|
1375
|
+
}]
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
case "group-index": {
|
|
1379
|
+
const crumbs = groupCrumbs(ctx, match.groupChain);
|
|
1380
|
+
const own = crumbs[crumbs.length - 1];
|
|
1381
|
+
if (own === void 0) return void 0;
|
|
1382
|
+
return {
|
|
1383
|
+
leading: crumbs.slice(0, -1),
|
|
1384
|
+
segments: [{
|
|
1385
|
+
label: own.label,
|
|
1386
|
+
href: origin.href
|
|
1387
|
+
}]
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
default: return;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1303
1393
|
function recordTrail(ctx, input) {
|
|
1304
|
-
const { resource, action, id } = input;
|
|
1394
|
+
const { resource, action, id, origin } = input;
|
|
1395
|
+
if (origin !== void 0 && (action === "create" || id !== "")) return originRooted(ctx, input, origin);
|
|
1305
1396
|
const leadingSegments = nonEmpty(groupCrumbs(ctx, input.groupChain));
|
|
1306
1397
|
if (action !== "create" && id === "") return {
|
|
1307
1398
|
resource,
|
|
1308
1399
|
leadingSegments
|
|
1309
1400
|
};
|
|
1310
1401
|
const recordLabel = input.title || id;
|
|
1311
|
-
const middleSegments = action === "edit" ? [
|
|
1402
|
+
const middleSegments = action === "edit" ? [isShowAvailable(ctx.registry, resource) ? {
|
|
1312
1403
|
label: recordLabel,
|
|
1313
|
-
href: (0, _burojs_react.resolveRoute)(
|
|
1404
|
+
href: (0, _burojs_react.resolveRoute)(showTarget(resource, id), ctx.registry)
|
|
1314
1405
|
} : { label: recordLabel }] : void 0;
|
|
1315
1406
|
const pageLabel = action === "create" ? ctx.t("breadcrumbs.create") : action === "edit" ? ctx.t("breadcrumbs.edit") : recordLabel;
|
|
1316
1407
|
return {
|
|
@@ -1321,6 +1412,42 @@ function recordTrail(ctx, input) {
|
|
|
1321
1412
|
middleSegments
|
|
1322
1413
|
};
|
|
1323
1414
|
}
|
|
1415
|
+
function originRooted(ctx, input, origin) {
|
|
1416
|
+
const { resource, action, id } = input;
|
|
1417
|
+
const recordLabel = input.title || id;
|
|
1418
|
+
const drawn = new Set(origin.segments.flatMap((crumb) => crumb.href === void 0 ? [] : [pathOf(crumb.href)]));
|
|
1419
|
+
const own = action === "edit" ? [isShowAvailable(ctx.registry, resource) ? {
|
|
1420
|
+
label: recordLabel,
|
|
1421
|
+
href: (0, _burojs_react.resolveRoute)(showTarget(resource, id), ctx.registry)
|
|
1422
|
+
} : { label: recordLabel }].filter((crumb) => crumb.href === void 0 || !drawn.has(pathOf(crumb.href))) : [];
|
|
1423
|
+
const pageLabel = action === "create" ? ctx.t("breadcrumbs.create") : action === "edit" ? ctx.t("breadcrumbs.edit") : recordLabel;
|
|
1424
|
+
const recordId = action === "create" ? void 0 : id;
|
|
1425
|
+
const middleSegments = nonEmpty([...origin.segments, ...own]);
|
|
1426
|
+
if (origin.resource !== void 0 && ctx.registry.get(origin.resource) === ctx.registry.get(resource)) return {
|
|
1427
|
+
resource,
|
|
1428
|
+
recordId,
|
|
1429
|
+
pageLabel,
|
|
1430
|
+
leadingSegments: nonEmpty([...origin.leading]),
|
|
1431
|
+
...origin.resourceHref === void 0 ? {} : { resourceHref: origin.resourceHref },
|
|
1432
|
+
middleSegments
|
|
1433
|
+
};
|
|
1434
|
+
const def = origin.resource === void 0 ? void 0 : ctx.registry.get(origin.resource);
|
|
1435
|
+
const resourceCrumb = origin.resource === void 0 ? [] : [{
|
|
1436
|
+
label: (0, _burojs_core.resolveResourceLabel)(ctx.caps, origin.resource, "plural", def),
|
|
1437
|
+
...origin.resourceHref === void 0 ? {} : { href: origin.resourceHref }
|
|
1438
|
+
}];
|
|
1439
|
+
return {
|
|
1440
|
+
resource,
|
|
1441
|
+
recordId,
|
|
1442
|
+
pageLabel,
|
|
1443
|
+
rootSegments: [
|
|
1444
|
+
...origin.leading,
|
|
1445
|
+
...resourceCrumb,
|
|
1446
|
+
...origin.segments,
|
|
1447
|
+
...own
|
|
1448
|
+
]
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1324
1451
|
function recordTrailRoute(registry, match) {
|
|
1325
1452
|
if (match === null || match.kind !== "resource") return null;
|
|
1326
1453
|
const resource = canonicalNavKey(match);
|
|
@@ -1333,7 +1460,7 @@ function recordTrailRoute(registry, match) {
|
|
|
1333
1460
|
groupChain
|
|
1334
1461
|
};
|
|
1335
1462
|
const action = recordActionOf(match);
|
|
1336
|
-
if (action === void 0 || !
|
|
1463
|
+
if (action === void 0 || !(0, _burojs_react.recordRouteAvailable)(registry, resource, action)) return null;
|
|
1337
1464
|
return {
|
|
1338
1465
|
resource,
|
|
1339
1466
|
action,
|
|
@@ -1514,10 +1641,9 @@ function RecordShow({ resource, id, recordId, record, shown }) {
|
|
|
1514
1641
|
})] });
|
|
1515
1642
|
}
|
|
1516
1643
|
function RecordEdit({ resource, id, recordId, record, shown }) {
|
|
1517
|
-
const app = (0, _burojs_react.useApp)();
|
|
1518
1644
|
const navigate = (0, _burojs_react.useRouteNavigate)();
|
|
1519
1645
|
const mounted = useMountedRef();
|
|
1520
|
-
const back =
|
|
1646
|
+
const back = (0, _burojs_react.useReturnTarget)(resource, "edit", id);
|
|
1521
1647
|
return (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)(RecordRouteHeader, {
|
|
1522
1648
|
resource,
|
|
1523
1649
|
action: "edit",
|
|
@@ -1528,9 +1654,9 @@ function RecordEdit({ resource, id, recordId, record, shown }) {
|
|
|
1528
1654
|
mode: "edit",
|
|
1529
1655
|
recordId,
|
|
1530
1656
|
record,
|
|
1531
|
-
onCancel: () => navigate(back),
|
|
1657
|
+
onCancel: () => navigate(back, { origin: "inherit" }),
|
|
1532
1658
|
onSuccess: () => {
|
|
1533
|
-
if (mounted.current) navigate(back);
|
|
1659
|
+
if (mounted.current) navigate(back, { origin: "inherit" });
|
|
1534
1660
|
}
|
|
1535
1661
|
})] });
|
|
1536
1662
|
}
|
|
@@ -1543,7 +1669,8 @@ function RecordCreate({ resource, defaults }) {
|
|
|
1543
1669
|
const navigate = (0, _burojs_react.useRouteNavigate)();
|
|
1544
1670
|
const mounted = useMountedRef();
|
|
1545
1671
|
const adapter = (0, _burojs_react.useOptionalRouterAdapter)();
|
|
1546
|
-
const list =
|
|
1672
|
+
const list = listTarget(resource);
|
|
1673
|
+
const back = (0, _burojs_react.useReturnTarget)(resource, "create");
|
|
1547
1674
|
const type = adapter?.searchParams.get("type") ?? void 0;
|
|
1548
1675
|
return (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)(RecordRouteHeader, {
|
|
1549
1676
|
resource,
|
|
@@ -1556,11 +1683,11 @@ function RecordCreate({ resource, defaults }) {
|
|
|
1556
1683
|
mode: "create",
|
|
1557
1684
|
...type === void 0 ? {} : { type },
|
|
1558
1685
|
...defaults === void 0 ? {} : { defaults },
|
|
1559
|
-
onCancel: () => navigate(
|
|
1686
|
+
onCancel: () => navigate(back, { origin: "inherit" }),
|
|
1560
1687
|
onSuccess: (result) => {
|
|
1561
1688
|
if (!mounted.current) return;
|
|
1562
1689
|
const id = createdId(result);
|
|
1563
|
-
navigate(id
|
|
1690
|
+
navigate(id !== void 0 && isShowAvailable(app.registry, resource) ? showTarget(resource, id) : list, { origin: "inherit" });
|
|
1564
1691
|
}
|
|
1565
1692
|
})
|
|
1566
1693
|
})] });
|
|
@@ -1732,7 +1859,7 @@ function ResourcePageRouter({ match }) {
|
|
|
1732
1859
|
}
|
|
1733
1860
|
if (match.action === "flow") return (0, react_jsx_runtime.jsx)(PageFlowRouteLoader, { match });
|
|
1734
1861
|
if (recordAction === void 0) return (0, react_jsx_runtime.jsx)(ResourcePageRouterEmpty, {});
|
|
1735
|
-
if (!
|
|
1862
|
+
if (!(0, _burojs_react.recordRouteAvailable)(app.registry, resource, recordAction)) return (0, react_jsx_runtime.jsx)(NavAreaNotFound, {});
|
|
1736
1863
|
return (0, react_jsx_runtime.jsx)(RecordRoute, {
|
|
1737
1864
|
resource,
|
|
1738
1865
|
action: recordAction,
|
|
@@ -1916,12 +2043,24 @@ Object.defineProperty(exports, "headerTrail", {
|
|
|
1916
2043
|
return headerTrail;
|
|
1917
2044
|
}
|
|
1918
2045
|
});
|
|
2046
|
+
Object.defineProperty(exports, "isShowAvailable", {
|
|
2047
|
+
enumerable: true,
|
|
2048
|
+
get: function() {
|
|
2049
|
+
return isShowAvailable;
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
1919
2052
|
Object.defineProperty(exports, "layoutSlot", {
|
|
1920
2053
|
enumerable: true,
|
|
1921
2054
|
get: function() {
|
|
1922
2055
|
return layoutSlot;
|
|
1923
2056
|
}
|
|
1924
2057
|
});
|
|
2058
|
+
Object.defineProperty(exports, "originTrail", {
|
|
2059
|
+
enumerable: true,
|
|
2060
|
+
get: function() {
|
|
2061
|
+
return originTrail;
|
|
2062
|
+
}
|
|
2063
|
+
});
|
|
1925
2064
|
Object.defineProperty(exports, "readRecentRecords", {
|
|
1926
2065
|
enumerable: true,
|
|
1927
2066
|
get: function() {
|
|
@@ -2025,4 +2164,4 @@ Object.defineProperty(exports, "useTrailContext", {
|
|
|
2025
2164
|
}
|
|
2026
2165
|
});
|
|
2027
2166
|
|
|
2028
|
-
//# sourceMappingURL=resource-page-router-
|
|
2167
|
+
//# sourceMappingURL=resource-page-router-qEd2xb55.cjs.map
|