@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,14 +1,14 @@
|
|
|
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_input = require("./input-BI0czGyI.cjs");
|
|
6
6
|
const require_dialog = require("./dialog-vmMdfUWs.cjs");
|
|
7
7
|
const require_relation_create = require("./relation-create-DDEYcKfw.cjs");
|
|
8
8
|
const require_skeleton = require("./skeleton-_1gP7wan.cjs");
|
|
9
|
-
const require_filter_builder = require("./filter-builder-
|
|
9
|
+
const require_filter_builder = require("./filter-builder-ByGhxLf_.cjs");
|
|
10
10
|
const require_label = require("./label-w6JYf2cF.cjs");
|
|
11
|
-
const require_lazy_relation_picker_dialog = require("./lazy-relation-picker-dialog-
|
|
11
|
+
const require_lazy_relation_picker_dialog = require("./lazy-relation-picker-dialog-BAKBRn3V.cjs");
|
|
12
12
|
const require_relation_select = require("./relation-select-Cr3CfNLy.cjs");
|
|
13
13
|
let _burojs_core = require("@burojs/core");
|
|
14
14
|
let _burojs_react = require("@burojs/react");
|
|
@@ -146,10 +146,10 @@ function copyText(value) {
|
|
|
146
146
|
function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
147
147
|
const t = (0, _burojs_react.useOptionalT)();
|
|
148
148
|
const clipboard = (0, _burojs_react.useClipboard)();
|
|
149
|
-
const [copied, setCopied] = (0, react.useState)(
|
|
149
|
+
const [copied, setCopied] = (0, react.useState)(null);
|
|
150
150
|
(0, react.useEffect)(() => {
|
|
151
|
-
if (
|
|
152
|
-
const timer = setTimeout(() => setCopied(
|
|
151
|
+
if (copied === null) return;
|
|
152
|
+
const timer = setTimeout(() => setCopied(null), COPIED_MS);
|
|
153
153
|
return () => clearTimeout(timer);
|
|
154
154
|
}, [copied]);
|
|
155
155
|
const ui = isRecord$1(field.ui) ? field.ui : void 0;
|
|
@@ -180,7 +180,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
180
180
|
const copy = (event) => {
|
|
181
181
|
event.preventDefault();
|
|
182
182
|
event.stopPropagation();
|
|
183
|
-
clipboard(copyText(value)).then(() => setCopied(
|
|
183
|
+
clipboard(copyText(value)).then(() => setCopied("copied"), () => setCopied("failed"));
|
|
184
184
|
};
|
|
185
185
|
return (0, react_jsx_runtime.jsxs)("span", {
|
|
186
186
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 align-bottom",
|
|
@@ -193,7 +193,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
193
193
|
title: label,
|
|
194
194
|
onClick: copy,
|
|
195
195
|
className: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
196
|
-
children: copied ? (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, {
|
|
196
|
+
children: copied === "copied" ? (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, {
|
|
197
197
|
"aria-hidden": "true",
|
|
198
198
|
className: "size-3.5"
|
|
199
199
|
}) : (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCopy, {
|
|
@@ -204,7 +204,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
204
204
|
(0, react_jsx_runtime.jsx)("span", {
|
|
205
205
|
"aria-live": "polite",
|
|
206
206
|
className: "sr-only",
|
|
207
|
-
children: copied ? t("field.copied", { defaultValue: "Copied" }) : ""
|
|
207
|
+
children: copied === "copied" ? t("field.copied", { defaultValue: "Copied" }) : copied === "failed" ? t("field.copyFailed", { defaultValue: "Could not copy" }) : ""
|
|
208
208
|
})
|
|
209
209
|
]
|
|
210
210
|
});
|
|
@@ -284,6 +284,10 @@ function leafAttributes(size, weight) {
|
|
|
284
284
|
...weight === void 0 ? {} : { "data-buro-weight": String(weight) }
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
+
function labelHiddenOf(compiled, node) {
|
|
288
|
+
return compiled.nodes[node.index]?.options.label === "hidden";
|
|
289
|
+
}
|
|
290
|
+
const labelRegion = (hidden, visible) => hidden ? "sr-only" : visible;
|
|
287
291
|
function FieldLeaf({ node }) {
|
|
288
292
|
const { leafIds } = useScreenTree();
|
|
289
293
|
if (node.state === "failed" && node.failedOn.length > 0 && node.failedOn.every((name) => name.startsWith("meta:"))) return (0, react_jsx_runtime.jsx)(MisconfiguredLeaf, { node });
|
|
@@ -295,7 +299,8 @@ function FieldLeaf({ node }) {
|
|
|
295
299
|
return (0, react_jsx_runtime.jsx)(RecordLeaf, { node });
|
|
296
300
|
}
|
|
297
301
|
function MisconfiguredLeaf({ node }) {
|
|
298
|
-
const { leafIds, resource, mode, controller } = useScreenTree();
|
|
302
|
+
const { leafIds, resource, mode, compiled, controller } = useScreenTree();
|
|
303
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
299
304
|
const name = node.field;
|
|
300
305
|
const binding = controller.field(name);
|
|
301
306
|
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
@@ -322,7 +327,7 @@ function MisconfiguredLeaf({ node }) {
|
|
|
322
327
|
"data-buro-field-meta": "failed",
|
|
323
328
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
|
324
329
|
"data-buro-region": "field-label",
|
|
325
|
-
className: "text-sm font-medium leading-none",
|
|
330
|
+
className: labelRegion(hidden, "text-sm font-medium leading-none"),
|
|
326
331
|
children: label
|
|
327
332
|
}), (0, react_jsx_runtime.jsx)("div", {
|
|
328
333
|
"data-buro-region": "field-control",
|
|
@@ -330,12 +335,22 @@ function MisconfiguredLeaf({ node }) {
|
|
|
330
335
|
})]
|
|
331
336
|
});
|
|
332
337
|
}
|
|
338
|
+
function valueAt(record, path) {
|
|
339
|
+
let at = record;
|
|
340
|
+
for (const segment of path.split(".")) {
|
|
341
|
+
if (at === null || typeof at !== "object") return void 0;
|
|
342
|
+
at = at[segment];
|
|
343
|
+
}
|
|
344
|
+
return at;
|
|
345
|
+
}
|
|
333
346
|
function RecordLeaf({ node }) {
|
|
334
347
|
const { resource, mode, compiled, controller } = useScreenTree();
|
|
335
|
-
const
|
|
348
|
+
const head = node.field;
|
|
349
|
+
const name = node.fieldPath ?? head;
|
|
336
350
|
const binding = controller.field(name);
|
|
337
351
|
const size = useLeafSize(binding.field);
|
|
338
352
|
const weight = compiled.nodes[node.index]?.options.weight;
|
|
353
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
339
354
|
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
340
355
|
const tid = (0, _burojs_react.useTestIds)();
|
|
341
356
|
const label = (0, _burojs_core.resolveFieldLabel)(caps, name, (0, _burojs_core.declaredText)("field", binding.field, "label"));
|
|
@@ -352,7 +367,7 @@ function RecordLeaf({ node }) {
|
|
|
352
367
|
"data-buro-restricted": "true",
|
|
353
368
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
|
354
369
|
"data-buro-region": "field-label",
|
|
355
|
-
className: "text-sm font-medium leading-none",
|
|
370
|
+
className: labelRegion(hidden, "text-sm font-medium leading-none"),
|
|
356
371
|
children: label
|
|
357
372
|
}), (0, react_jsx_runtime.jsx)("div", {
|
|
358
373
|
"data-buro-region": "field-control",
|
|
@@ -372,7 +387,7 @@ function RecordLeaf({ node }) {
|
|
|
372
387
|
});
|
|
373
388
|
}
|
|
374
389
|
const record = controller.record;
|
|
375
|
-
const value = mode === "show" ? record
|
|
390
|
+
const value = mode === "show" ? valueAt(record, name) ?? binding.value : mode === "edit" && controller.plan?.fields[head] !== "active" ? valueAt(record, name) ?? binding.value : binding.value;
|
|
376
391
|
const display = (0, react_jsx_runtime.jsx)(FieldDisplay, {
|
|
377
392
|
resource: binding.resource,
|
|
378
393
|
name,
|
|
@@ -380,6 +395,8 @@ function RecordLeaf({ node }) {
|
|
|
380
395
|
value,
|
|
381
396
|
metaSources: controller.sources,
|
|
382
397
|
...record === void 0 ? {} : { record },
|
|
398
|
+
...binding.absentPaths === void 0 ? {} : { absentPaths: binding.absentPaths },
|
|
399
|
+
...binding.pathStatus === void 0 ? {} : { pathStatus: binding.pathStatus },
|
|
383
400
|
fallback: value == null || value === "" ? (0, react_jsx_runtime.jsx)("span", {
|
|
384
401
|
className: "text-muted-foreground",
|
|
385
402
|
children: "—"
|
|
@@ -390,11 +407,11 @@ function RecordLeaf({ node }) {
|
|
|
390
407
|
"data-testid": `show-field:${resource}:${name}`,
|
|
391
408
|
children: [(0, react_jsx_runtime.jsxs)("dt", {
|
|
392
409
|
"data-buro-region": "field-label",
|
|
393
|
-
className: require_use_theme.cn("flex items-center gap-0.5", FIELD_LABEL_SHOW),
|
|
410
|
+
className: labelRegion(hidden, require_use_theme.cn("flex items-center gap-0.5", FIELD_LABEL_SHOW)),
|
|
394
411
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
395
412
|
className: "min-w-0",
|
|
396
413
|
children: label
|
|
397
|
-
}), (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
414
|
+
}), hidden ? null : (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
398
415
|
address: `${resource}/fields/${name}`,
|
|
399
416
|
name: label
|
|
400
417
|
})]
|
|
@@ -414,8 +431,8 @@ function RecordLeaf({ node }) {
|
|
|
414
431
|
"data-testid": tid.formField(resource, mode, name),
|
|
415
432
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
416
433
|
"data-buro-region": "field-label",
|
|
417
|
-
className: "flex items-center gap-2",
|
|
418
|
-
children: [(0, react_jsx_runtime.jsx)(require_label.Label, { children: label }), (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
434
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
435
|
+
children: [(0, react_jsx_runtime.jsx)(require_label.Label, { children: label }), hidden ? null : (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
419
436
|
address: `${resource}/fields/${name}`,
|
|
420
437
|
name: label,
|
|
421
438
|
testId: `${tid.formField(resource, mode, name)}:info`
|
|
@@ -451,11 +468,12 @@ function RecordLeaf({ node }) {
|
|
|
451
468
|
node,
|
|
452
469
|
binding,
|
|
453
470
|
label,
|
|
471
|
+
labelHidden: hidden,
|
|
454
472
|
attributes,
|
|
455
473
|
inputId
|
|
456
474
|
});
|
|
457
475
|
}
|
|
458
|
-
function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
476
|
+
function ActiveLeaf({ node, binding, label, labelHidden, attributes, inputId }) {
|
|
459
477
|
const { resource, mode, controller, disabled: locked } = useScreenTree();
|
|
460
478
|
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
461
479
|
const tid = (0, _burojs_react.useTestIds)();
|
|
@@ -499,13 +517,13 @@ function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
|
499
517
|
onBlur: binding.onBlur,
|
|
500
518
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
501
519
|
"data-buro-region": "field-label",
|
|
502
|
-
className: "flex items-center gap-2",
|
|
520
|
+
className: labelRegion(labelHidden, "flex items-center gap-2"),
|
|
503
521
|
children: [(0, react_jsx_runtime.jsx)(require_label.Label, {
|
|
504
522
|
id: `${inputId}-label`,
|
|
505
523
|
htmlFor: inputId,
|
|
506
524
|
required: binding.required,
|
|
507
525
|
children: label
|
|
508
|
-
}), (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
526
|
+
}), labelHidden ? null : (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
509
527
|
address: `${resource}/fields/${name}`,
|
|
510
528
|
name: label,
|
|
511
529
|
testId: `${tid.formField(resource, mode, name)}:info`
|
|
@@ -528,13 +546,17 @@ function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
|
528
546
|
...mode === "create" || record === void 0 ? {} : { record },
|
|
529
547
|
form: controller.values,
|
|
530
548
|
metaSources: controller.sources,
|
|
549
|
+
...controller.baseline === void 0 ? {} : { baseline: controller.baseline },
|
|
531
550
|
...describedBy === void 0 ? {} : { descriptionId: describedBy },
|
|
532
551
|
...errorMessageId === void 0 ? {} : { errorId: errorMessageId },
|
|
533
552
|
errorMessage: errorText,
|
|
534
553
|
issues: binding.issues,
|
|
535
554
|
...binding.fixedFilters === void 0 ? {} : { fixedFilters: binding.fixedFilters },
|
|
555
|
+
...binding.optionSubtitle === void 0 ? {} : { optionSubtitle: binding.optionSubtitle },
|
|
536
556
|
...binding.relationSeeds === void 0 ? {} : { relationSeeds: binding.relationSeeds },
|
|
537
557
|
...binding.link === void 0 ? {} : { link: binding.link },
|
|
558
|
+
...binding.absentPaths === void 0 ? {} : { absentPaths: binding.absentPaths },
|
|
559
|
+
...binding.pathStatus === void 0 ? {} : { pathStatus: binding.pathStatus },
|
|
538
560
|
fallback: (0, react_jsx_runtime.jsx)(require_input.Input, {
|
|
539
561
|
id: inputId,
|
|
540
562
|
name: inputId,
|
|
@@ -581,6 +603,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
581
603
|
const binding = controller.field(name);
|
|
582
604
|
const size = useLeafSize(binding.field);
|
|
583
605
|
const weight = compiled.nodes[node.index]?.options.weight;
|
|
606
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
584
607
|
const attributes = leafAttributes(size, weight);
|
|
585
608
|
const docRef = (0, _burojs_core.i18nPrefixToRef)(prefix);
|
|
586
609
|
const docScope = docRef.namespace === "default" ? docRef.id : (0, _burojs_core.formatEntityRef)(docRef);
|
|
@@ -599,7 +622,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
599
622
|
});
|
|
600
623
|
const label = (0, _burojs_core.resolveFieldLabel)(caps, name, (0, _burojs_core.declaredText)("field", binding.field, "label"));
|
|
601
624
|
const hint = (0, _burojs_core.resolveFieldSlot)(caps, name, "description", require_filter_builder.fieldDescription(binding.field));
|
|
602
|
-
const info = (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
625
|
+
const info = hidden ? null : (0, react_jsx_runtime.jsx)(require_check_confirm_dialog.DocInfo, {
|
|
603
626
|
address: `${docScope}/fields/${name}`,
|
|
604
627
|
name: label,
|
|
605
628
|
testId: `${prefix}:field:${name}:info`
|
|
@@ -616,7 +639,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
616
639
|
children: [
|
|
617
640
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
618
641
|
"data-buro-region": "field-label",
|
|
619
|
-
className: "flex items-center gap-2",
|
|
642
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
620
643
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
621
644
|
className: FIELD_LABEL_SHOW,
|
|
622
645
|
children: label
|
|
@@ -649,6 +672,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
649
672
|
...binding,
|
|
650
673
|
field: binding.field,
|
|
651
674
|
metaSources: controller.sources,
|
|
675
|
+
...controller.baseline === void 0 ? {} : { baseline: controller.baseline },
|
|
652
676
|
inputId,
|
|
653
677
|
labelId: `${inputId}-label`,
|
|
654
678
|
i18nPrefix: prefix,
|
|
@@ -664,7 +688,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
664
688
|
children: [
|
|
665
689
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
666
690
|
"data-buro-region": "field-label",
|
|
667
|
-
className: "flex items-center gap-2",
|
|
691
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
668
692
|
children: [(0, react_jsx_runtime.jsx)(require_label.Label, {
|
|
669
693
|
id: `${inputId}-label`,
|
|
670
694
|
htmlFor: inputId,
|
|
@@ -926,10 +950,7 @@ function RecordInlineFlow({ name }) {
|
|
|
926
950
|
const id = frame?.recordId;
|
|
927
951
|
const asRead = frame === null ? void 0 : (0, _burojs_react.policyRecordOf)(frame.controller, frame.record);
|
|
928
952
|
const key = placement?.key ?? flowName;
|
|
929
|
-
const state = frame === null || id === void 0 || asRead === void 0 ? null : resolve(flowName, {
|
|
930
|
-
...asRead,
|
|
931
|
-
id
|
|
932
|
-
});
|
|
953
|
+
const state = frame === null || id === void 0 || asRead === void 0 ? null : resolve(flowName, (0, _burojs_react.withRecordKeys)(asRead, { id }));
|
|
933
954
|
const kept = holder?.get(key);
|
|
934
955
|
const stale = state?.state === "absent" && state.cause === "when" && kept !== void 0 && kept.dirty;
|
|
935
956
|
const gone = state?.state === "absent" && !stale;
|
|
@@ -941,10 +962,7 @@ function RecordInlineFlow({ name }) {
|
|
|
941
962
|
key
|
|
942
963
|
]);
|
|
943
964
|
if (frame === null || asRead === void 0 || id === void 0 || compiled === null) return null;
|
|
944
|
-
const row = {
|
|
945
|
-
...asRead,
|
|
946
|
-
id
|
|
947
|
-
};
|
|
965
|
+
const row = (0, _burojs_react.withRecordKeys)(asRead, { id });
|
|
948
966
|
const control = resolve(flowName, row);
|
|
949
967
|
switch (control.state) {
|
|
950
968
|
case "undecided":
|
|
@@ -1215,6 +1233,28 @@ function placementSeeds(where, resolved, closure) {
|
|
|
1215
1233
|
return Object.freeze(seeds);
|
|
1216
1234
|
}
|
|
1217
1235
|
//#endregion
|
|
1236
|
+
//#region src/enum/enum-settling.tsx
|
|
1237
|
+
function unknownEnumValueLabel(caps, def, ns, value) {
|
|
1238
|
+
const declared = (0, _burojs_core.enumFallbackText)(def);
|
|
1239
|
+
if (def.fallback === void 0 && declared === void 0) return {
|
|
1240
|
+
label: value,
|
|
1241
|
+
fallback: false
|
|
1242
|
+
};
|
|
1243
|
+
return {
|
|
1244
|
+
label: (0, _burojs_core.resolveContentSlot)(caps, [(0, _burojs_core.enumFallbackKey)(ns)], { default: declared }) ?? value,
|
|
1245
|
+
fallback: true
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
function EnumSettlingRow({ status, testid }) {
|
|
1249
|
+
const t = (0, _burojs_react.useOptionalT)();
|
|
1250
|
+
return (0, react_jsx_runtime.jsx)("div", {
|
|
1251
|
+
role: "status",
|
|
1252
|
+
"data-testid": testid === void 0 ? void 0 : `${testid}:${status}`,
|
|
1253
|
+
className: "px-2 py-1.5 text-sm text-muted-foreground",
|
|
1254
|
+
children: status === "pending" ? t("field.loading", { defaultValue: "Loading…" }) : t("relation.failed", { defaultValue: "Failed to load options." })
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
//#endregion
|
|
1218
1258
|
//#region src/enum/enum-badge.tsx
|
|
1219
1259
|
function BadgeBody({ icon, label }) {
|
|
1220
1260
|
return (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -1285,9 +1325,9 @@ function EnumBadge({ enumName: enumInput, value, testid, className, presentation
|
|
|
1285
1325
|
children: body
|
|
1286
1326
|
});
|
|
1287
1327
|
}
|
|
1288
|
-
const
|
|
1289
|
-
if (
|
|
1290
|
-
const fallbackLabel =
|
|
1328
|
+
const unknown = unknownEnumValueLabel(caps, def, ns, value);
|
|
1329
|
+
if (unknown.fallback) {
|
|
1330
|
+
const fallbackLabel = unknown.label;
|
|
1291
1331
|
if (presentation === "plain") return (0, react_jsx_runtime.jsx)("span", {
|
|
1292
1332
|
"data-testid": `${id}:fallback`,
|
|
1293
1333
|
className,
|
|
@@ -1515,35 +1555,6 @@ function useShownItemActions(resource, record, surface, hideFlows, sources) {
|
|
|
1515
1555
|
return hideFlows === void 0 ? shown : shown.filter((a) => a.flow === void 0 || !hideFlows(a.name));
|
|
1516
1556
|
}
|
|
1517
1557
|
//#endregion
|
|
1518
|
-
//#region src/layout/record-targets.ts
|
|
1519
|
-
function recordRouteAvailable(registry, resource, action) {
|
|
1520
|
-
if ((0, _burojs_core.resolveStaticAvailability)(registry, resource, action).state !== "available") return false;
|
|
1521
|
-
const def = registry.get(resource);
|
|
1522
|
-
return def !== void 0 && (0, _burojs_core.hasRecordPage)(def, action);
|
|
1523
|
-
}
|
|
1524
|
-
function isShowAvailable(registry, resource) {
|
|
1525
|
-
return recordRouteAvailable(registry, resource, "show");
|
|
1526
|
-
}
|
|
1527
|
-
function showTarget(resource, id) {
|
|
1528
|
-
return {
|
|
1529
|
-
resource,
|
|
1530
|
-
action: "show",
|
|
1531
|
-
params: { id }
|
|
1532
|
-
};
|
|
1533
|
-
}
|
|
1534
|
-
function listTarget(resource) {
|
|
1535
|
-
return {
|
|
1536
|
-
resource,
|
|
1537
|
-
action: "list"
|
|
1538
|
-
};
|
|
1539
|
-
}
|
|
1540
|
-
function recordReturnTarget(registry, resource, id) {
|
|
1541
|
-
return isShowAvailable(registry, resource) ? showTarget(resource, id) : listTarget(resource);
|
|
1542
|
-
}
|
|
1543
|
-
function editBackHref(registry, resource, id, backHref) {
|
|
1544
|
-
return backHref ?? (0, _burojs_react.resolveRoute)(recordReturnTarget(registry, resource, id), registry);
|
|
1545
|
-
}
|
|
1546
|
-
//#endregion
|
|
1547
1558
|
//#region src/lib/typography.ts
|
|
1548
1559
|
const typography = {
|
|
1549
1560
|
h1: "text-2xl font-semibold tracking-tight",
|
|
@@ -1671,16 +1682,16 @@ function ShowPageHeader({ resource: resourceInput, record, extraActions, breadcr
|
|
|
1671
1682
|
}
|
|
1672
1683
|
function EditPageHeader({ resource: resourceInput, record, backHref, breadcrumbs }) {
|
|
1673
1684
|
const resource = (0, _burojs_core.routeResourceKey)(resourceInput);
|
|
1674
|
-
const
|
|
1675
|
-
const def = app.registry.get(resource);
|
|
1685
|
+
const def = (0, _burojs_react.useApp)().registry.get(resource);
|
|
1676
1686
|
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
1677
1687
|
const recordKey = (0, _burojs_react.recordKeyOf)(def, record);
|
|
1678
1688
|
const recordName = (0, _burojs_react.useProjectedTitle)(resource, recordKey, record);
|
|
1689
|
+
const back = (0, _burojs_react.useReturnTarget)(resource, "edit", String(recordKey ?? ""));
|
|
1679
1690
|
return (0, react_jsx_runtime.jsx)(PageHeader, {
|
|
1680
1691
|
resource,
|
|
1681
1692
|
mode: "edit",
|
|
1682
1693
|
recordName,
|
|
1683
|
-
backHref:
|
|
1694
|
+
backHref: backHref ?? back,
|
|
1684
1695
|
breadcrumbs,
|
|
1685
1696
|
backLabel: recordName ? `${(0, _burojs_core.resolveResourceLabel)(caps, resource, "single", def)}: ${recordName}` : void 0,
|
|
1686
1697
|
actions: (0, react_jsx_runtime.jsx)(ActionOverflow, {
|
|
@@ -1969,19 +1980,26 @@ function BuroPanelFrame({ body, title, description, collapsible, open, onToggle,
|
|
|
1969
1980
|
"data-buro-region": "panel-title",
|
|
1970
1981
|
className: "flex items-center gap-1",
|
|
1971
1982
|
children: [
|
|
1972
|
-
collapsible ? (0, react_jsx_runtime.jsx)("
|
|
1983
|
+
collapsible && title !== void 0 ? (0, react_jsx_runtime.jsx)("h3", {
|
|
1984
|
+
id: titleId,
|
|
1985
|
+
className: "min-w-0 flex-1 text-sm font-semibold",
|
|
1986
|
+
children: (0, react_jsx_runtime.jsxs)("button", {
|
|
1987
|
+
type: "button",
|
|
1988
|
+
"aria-expanded": open,
|
|
1989
|
+
"aria-controls": bodyId,
|
|
1990
|
+
onClick: () => onToggle(!open),
|
|
1991
|
+
className: "-mx-1 flex w-full items-center gap-1 rounded px-1 text-left hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
1992
|
+
children: [(0, react_jsx_runtime.jsx)(Chevron, { open }), title]
|
|
1993
|
+
})
|
|
1994
|
+
}) : collapsible ? (0, react_jsx_runtime.jsx)("button", {
|
|
1973
1995
|
type: "button",
|
|
1974
1996
|
"aria-expanded": open,
|
|
1975
1997
|
"aria-controls": bodyId,
|
|
1976
1998
|
"aria-label": open ? t("screen.collapse", { defaultValue: "Collapse" }) : t("screen.expand", { defaultValue: "Expand" }),
|
|
1977
1999
|
onClick: () => onToggle(!open),
|
|
1978
2000
|
className: "inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:bg-muted",
|
|
1979
|
-
children: (0, react_jsx_runtime.jsx)(
|
|
1980
|
-
|
|
1981
|
-
"aria-hidden": "true"
|
|
1982
|
-
})
|
|
1983
|
-
}) : null,
|
|
1984
|
-
title === void 0 ? null : (0, react_jsx_runtime.jsx)("h3", {
|
|
2001
|
+
children: (0, react_jsx_runtime.jsx)(Chevron, { open })
|
|
2002
|
+
}) : title === void 0 ? null : (0, react_jsx_runtime.jsx)("h3", {
|
|
1985
2003
|
id: titleId,
|
|
1986
2004
|
className: "text-sm font-semibold",
|
|
1987
2005
|
children: title
|
|
@@ -1999,6 +2017,12 @@ function BuroPanelFrame({ body, title, description, collapsible, open, onToggle,
|
|
|
1999
2017
|
]
|
|
2000
2018
|
});
|
|
2001
2019
|
}
|
|
2020
|
+
function Chevron({ open }) {
|
|
2021
|
+
return (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronRight, {
|
|
2022
|
+
className: open ? "h-4 w-4 shrink-0 rotate-90 text-muted-foreground transition-transform" : "h-4 w-4 shrink-0 text-muted-foreground transition-transform",
|
|
2023
|
+
"aria-hidden": "true"
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2002
2026
|
function BuroTabsFrame({ tabs, active, onSelect, info, nodeAttributes }) {
|
|
2003
2027
|
if (tabs.length === 1) return (0, react_jsx_runtime.jsx)("div", {
|
|
2004
2028
|
...nodeAttributes,
|
|
@@ -2616,7 +2640,8 @@ function ColumnHeaderMenu({ label, sortDirection, sortable, onSort, pinned, onPi
|
|
|
2616
2640
|
}
|
|
2617
2641
|
//#endregion
|
|
2618
2642
|
//#region src/resource/column-accessor.ts
|
|
2619
|
-
function columnAccessor(column) {
|
|
2643
|
+
function columnAccessor(column, objectPath = false) {
|
|
2644
|
+
if (objectPath) return { accessorFn: (row) => (0, _burojs_react.readColumnValue)(row, column, true) };
|
|
2620
2645
|
return column.includes(".") ? { accessorFn: (row) => row[column] } : { accessorKey: column };
|
|
2621
2646
|
}
|
|
2622
2647
|
//#endregion
|
|
@@ -3225,7 +3250,8 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3225
3250
|
});
|
|
3226
3251
|
for (const col of visibleColumnKeys) {
|
|
3227
3252
|
const target = columnTarget(app.registry, resource, col);
|
|
3228
|
-
const
|
|
3253
|
+
const objectPath = (0, _burojs_react.isObjectColumn)(app.registry, resource, col);
|
|
3254
|
+
const field = target !== void 0 ? target.field : objectPath ? (0, _burojs_react.resolveObjectColumn)(app.registry, resource, col)?.field : def === void 0 ? void 0 : (0, _burojs_core.declaredField)(def, col);
|
|
3229
3255
|
const declaredLabel = (0, _burojs_core.declaredText)("field", field, "label");
|
|
3230
3256
|
const headerLabel = target === void 0 ? (0, _burojs_core.resolveFieldLabel)(volatileRef.current.i18nCaps, col, declaredLabel) : (0, _burojs_core.resolveFieldLabel)(capsOf(volatileRef.current.i18nCaps, target.resource), target.name, declaredLabel);
|
|
3231
3257
|
const ui = columnUiOf(col);
|
|
@@ -3233,12 +3259,15 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3233
3259
|
...field ?? { type: "unknown" },
|
|
3234
3260
|
name: target === void 0 ? col : target.name
|
|
3235
3261
|
};
|
|
3236
|
-
const cellEntry = { display:
|
|
3262
|
+
const cellEntry = { display: {
|
|
3263
|
+
...ui.display,
|
|
3264
|
+
...ui.display.dateDisplay
|
|
3265
|
+
} };
|
|
3237
3266
|
const wraps = ui.display.overflow === "wrap";
|
|
3238
3267
|
const columnSortable = volatileRef.current.sortable?.(col) ?? (def !== void 0 && (0, _burojs_core.isColumnSortable)(def, col, app, app.registry));
|
|
3239
3268
|
cols.push({
|
|
3240
3269
|
id: col,
|
|
3241
|
-
...columnAccessor(col),
|
|
3270
|
+
...columnAccessor(col, objectPath),
|
|
3242
3271
|
size: ui.default,
|
|
3243
3272
|
minSize: ui.min,
|
|
3244
3273
|
maxSize: ui.max ?? Number.MAX_SAFE_INTEGER,
|
|
@@ -3297,7 +3326,7 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3297
3326
|
cell: ({ row }) => {
|
|
3298
3327
|
const raw = row.original;
|
|
3299
3328
|
const record = volatileRef.current.viewRow(raw);
|
|
3300
|
-
const value = record
|
|
3329
|
+
const value = (0, _burojs_react.readColumnValue)(record, col, objectPath);
|
|
3301
3330
|
const customCell = volatileRef.current.renderCell?.(col, value, record);
|
|
3302
3331
|
const cellInner = customCell !== void 0 ? customCell : (0, react_jsx_runtime.jsx)(require_filter_builder.ResolvedFieldDisplay, {
|
|
3303
3332
|
resource: target === void 0 ? resourceRef : target.ref,
|
|
@@ -4944,6 +4973,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
4944
4973
|
const each = compiled?.each ?? false;
|
|
4945
4974
|
const [running, setRunning] = (0, react.useState)(false);
|
|
4946
4975
|
const [summary, setSummary] = (0, react.useState)(null);
|
|
4976
|
+
const afterSummary = (0, react.useRef)(null);
|
|
4947
4977
|
const testid = tid.bulkAction(resource, actionName);
|
|
4948
4978
|
if (control.state === "absent") return null;
|
|
4949
4979
|
const variant = chrome.destructive ? "destructive" : "outline";
|
|
@@ -4966,11 +4996,20 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
4966
4996
|
const finish = (result, progress) => {
|
|
4967
4997
|
setRunning(false);
|
|
4968
4998
|
if (progress === void 0) return;
|
|
4969
|
-
|
|
4999
|
+
const summarize = result.outcome !== "success" || progress.rereadSkipped.some((entry) => entry.policy === "warn");
|
|
5000
|
+
if (summarize) setSummary({
|
|
4970
5001
|
progress,
|
|
4971
5002
|
total: ids.length
|
|
4972
5003
|
});
|
|
4973
|
-
|
|
5004
|
+
const remaining = ids.filter((id) => !progress.success.includes(id));
|
|
5005
|
+
if (summarize && remaining.length === 0) afterSummary.current = () => onSelectionChange?.([]);
|
|
5006
|
+
else onSelectionChange?.(remaining);
|
|
5007
|
+
};
|
|
5008
|
+
const closeSummary = () => {
|
|
5009
|
+
setSummary(null);
|
|
5010
|
+
const pending = afterSummary.current;
|
|
5011
|
+
afterSummary.current = null;
|
|
5012
|
+
pending?.();
|
|
4974
5013
|
};
|
|
4975
5014
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4976
5015
|
(0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
@@ -5000,7 +5039,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
5000
5039
|
(0, react_jsx_runtime.jsx)(require_dialog.Dialog, {
|
|
5001
5040
|
open: summary !== null,
|
|
5002
5041
|
onOpenChange: (open) => {
|
|
5003
|
-
if (!open)
|
|
5042
|
+
if (!open) closeSummary();
|
|
5004
5043
|
},
|
|
5005
5044
|
children: (0, react_jsx_runtime.jsxs)(require_dialog.DialogContent, {
|
|
5006
5045
|
"data-testid": `${tid.bulkSummary(resource, actionName)}:dialog`,
|
|
@@ -5021,7 +5060,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
5021
5060
|
type: "button",
|
|
5022
5061
|
variant: "outline",
|
|
5023
5062
|
"data-testid": `${tid.bulkSummary(resource, actionName)}:close`,
|
|
5024
|
-
onClick:
|
|
5063
|
+
onClick: closeSummary,
|
|
5025
5064
|
children: t("flow.close", { defaultValue: "Close" })
|
|
5026
5065
|
}) })
|
|
5027
5066
|
]
|
|
@@ -6087,10 +6126,7 @@ function RecordActionsView() {
|
|
|
6087
6126
|
const id = useFrameId();
|
|
6088
6127
|
const holder = (0, _burojs_react.useScreenState)()?.inline;
|
|
6089
6128
|
if (mode === "create" || record === void 0 || id === void 0) return null;
|
|
6090
|
-
const row = {
|
|
6091
|
-
...(0, _burojs_react.policyRecordOf)(controller, record),
|
|
6092
|
-
id
|
|
6093
|
-
};
|
|
6129
|
+
const row = (0, _burojs_react.withRecordKeys)((0, _burojs_react.policyRecordOf)(controller) ?? record, { id });
|
|
6094
6130
|
holder?.declare(inlineFlowNames(controller.screen, controller.plan));
|
|
6095
6131
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
6096
6132
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -6133,26 +6169,33 @@ function FormActionsView() {
|
|
|
6133
6169
|
const labelCaps = (0, _burojs_react.useI18nCaps)(resource);
|
|
6134
6170
|
const tid = (0, _burojs_react.useTestIds)();
|
|
6135
6171
|
const id = useFrameId();
|
|
6172
|
+
const back = (0, _burojs_react.useReturnTarget)(resource, mode === "create" ? "create" : "edit", mode === "edit" ? id : void 0);
|
|
6136
6173
|
const failedIssues = chrome.serverIssues;
|
|
6137
6174
|
const livePlan = controller.plan;
|
|
6138
|
-
const
|
|
6175
|
+
const placed = (0, react.useMemo)(() => new Set(livePlan?.placedPaths ?? []), [livePlan]);
|
|
6176
|
+
const alertIssues = (0, react.useMemo)(() => failedIssues === void 0 || failedIssues.length === 0 ? NO_ALERT_ISSUES : (0, _burojs_core.routeServerIssues)({ issues: failedIssues }, (segment) => segment, (field, path) => field !== "_form" && (livePlan === null || livePlan.fields[field] === "active" && (0, _burojs_core_internal.deepestPlacedPath)(path, placed) !== void 0)).form, [
|
|
6177
|
+
failedIssues,
|
|
6178
|
+
livePlan,
|
|
6179
|
+
placed
|
|
6180
|
+
]);
|
|
6139
6181
|
const fieldDefs = app.registry.get(resource)?.fields;
|
|
6140
6182
|
if (mode === "show") return null;
|
|
6141
|
-
const busy = controller.isSubmitting;
|
|
6183
|
+
const busy = controller.isSubmitting || chrome.created === true;
|
|
6142
6184
|
const cancel = () => {
|
|
6143
6185
|
if (chrome.onCancel !== void 0) chrome.onCancel();
|
|
6144
|
-
else navigate(
|
|
6186
|
+
else navigate(back, { origin: "inherit" });
|
|
6145
6187
|
};
|
|
6146
6188
|
const plan = controller.plan;
|
|
6147
6189
|
const undrawn = (field) => plan === null || plan.fields[field] === void 0 || plan.fields[field] === "inactive";
|
|
6148
|
-
const recordLevel = (issue) => issue.field === "_form" || undrawn(issue.field);
|
|
6190
|
+
const recordLevel = (issue) => issue.field === "_form" || undrawn((0, _burojs_core_internal.pathHead)(issue.field)) || !placed.has(issue.field);
|
|
6149
6191
|
const undrawnBlockers = (controller.checkOutcome?.blockers ?? []).flatMap((issue) => {
|
|
6150
6192
|
const field = typeof issue.path?.[0] === "string" ? issue.path[0] : "_form";
|
|
6151
|
-
if (field !== "_form" && !undrawn(field)) return [];
|
|
6193
|
+
if (field !== "_form" && !undrawn(field) && (0, _burojs_core_internal.deepestPlacedPath)(issue.path, placed) !== void 0) return [];
|
|
6152
6194
|
if (controller.errors.some((own) => own.code === issue.code && own.field === field)) return [];
|
|
6153
6195
|
return [{
|
|
6154
6196
|
...issue,
|
|
6155
|
-
field
|
|
6197
|
+
field,
|
|
6198
|
+
path: field === "_form" ? [] : issue.path.slice(1)
|
|
6156
6199
|
}];
|
|
6157
6200
|
});
|
|
6158
6201
|
const formErrors = firstPreferred([...controller.errors.filter(recordLevel), ...undrawnBlockers]);
|
|
@@ -6172,7 +6215,7 @@ function FormActionsView() {
|
|
|
6172
6215
|
if (!retryable.includes(checkId)) retryable.push(checkId);
|
|
6173
6216
|
}
|
|
6174
6217
|
const failure = chrome.submitError === void 0 ? void 0 : failureText(chrome.submitError, chrome.submitApplied, t, caps);
|
|
6175
|
-
const serverIssues = bySeverity(alertIssues).
|
|
6218
|
+
const serverIssues = bySeverity(alertIssues).flatMap((issue) => {
|
|
6176
6219
|
const head = issue.path[0];
|
|
6177
6220
|
const name = typeof head === "string" ? head : void 0;
|
|
6178
6221
|
const declared = name === void 0 ? void 0 : fieldDefs?.[name];
|
|
@@ -6185,11 +6228,12 @@ function FormActionsView() {
|
|
|
6185
6228
|
t: caps.t,
|
|
6186
6229
|
...declared === void 0 ? {} : { fieldKey: `resources.${resource}.fields.${name}` }
|
|
6187
6230
|
});
|
|
6188
|
-
return
|
|
6231
|
+
if (issue.path.length === 0 && message === failure) return [];
|
|
6232
|
+
return [{
|
|
6189
6233
|
label: declared === void 0 || name === void 0 ? void 0 : (0, _burojs_core.resolveFieldLabel)(labelCaps, name, (0, _burojs_core.declaredText)("field", declared, "label")),
|
|
6190
6234
|
message,
|
|
6191
6235
|
severity: issue.severity
|
|
6192
|
-
};
|
|
6236
|
+
}];
|
|
6193
6237
|
});
|
|
6194
6238
|
const steps = controller.steps;
|
|
6195
6239
|
const midSteps = steps !== null && steps.ids.length > 1 && steps.current !== void 0 && steps.current !== steps.ids[steps.ids.length - 1];
|
|
@@ -6681,8 +6725,8 @@ function declaresDisplay(field) {
|
|
|
6681
6725
|
return field !== void 0 && (0, _burojs_core.resolveSurfaceUi)(field, "column").use !== void 0;
|
|
6682
6726
|
}
|
|
6683
6727
|
const NO_INITIAL_FILTERS = Object.freeze({});
|
|
6684
|
-
const RelatedCards = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("./related-list-cards-
|
|
6685
|
-
const RelatedTimeline = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("./related-list-timeline-
|
|
6728
|
+
const RelatedCards = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("./related-list-cards-Bc_vfCE_.cjs"))).RelatedCards }));
|
|
6729
|
+
const RelatedTimeline = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("./related-list-timeline-k0DtnxTs.cjs"))).RelatedTimeline }));
|
|
6686
6730
|
function discriminatorOptionLabel(field, value) {
|
|
6687
6731
|
const text = (0, _burojs_core.fieldOptionText)(field, value);
|
|
6688
6732
|
if (text !== void 0) return text;
|
|
@@ -8153,7 +8197,7 @@ function RelatedRecordView({ props, empty }) {
|
|
|
8153
8197
|
});
|
|
8154
8198
|
const result = query.data;
|
|
8155
8199
|
const raw = result?.data;
|
|
8156
|
-
const dtoRow = (0, react.useMemo)(() => raw !== null && typeof raw === "object" && projection !== void 0 ? (0, _burojs_core.projectDto)(
|
|
8200
|
+
const dtoRow = (0, react.useMemo)(() => raw !== null && typeof raw === "object" && projection !== void 0 ? (0, _burojs_react.deriveRecord)(raw, (record) => (0, _burojs_core.projectDto)(record, projection)) : void 0, [raw, projection]);
|
|
8157
8201
|
const access = (0, _burojs_react.useFieldAccess)(resource, "record", dtoRow);
|
|
8158
8202
|
const projected = (0, _burojs_react.useProjectedRecord)(resource, dtoRow, { placeholder: query.isPlaceholderData === true });
|
|
8159
8203
|
const fieldsKey = JSON.stringify(own.fields ?? null);
|
|
@@ -8194,10 +8238,7 @@ function RelatedRecordView({ props, empty }) {
|
|
|
8194
8238
|
children: own.title
|
|
8195
8239
|
}), own.toolbar === "item" ? (0, react_jsx_runtime.jsx)(ActionOverflow, {
|
|
8196
8240
|
resource,
|
|
8197
|
-
record: {
|
|
8198
|
-
...dtoRow,
|
|
8199
|
-
id
|
|
8200
|
-
},
|
|
8241
|
+
record: (0, _burojs_react.withRecordKeys)(dtoRow, { id }),
|
|
8201
8242
|
surface: "show"
|
|
8202
8243
|
}) : null]
|
|
8203
8244
|
}), (0, react_jsx_runtime.jsx)("dl", {
|
|
@@ -8589,6 +8630,12 @@ Object.defineProperty(exports, "EnumBadge", {
|
|
|
8589
8630
|
return EnumBadge;
|
|
8590
8631
|
}
|
|
8591
8632
|
});
|
|
8633
|
+
Object.defineProperty(exports, "EnumSettlingRow", {
|
|
8634
|
+
enumerable: true,
|
|
8635
|
+
get: function() {
|
|
8636
|
+
return EnumSettlingRow;
|
|
8637
|
+
}
|
|
8638
|
+
});
|
|
8592
8639
|
Object.defineProperty(exports, "ExportButton", {
|
|
8593
8640
|
enumerable: true,
|
|
8594
8641
|
get: function() {
|
|
@@ -8757,6 +8804,12 @@ Object.defineProperty(exports, "RelatedItem", {
|
|
|
8757
8804
|
return RelatedItem;
|
|
8758
8805
|
}
|
|
8759
8806
|
});
|
|
8807
|
+
Object.defineProperty(exports, "RelatedTimelineSkeleton", {
|
|
8808
|
+
enumerable: true,
|
|
8809
|
+
get: function() {
|
|
8810
|
+
return RelatedTimelineSkeleton;
|
|
8811
|
+
}
|
|
8812
|
+
});
|
|
8760
8813
|
Object.defineProperty(exports, "ResourceList", {
|
|
8761
8814
|
enumerable: true,
|
|
8762
8815
|
get: function() {
|
|
@@ -8865,18 +8918,6 @@ Object.defineProperty(exports, "isBuiltinRecordView", {
|
|
|
8865
8918
|
return isBuiltinRecordView;
|
|
8866
8919
|
}
|
|
8867
8920
|
});
|
|
8868
|
-
Object.defineProperty(exports, "isShowAvailable", {
|
|
8869
|
-
enumerable: true,
|
|
8870
|
-
get: function() {
|
|
8871
|
-
return isShowAvailable;
|
|
8872
|
-
}
|
|
8873
|
-
});
|
|
8874
|
-
Object.defineProperty(exports, "listTarget", {
|
|
8875
|
-
enumerable: true,
|
|
8876
|
-
get: function() {
|
|
8877
|
-
return listTarget;
|
|
8878
|
-
}
|
|
8879
|
-
});
|
|
8880
8921
|
Object.defineProperty(exports, "peekFieldDefinition", {
|
|
8881
8922
|
enumerable: true,
|
|
8882
8923
|
get: function() {
|
|
@@ -8901,18 +8942,6 @@ Object.defineProperty(exports, "peekRow", {
|
|
|
8901
8942
|
return peekRow;
|
|
8902
8943
|
}
|
|
8903
8944
|
});
|
|
8904
|
-
Object.defineProperty(exports, "recordReturnTarget", {
|
|
8905
|
-
enumerable: true,
|
|
8906
|
-
get: function() {
|
|
8907
|
-
return recordReturnTarget;
|
|
8908
|
-
}
|
|
8909
|
-
});
|
|
8910
|
-
Object.defineProperty(exports, "recordRouteAvailable", {
|
|
8911
|
-
enumerable: true,
|
|
8912
|
-
get: function() {
|
|
8913
|
-
return recordRouteAvailable;
|
|
8914
|
-
}
|
|
8915
|
-
});
|
|
8916
8945
|
Object.defineProperty(exports, "resolveFrameView", {
|
|
8917
8946
|
enumerable: true,
|
|
8918
8947
|
get: function() {
|
|
@@ -8949,12 +8978,6 @@ Object.defineProperty(exports, "shadcnFrameViews", {
|
|
|
8949
8978
|
return shadcnFrameViews;
|
|
8950
8979
|
}
|
|
8951
8980
|
});
|
|
8952
|
-
Object.defineProperty(exports, "showTarget", {
|
|
8953
|
-
enumerable: true,
|
|
8954
|
-
get: function() {
|
|
8955
|
-
return showTarget;
|
|
8956
|
-
}
|
|
8957
|
-
});
|
|
8958
8981
|
Object.defineProperty(exports, "tanStackSortingToBuro", {
|
|
8959
8982
|
enumerable: true,
|
|
8960
8983
|
get: function() {
|
|
@@ -8973,6 +8996,12 @@ Object.defineProperty(exports, "typography", {
|
|
|
8973
8996
|
return typography;
|
|
8974
8997
|
}
|
|
8975
8998
|
});
|
|
8999
|
+
Object.defineProperty(exports, "unknownEnumValueLabel", {
|
|
9000
|
+
enumerable: true,
|
|
9001
|
+
get: function() {
|
|
9002
|
+
return unknownEnumValueLabel;
|
|
9003
|
+
}
|
|
9004
|
+
});
|
|
8976
9005
|
Object.defineProperty(exports, "useBuroDataTable", {
|
|
8977
9006
|
enumerable: true,
|
|
8978
9007
|
get: function() {
|
|
@@ -9058,4 +9087,4 @@ Object.defineProperty(exports, "viewOf", {
|
|
|
9058
9087
|
}
|
|
9059
9088
|
});
|
|
9060
9089
|
|
|
9061
|
-
//# sourceMappingURL=place-node-
|
|
9090
|
+
//# sourceMappingURL=place-node-Bhl8B3fF.cjs.map
|