@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,22 +1,22 @@
|
|
|
1
1
|
import { l as cn } from "./use-theme-dnE3Od3I.js";
|
|
2
2
|
import { i as isNetworkFailure, l as useLinkComponent, m as PopoverTrigger, n as toast, o as technicalTexts, p as PopoverContent, r as friendlyStringsFrom, s as toFriendlyError, u as Popover } from "./toaster-Ct_YHGs6.js";
|
|
3
|
-
import { B as DropdownMenuContent, C as loadBulkSummary, E as loadInlineFlowHost, F as Icon, H as DropdownMenuItem, O as preloadFlowRuntime, Q as DropdownMenuTrigger, R as DropdownMenu, S as RuntimeFlowRunner, U as DropdownMenuLabel, V as DropdownMenuGroup, _ as reasonText, b as RuntimeAppFlowRunner, c as useListSlot, d as useToBrowserHref, dt as DocInfo, f as FlowActionButton, g as ActionInner, k as useLoaded, m as useFlowChrome, n as ActionButton, o as canonicalResourceName, p as FlowMenuItem, q as DropdownMenuSeparator, r as DisabledAction, t as CheckConfirmDialog, v as FlowBoundary, w as loadFailedText, x as RuntimeBulkFlowRunner } from "./check-confirm-dialog-
|
|
3
|
+
import { B as DropdownMenuContent, C as loadBulkSummary, E as loadInlineFlowHost, F as Icon, H as DropdownMenuItem, O as preloadFlowRuntime, Q as DropdownMenuTrigger, R as DropdownMenu, S as RuntimeFlowRunner, U as DropdownMenuLabel, V as DropdownMenuGroup, _ as reasonText, b as RuntimeAppFlowRunner, c as useListSlot, d as useToBrowserHref, dt as DocInfo, f as FlowActionButton, g as ActionInner, k as useLoaded, m as useFlowChrome, n as ActionButton, o as canonicalResourceName, p as FlowMenuItem, q as DropdownMenuSeparator, r as DisabledAction, t as CheckConfirmDialog, v as FlowBoundary, w as loadFailedText, x as RuntimeBulkFlowRunner } from "./check-confirm-dialog-CtiRzOAt.js";
|
|
4
4
|
import { t as Button } from "./button-MWVeZaqj.js";
|
|
5
5
|
import { t as Input } from "./input-CUPStzZO.js";
|
|
6
6
|
import { a as DialogFooter, i as DialogDescription, o as DialogHeader, r as DialogContent, s as DialogTitle, t as Dialog } from "./dialog-C123sVQ8.js";
|
|
7
7
|
import { g as ClaimedQuickLink, l as relationLinkClassName, y as LoadError } from "./relation-create-C43cdPQt.js";
|
|
8
8
|
import { t as Skeleton } from "./skeleton-U2noefj5.js";
|
|
9
|
-
import { A as
|
|
9
|
+
import { A as TableHeader, C as SelectTrigger, E as TableBody, F as ResolvedFieldDisplay, I as ResolvedFieldInput, L as useFieldMetaDiagnostic, M as Badge, O as TableCell, P as MetaPlaceholder, R as fieldDescription, T as Table$1, g as SelectContent, h as Select, j as TableRow, k as TableHead, t as FilterBuilder, v as SelectItem, w as SelectValue, z as lowerLegacyField } from "./filter-builder-z3Axzf9Y.js";
|
|
10
10
|
import { t as Label } from "./label-66W1qbke.js";
|
|
11
|
-
import { n as useCandidateSelection, t as LazyRelationPickerDialog } from "./lazy-relation-picker-dialog-
|
|
11
|
+
import { n as useCandidateSelection, t as LazyRelationPickerDialog } from "./lazy-relation-picker-dialog-DN4bvQfg.js";
|
|
12
12
|
import { t as useRelationSelect } from "./relation-select-B8Fq4o-t.js";
|
|
13
|
-
import { BULK_EACH_LIMIT, FORM_SLOT, LAYOUT_SIZES, builtinFrames, canonicalEntityNodeKey, columnName, compileFlow, compiledScreenFor, declaredField, declaredText, displayClassOf, dtoFields, enumFallbackKey, enumFallbackText, enumNamespaceOf, enumValueText, exportFormatFieldKey, exportFormatLabelKey, exportFormatOptionKey, facts, fieldOptionText, fieldSensitivity, flowRecordOf, formatEntityRef, grantedPlacementKeys, hasRecordPage, humanizeKey, i18nPrefixToRef, i18nPrefixToRef as i18nPrefixToRef$1, inlineFlow, isBuiltinItemAction, isColumnSortable, isRelationField, isScreenFailure, linkOf, normalizeDataError, normalizeEntityRef, planItemActions, projectDto, recordEntries, relatedList, relatedRecord, resolveActionDensity, resolveActionSurfaceMode, resolveColumnUi, resolveContentSlot, resolveEnumLabel, resolveFieldLabel, resolveFieldOptionLabel, resolveFieldSlot, resolveNavLabel, resolveResourceLabel,
|
|
14
|
-
import { ActionRouteContext, DismissGuardScope, FlowRowBatchContext, LOCAL_USER_SCOPE_ID, QUICK_ANCHOR_ATTRIBUTE, RECORD_KIND_KEYS, RecordScopeChain, ResourceListProvider, RouteSourceContext, ScreenStateProvider, columnTypeWidth, implementFrame, kindErrorText, linkCapabilitiesOf, policyRecordOf, policyRowsOf, recordKeyOf, resolveColumnField, resolveErrorText,
|
|
13
|
+
import { BULK_EACH_LIMIT, FORM_SLOT, LAYOUT_SIZES, builtinFrames, canonicalEntityNodeKey, columnName, compileFlow, compiledScreenFor, declaredField, declaredText, displayClassOf, dtoFields, enumFallbackKey, enumFallbackText, enumNamespaceOf, enumValueText, exportFormatFieldKey, exportFormatLabelKey, exportFormatOptionKey, facts, fieldOptionText, fieldSensitivity, flowRecordOf, formatEntityRef, grantedPlacementKeys, hasRecordPage, humanizeKey, i18nPrefixToRef, i18nPrefixToRef as i18nPrefixToRef$1, inlineFlow, isBuiltinItemAction, isColumnSortable, isRelationField, isScreenFailure, linkOf, normalizeDataError, normalizeEntityRef, planItemActions, projectDto, recordEntries, relatedList, relatedRecord, resolveActionDensity, resolveActionSurfaceMode, resolveColumnUi, resolveContentSlot, resolveEnumLabel, resolveFieldLabel, resolveFieldOptionLabel, resolveFieldSlot, resolveNavLabel, resolveResourceLabel, resolveSurfaceUi, resolveTextSlot, resourceKey, resourceShowHref, reverseLinkOf, routeResourceKey, routeServerIssues, savedViewKey, validatePlacementProps, whereEntryToFilter } from "@burojs/core";
|
|
14
|
+
import { ActionRouteContext, DismissGuardScope, FlowRowBatchContext, LOCAL_USER_SCOPE_ID, QUICK_ANCHOR_ATTRIBUTE, RECORD_KIND_KEYS, RecordScopeChain, ResourceListProvider, RouteSourceContext, ScreenStateProvider, columnTypeWidth, deriveRecord, implementFrame, isObjectColumn, kindErrorText, linkCapabilitiesOf, policyRecordOf, policyRowsOf, readColumnValue, recordKeyOf, resolveColumnField, resolveErrorText, resolveObjectColumn, resolveValidationMessage, resourceFlowsOn, specificErrorText, tableLayoutSetting, useApp, useApplicationSnapshot, useAvailability, useAvailabilityResolver, useCapability, useCapabilityResolver, useChromeT, useClipboard, useComponent, useCtx, useCurrentUserId, useCustomQuery, useDataRuntime, useDismissGuard, useEntryGate, useEnumValues, useExportRuns, useFieldAccess, useFieldImplementation, useFieldMeta, useFieldMetaSources, useFlowRowBatch, useFlowRowResolver, useFormController, useFrameImplementations, useFramePiece, useFrameT, useI18nCaps, useItemActions, useLinkRights, useLinkWriter, useLinkedKeys, useListAccess, useLocale, useNavigationBlocker, useOne, useOptionalDataRuntime, useOptionalRecordFrame, useOptionalRouterAdapter, useOptionalT, useOptionalUiSettings, usePageFlowGate, usePageScreen, usePathAccess, usePlacement, useProjectedRecord, useProjectedTitle, usePublishDocVariant, useQuick, useQuickEntry, useQuickOpener, useRecordFrame, useRecordScopeFrames, useRecordTitle, useResource, useResourceExport, useResourceList, useResourceListContext, useReturnTarget, useRouteNavigate, useScreenState, useSearchParamsWriter, useT, useTestIds, useViewRow, withRecordKeys } from "@burojs/react";
|
|
15
15
|
import { IconAlertCircle, IconAlertTriangle, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowUp, IconBookmark, IconCheck, IconChevronLeft, IconChevronRight, IconChevronsLeft, IconChevronsRight, IconColumns3, IconCopy, IconDots, IconDownload, IconEyeOff, IconFilterX, IconInbox, IconLink, IconLoader2, IconLock, IconMinus, IconPencil, IconPinned, IconPinnedOff, IconPlus, IconRefresh, IconSelector, IconSettings2, IconTrash, IconUnlink, IconX } from "@tabler/icons-react";
|
|
16
16
|
import * as React from "react";
|
|
17
17
|
import { Component, Fragment, Suspense, createContext, createElement, lazy, memo, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
18
18
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { actionWhenHolds, enumBindingKey, hasNullRef, isFlowAction, whereToFilter } from "@burojs/core/internal";
|
|
19
|
+
import { actionWhenHolds, deepestPlacedPath, enumBindingKey, hasNullRef, isFlowAction, pathHead, whereToFilter } from "@burojs/core/internal";
|
|
20
20
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
21
21
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
22
22
|
import { flexRender, getCoreRowModel, getFacetedRowModel, getFacetedUniqueValues, useReactTable } from "@tanstack/react-table";
|
|
@@ -143,10 +143,10 @@ function copyText(value) {
|
|
|
143
143
|
function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
144
144
|
const t = useOptionalT();
|
|
145
145
|
const clipboard = useClipboard();
|
|
146
|
-
const [copied, setCopied] = useState(
|
|
146
|
+
const [copied, setCopied] = useState(null);
|
|
147
147
|
useEffect(() => {
|
|
148
|
-
if (
|
|
149
|
-
const timer = setTimeout(() => setCopied(
|
|
148
|
+
if (copied === null) return;
|
|
149
|
+
const timer = setTimeout(() => setCopied(null), COPIED_MS);
|
|
150
150
|
return () => clearTimeout(timer);
|
|
151
151
|
}, [copied]);
|
|
152
152
|
const ui = isRecord$1(field.ui) ? field.ui : void 0;
|
|
@@ -177,7 +177,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
177
177
|
const copy = (event) => {
|
|
178
178
|
event.preventDefault();
|
|
179
179
|
event.stopPropagation();
|
|
180
|
-
clipboard(copyText(value)).then(() => setCopied(
|
|
180
|
+
clipboard(copyText(value)).then(() => setCopied("copied"), () => setCopied("failed"));
|
|
181
181
|
};
|
|
182
182
|
return jsxs("span", {
|
|
183
183
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 align-bottom",
|
|
@@ -190,7 +190,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
190
190
|
title: label,
|
|
191
191
|
onClick: copy,
|
|
192
192
|
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",
|
|
193
|
-
children: copied ? jsx(IconCheck, {
|
|
193
|
+
children: copied === "copied" ? jsx(IconCheck, {
|
|
194
194
|
"aria-hidden": "true",
|
|
195
195
|
className: "size-3.5"
|
|
196
196
|
}) : jsx(IconCopy, {
|
|
@@ -201,7 +201,7 @@ function FieldValueFrame({ field, value, surface, entry, children }) {
|
|
|
201
201
|
jsx("span", {
|
|
202
202
|
"aria-live": "polite",
|
|
203
203
|
className: "sr-only",
|
|
204
|
-
children: copied ? t("field.copied", { defaultValue: "Copied" }) : ""
|
|
204
|
+
children: copied === "copied" ? t("field.copied", { defaultValue: "Copied" }) : copied === "failed" ? t("field.copyFailed", { defaultValue: "Could not copy" }) : ""
|
|
205
205
|
})
|
|
206
206
|
]
|
|
207
207
|
});
|
|
@@ -281,6 +281,10 @@ function leafAttributes(size, weight) {
|
|
|
281
281
|
...weight === void 0 ? {} : { "data-buro-weight": String(weight) }
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
|
+
function labelHiddenOf(compiled, node) {
|
|
285
|
+
return compiled.nodes[node.index]?.options.label === "hidden";
|
|
286
|
+
}
|
|
287
|
+
const labelRegion = (hidden, visible) => hidden ? "sr-only" : visible;
|
|
284
288
|
function FieldLeaf({ node }) {
|
|
285
289
|
const { leafIds } = useScreenTree();
|
|
286
290
|
if (node.state === "failed" && node.failedOn.length > 0 && node.failedOn.every((name) => name.startsWith("meta:"))) return jsx(MisconfiguredLeaf, { node });
|
|
@@ -292,7 +296,8 @@ function FieldLeaf({ node }) {
|
|
|
292
296
|
return jsx(RecordLeaf, { node });
|
|
293
297
|
}
|
|
294
298
|
function MisconfiguredLeaf({ node }) {
|
|
295
|
-
const { leafIds, resource, mode, controller } = useScreenTree();
|
|
299
|
+
const { leafIds, resource, mode, compiled, controller } = useScreenTree();
|
|
300
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
296
301
|
const name = node.field;
|
|
297
302
|
const binding = controller.field(name);
|
|
298
303
|
const caps = useI18nCaps(resource);
|
|
@@ -319,7 +324,7 @@ function MisconfiguredLeaf({ node }) {
|
|
|
319
324
|
"data-buro-field-meta": "failed",
|
|
320
325
|
children: [jsx("div", {
|
|
321
326
|
"data-buro-region": "field-label",
|
|
322
|
-
className: "text-sm font-medium leading-none",
|
|
327
|
+
className: labelRegion(hidden, "text-sm font-medium leading-none"),
|
|
323
328
|
children: label
|
|
324
329
|
}), jsx("div", {
|
|
325
330
|
"data-buro-region": "field-control",
|
|
@@ -327,12 +332,22 @@ function MisconfiguredLeaf({ node }) {
|
|
|
327
332
|
})]
|
|
328
333
|
});
|
|
329
334
|
}
|
|
335
|
+
function valueAt(record, path) {
|
|
336
|
+
let at = record;
|
|
337
|
+
for (const segment of path.split(".")) {
|
|
338
|
+
if (at === null || typeof at !== "object") return void 0;
|
|
339
|
+
at = at[segment];
|
|
340
|
+
}
|
|
341
|
+
return at;
|
|
342
|
+
}
|
|
330
343
|
function RecordLeaf({ node }) {
|
|
331
344
|
const { resource, mode, compiled, controller } = useScreenTree();
|
|
332
|
-
const
|
|
345
|
+
const head = node.field;
|
|
346
|
+
const name = node.fieldPath ?? head;
|
|
333
347
|
const binding = controller.field(name);
|
|
334
348
|
const size = useLeafSize(binding.field);
|
|
335
349
|
const weight = compiled.nodes[node.index]?.options.weight;
|
|
350
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
336
351
|
const caps = useI18nCaps(resource);
|
|
337
352
|
const tid = useTestIds();
|
|
338
353
|
const label = resolveFieldLabel(caps, name, declaredText("field", binding.field, "label"));
|
|
@@ -349,7 +364,7 @@ function RecordLeaf({ node }) {
|
|
|
349
364
|
"data-buro-restricted": "true",
|
|
350
365
|
children: [jsx("div", {
|
|
351
366
|
"data-buro-region": "field-label",
|
|
352
|
-
className: "text-sm font-medium leading-none",
|
|
367
|
+
className: labelRegion(hidden, "text-sm font-medium leading-none"),
|
|
353
368
|
children: label
|
|
354
369
|
}), jsx("div", {
|
|
355
370
|
"data-buro-region": "field-control",
|
|
@@ -369,7 +384,7 @@ function RecordLeaf({ node }) {
|
|
|
369
384
|
});
|
|
370
385
|
}
|
|
371
386
|
const record = controller.record;
|
|
372
|
-
const value = mode === "show" ? record
|
|
387
|
+
const value = mode === "show" ? valueAt(record, name) ?? binding.value : mode === "edit" && controller.plan?.fields[head] !== "active" ? valueAt(record, name) ?? binding.value : binding.value;
|
|
373
388
|
const display = jsx(FieldDisplay, {
|
|
374
389
|
resource: binding.resource,
|
|
375
390
|
name,
|
|
@@ -377,6 +392,8 @@ function RecordLeaf({ node }) {
|
|
|
377
392
|
value,
|
|
378
393
|
metaSources: controller.sources,
|
|
379
394
|
...record === void 0 ? {} : { record },
|
|
395
|
+
...binding.absentPaths === void 0 ? {} : { absentPaths: binding.absentPaths },
|
|
396
|
+
...binding.pathStatus === void 0 ? {} : { pathStatus: binding.pathStatus },
|
|
380
397
|
fallback: value == null || value === "" ? jsx("span", {
|
|
381
398
|
className: "text-muted-foreground",
|
|
382
399
|
children: "—"
|
|
@@ -387,11 +404,11 @@ function RecordLeaf({ node }) {
|
|
|
387
404
|
"data-testid": `show-field:${resource}:${name}`,
|
|
388
405
|
children: [jsxs("dt", {
|
|
389
406
|
"data-buro-region": "field-label",
|
|
390
|
-
className: cn("flex items-center gap-0.5", FIELD_LABEL_SHOW),
|
|
407
|
+
className: labelRegion(hidden, cn("flex items-center gap-0.5", FIELD_LABEL_SHOW)),
|
|
391
408
|
children: [jsx("span", {
|
|
392
409
|
className: "min-w-0",
|
|
393
410
|
children: label
|
|
394
|
-
}), jsx(DocInfo, {
|
|
411
|
+
}), hidden ? null : jsx(DocInfo, {
|
|
395
412
|
address: `${resource}/fields/${name}`,
|
|
396
413
|
name: label
|
|
397
414
|
})]
|
|
@@ -411,8 +428,8 @@ function RecordLeaf({ node }) {
|
|
|
411
428
|
"data-testid": tid.formField(resource, mode, name),
|
|
412
429
|
children: [jsxs("div", {
|
|
413
430
|
"data-buro-region": "field-label",
|
|
414
|
-
className: "flex items-center gap-2",
|
|
415
|
-
children: [jsx(Label, { children: label }), jsx(DocInfo, {
|
|
431
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
432
|
+
children: [jsx(Label, { children: label }), hidden ? null : jsx(DocInfo, {
|
|
416
433
|
address: `${resource}/fields/${name}`,
|
|
417
434
|
name: label,
|
|
418
435
|
testId: `${tid.formField(resource, mode, name)}:info`
|
|
@@ -448,11 +465,12 @@ function RecordLeaf({ node }) {
|
|
|
448
465
|
node,
|
|
449
466
|
binding,
|
|
450
467
|
label,
|
|
468
|
+
labelHidden: hidden,
|
|
451
469
|
attributes,
|
|
452
470
|
inputId
|
|
453
471
|
});
|
|
454
472
|
}
|
|
455
|
-
function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
473
|
+
function ActiveLeaf({ node, binding, label, labelHidden, attributes, inputId }) {
|
|
456
474
|
const { resource, mode, controller, disabled: locked } = useScreenTree();
|
|
457
475
|
const caps = useI18nCaps(resource);
|
|
458
476
|
const tid = useTestIds();
|
|
@@ -496,13 +514,13 @@ function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
|
496
514
|
onBlur: binding.onBlur,
|
|
497
515
|
children: [jsxs("div", {
|
|
498
516
|
"data-buro-region": "field-label",
|
|
499
|
-
className: "flex items-center gap-2",
|
|
517
|
+
className: labelRegion(labelHidden, "flex items-center gap-2"),
|
|
500
518
|
children: [jsx(Label, {
|
|
501
519
|
id: `${inputId}-label`,
|
|
502
520
|
htmlFor: inputId,
|
|
503
521
|
required: binding.required,
|
|
504
522
|
children: label
|
|
505
|
-
}), jsx(DocInfo, {
|
|
523
|
+
}), labelHidden ? null : jsx(DocInfo, {
|
|
506
524
|
address: `${resource}/fields/${name}`,
|
|
507
525
|
name: label,
|
|
508
526
|
testId: `${tid.formField(resource, mode, name)}:info`
|
|
@@ -525,13 +543,17 @@ function ActiveLeaf({ node, binding, label, attributes, inputId }) {
|
|
|
525
543
|
...mode === "create" || record === void 0 ? {} : { record },
|
|
526
544
|
form: controller.values,
|
|
527
545
|
metaSources: controller.sources,
|
|
546
|
+
...controller.baseline === void 0 ? {} : { baseline: controller.baseline },
|
|
528
547
|
...describedBy === void 0 ? {} : { descriptionId: describedBy },
|
|
529
548
|
...errorMessageId === void 0 ? {} : { errorId: errorMessageId },
|
|
530
549
|
errorMessage: errorText,
|
|
531
550
|
issues: binding.issues,
|
|
532
551
|
...binding.fixedFilters === void 0 ? {} : { fixedFilters: binding.fixedFilters },
|
|
552
|
+
...binding.optionSubtitle === void 0 ? {} : { optionSubtitle: binding.optionSubtitle },
|
|
533
553
|
...binding.relationSeeds === void 0 ? {} : { relationSeeds: binding.relationSeeds },
|
|
534
554
|
...binding.link === void 0 ? {} : { link: binding.link },
|
|
555
|
+
...binding.absentPaths === void 0 ? {} : { absentPaths: binding.absentPaths },
|
|
556
|
+
...binding.pathStatus === void 0 ? {} : { pathStatus: binding.pathStatus },
|
|
535
557
|
fallback: jsx(Input, {
|
|
536
558
|
id: inputId,
|
|
537
559
|
name: inputId,
|
|
@@ -578,6 +600,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
578
600
|
const binding = controller.field(name);
|
|
579
601
|
const size = useLeafSize(binding.field);
|
|
580
602
|
const weight = compiled.nodes[node.index]?.options.weight;
|
|
603
|
+
const hidden = labelHiddenOf(compiled, node);
|
|
581
604
|
const attributes = leafAttributes(size, weight);
|
|
582
605
|
const docRef = i18nPrefixToRef(prefix);
|
|
583
606
|
const docScope = docRef.namespace === "default" ? docRef.id : formatEntityRef(docRef);
|
|
@@ -596,7 +619,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
596
619
|
});
|
|
597
620
|
const label = resolveFieldLabel(caps, name, declaredText("field", binding.field, "label"));
|
|
598
621
|
const hint = resolveFieldSlot(caps, name, "description", fieldDescription(binding.field));
|
|
599
|
-
const info = jsx(DocInfo, {
|
|
622
|
+
const info = hidden ? null : jsx(DocInfo, {
|
|
600
623
|
address: `${docScope}/fields/${name}`,
|
|
601
624
|
name: label,
|
|
602
625
|
testId: `${prefix}:field:${name}:info`
|
|
@@ -613,7 +636,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
613
636
|
children: [
|
|
614
637
|
jsxs("div", {
|
|
615
638
|
"data-buro-region": "field-label",
|
|
616
|
-
className: "flex items-center gap-2",
|
|
639
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
617
640
|
children: [jsx("span", {
|
|
618
641
|
className: FIELD_LABEL_SHOW,
|
|
619
642
|
children: label
|
|
@@ -646,6 +669,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
646
669
|
...binding,
|
|
647
670
|
field: binding.field,
|
|
648
671
|
metaSources: controller.sources,
|
|
672
|
+
...controller.baseline === void 0 ? {} : { baseline: controller.baseline },
|
|
649
673
|
inputId,
|
|
650
674
|
labelId: `${inputId}-label`,
|
|
651
675
|
i18nPrefix: prefix,
|
|
@@ -661,7 +685,7 @@ function DeclarativeLeaf({ node, prefix, inputIds }) {
|
|
|
661
685
|
children: [
|
|
662
686
|
jsxs("div", {
|
|
663
687
|
"data-buro-region": "field-label",
|
|
664
|
-
className: "flex items-center gap-2",
|
|
688
|
+
className: labelRegion(hidden, "flex items-center gap-2"),
|
|
665
689
|
children: [jsx(Label, {
|
|
666
690
|
id: `${inputId}-label`,
|
|
667
691
|
htmlFor: inputId,
|
|
@@ -923,10 +947,7 @@ function RecordInlineFlow({ name }) {
|
|
|
923
947
|
const id = frame?.recordId;
|
|
924
948
|
const asRead = frame === null ? void 0 : policyRecordOf(frame.controller, frame.record);
|
|
925
949
|
const key = placement?.key ?? flowName;
|
|
926
|
-
const state = frame === null || id === void 0 || asRead === void 0 ? null : resolve(flowName, {
|
|
927
|
-
...asRead,
|
|
928
|
-
id
|
|
929
|
-
});
|
|
950
|
+
const state = frame === null || id === void 0 || asRead === void 0 ? null : resolve(flowName, withRecordKeys(asRead, { id }));
|
|
930
951
|
const kept = holder?.get(key);
|
|
931
952
|
const stale = state?.state === "absent" && state.cause === "when" && kept !== void 0 && kept.dirty;
|
|
932
953
|
const gone = state?.state === "absent" && !stale;
|
|
@@ -938,10 +959,7 @@ function RecordInlineFlow({ name }) {
|
|
|
938
959
|
key
|
|
939
960
|
]);
|
|
940
961
|
if (frame === null || asRead === void 0 || id === void 0 || compiled === null) return null;
|
|
941
|
-
const row = {
|
|
942
|
-
...asRead,
|
|
943
|
-
id
|
|
944
|
-
};
|
|
962
|
+
const row = withRecordKeys(asRead, { id });
|
|
945
963
|
const control = resolve(flowName, row);
|
|
946
964
|
switch (control.state) {
|
|
947
965
|
case "undecided":
|
|
@@ -1212,6 +1230,28 @@ function placementSeeds(where, resolved, closure) {
|
|
|
1212
1230
|
return Object.freeze(seeds);
|
|
1213
1231
|
}
|
|
1214
1232
|
//#endregion
|
|
1233
|
+
//#region src/enum/enum-settling.tsx
|
|
1234
|
+
function unknownEnumValueLabel(caps, def, ns, value) {
|
|
1235
|
+
const declared = enumFallbackText(def);
|
|
1236
|
+
if (def.fallback === void 0 && declared === void 0) return {
|
|
1237
|
+
label: value,
|
|
1238
|
+
fallback: false
|
|
1239
|
+
};
|
|
1240
|
+
return {
|
|
1241
|
+
label: resolveContentSlot(caps, [enumFallbackKey(ns)], { default: declared }) ?? value,
|
|
1242
|
+
fallback: true
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
function EnumSettlingRow({ status, testid }) {
|
|
1246
|
+
const t = useOptionalT();
|
|
1247
|
+
return jsx("div", {
|
|
1248
|
+
role: "status",
|
|
1249
|
+
"data-testid": testid === void 0 ? void 0 : `${testid}:${status}`,
|
|
1250
|
+
className: "px-2 py-1.5 text-sm text-muted-foreground",
|
|
1251
|
+
children: status === "pending" ? t("field.loading", { defaultValue: "Loading…" }) : t("relation.failed", { defaultValue: "Failed to load options." })
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
//#endregion
|
|
1215
1255
|
//#region src/enum/enum-badge.tsx
|
|
1216
1256
|
function BadgeBody({ icon, label }) {
|
|
1217
1257
|
return jsxs("span", {
|
|
@@ -1282,9 +1322,9 @@ function EnumBadge({ enumName: enumInput, value, testid, className, presentation
|
|
|
1282
1322
|
children: body
|
|
1283
1323
|
});
|
|
1284
1324
|
}
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1287
|
-
const fallbackLabel =
|
|
1325
|
+
const unknown = unknownEnumValueLabel(caps, def, ns, value);
|
|
1326
|
+
if (unknown.fallback) {
|
|
1327
|
+
const fallbackLabel = unknown.label;
|
|
1288
1328
|
if (presentation === "plain") return jsx("span", {
|
|
1289
1329
|
"data-testid": `${id}:fallback`,
|
|
1290
1330
|
className,
|
|
@@ -1512,35 +1552,6 @@ function useShownItemActions(resource, record, surface, hideFlows, sources) {
|
|
|
1512
1552
|
return hideFlows === void 0 ? shown : shown.filter((a) => a.flow === void 0 || !hideFlows(a.name));
|
|
1513
1553
|
}
|
|
1514
1554
|
//#endregion
|
|
1515
|
-
//#region src/layout/record-targets.ts
|
|
1516
|
-
function recordRouteAvailable(registry, resource, action) {
|
|
1517
|
-
if (resolveStaticAvailability(registry, resource, action).state !== "available") return false;
|
|
1518
|
-
const def = registry.get(resource);
|
|
1519
|
-
return def !== void 0 && hasRecordPage(def, action);
|
|
1520
|
-
}
|
|
1521
|
-
function isShowAvailable(registry, resource) {
|
|
1522
|
-
return recordRouteAvailable(registry, resource, "show");
|
|
1523
|
-
}
|
|
1524
|
-
function showTarget(resource, id) {
|
|
1525
|
-
return {
|
|
1526
|
-
resource,
|
|
1527
|
-
action: "show",
|
|
1528
|
-
params: { id }
|
|
1529
|
-
};
|
|
1530
|
-
}
|
|
1531
|
-
function listTarget(resource) {
|
|
1532
|
-
return {
|
|
1533
|
-
resource,
|
|
1534
|
-
action: "list"
|
|
1535
|
-
};
|
|
1536
|
-
}
|
|
1537
|
-
function recordReturnTarget(registry, resource, id) {
|
|
1538
|
-
return isShowAvailable(registry, resource) ? showTarget(resource, id) : listTarget(resource);
|
|
1539
|
-
}
|
|
1540
|
-
function editBackHref(registry, resource, id, backHref) {
|
|
1541
|
-
return backHref ?? resolveRoute(recordReturnTarget(registry, resource, id), registry);
|
|
1542
|
-
}
|
|
1543
|
-
//#endregion
|
|
1544
1555
|
//#region src/lib/typography.ts
|
|
1545
1556
|
const typography = {
|
|
1546
1557
|
h1: "text-2xl font-semibold tracking-tight",
|
|
@@ -1668,16 +1679,16 @@ function ShowPageHeader({ resource: resourceInput, record, extraActions, breadcr
|
|
|
1668
1679
|
}
|
|
1669
1680
|
function EditPageHeader({ resource: resourceInput, record, backHref, breadcrumbs }) {
|
|
1670
1681
|
const resource = routeResourceKey(resourceInput);
|
|
1671
|
-
const
|
|
1672
|
-
const def = app.registry.get(resource);
|
|
1682
|
+
const def = useApp().registry.get(resource);
|
|
1673
1683
|
const caps = useI18nCaps(resource);
|
|
1674
1684
|
const recordKey = recordKeyOf(def, record);
|
|
1675
1685
|
const recordName = useProjectedTitle(resource, recordKey, record);
|
|
1686
|
+
const back = useReturnTarget(resource, "edit", String(recordKey ?? ""));
|
|
1676
1687
|
return jsx(PageHeader, {
|
|
1677
1688
|
resource,
|
|
1678
1689
|
mode: "edit",
|
|
1679
1690
|
recordName,
|
|
1680
|
-
backHref:
|
|
1691
|
+
backHref: backHref ?? back,
|
|
1681
1692
|
breadcrumbs,
|
|
1682
1693
|
backLabel: recordName ? `${resolveResourceLabel(caps, resource, "single", def)}: ${recordName}` : void 0,
|
|
1683
1694
|
actions: jsx(ActionOverflow, {
|
|
@@ -1966,19 +1977,26 @@ function BuroPanelFrame({ body, title, description, collapsible, open, onToggle,
|
|
|
1966
1977
|
"data-buro-region": "panel-title",
|
|
1967
1978
|
className: "flex items-center gap-1",
|
|
1968
1979
|
children: [
|
|
1969
|
-
collapsible ? jsx("
|
|
1980
|
+
collapsible && title !== void 0 ? jsx("h3", {
|
|
1981
|
+
id: titleId,
|
|
1982
|
+
className: "min-w-0 flex-1 text-sm font-semibold",
|
|
1983
|
+
children: jsxs("button", {
|
|
1984
|
+
type: "button",
|
|
1985
|
+
"aria-expanded": open,
|
|
1986
|
+
"aria-controls": bodyId,
|
|
1987
|
+
onClick: () => onToggle(!open),
|
|
1988
|
+
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",
|
|
1989
|
+
children: [jsx(Chevron, { open }), title]
|
|
1990
|
+
})
|
|
1991
|
+
}) : collapsible ? jsx("button", {
|
|
1970
1992
|
type: "button",
|
|
1971
1993
|
"aria-expanded": open,
|
|
1972
1994
|
"aria-controls": bodyId,
|
|
1973
1995
|
"aria-label": open ? t("screen.collapse", { defaultValue: "Collapse" }) : t("screen.expand", { defaultValue: "Expand" }),
|
|
1974
1996
|
onClick: () => onToggle(!open),
|
|
1975
1997
|
className: "inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:bg-muted",
|
|
1976
|
-
children: jsx(
|
|
1977
|
-
|
|
1978
|
-
"aria-hidden": "true"
|
|
1979
|
-
})
|
|
1980
|
-
}) : null,
|
|
1981
|
-
title === void 0 ? null : jsx("h3", {
|
|
1998
|
+
children: jsx(Chevron, { open })
|
|
1999
|
+
}) : title === void 0 ? null : jsx("h3", {
|
|
1982
2000
|
id: titleId,
|
|
1983
2001
|
className: "text-sm font-semibold",
|
|
1984
2002
|
children: title
|
|
@@ -1996,6 +2014,12 @@ function BuroPanelFrame({ body, title, description, collapsible, open, onToggle,
|
|
|
1996
2014
|
]
|
|
1997
2015
|
});
|
|
1998
2016
|
}
|
|
2017
|
+
function Chevron({ open }) {
|
|
2018
|
+
return jsx(IconChevronRight, {
|
|
2019
|
+
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",
|
|
2020
|
+
"aria-hidden": "true"
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
1999
2023
|
function BuroTabsFrame({ tabs, active, onSelect, info, nodeAttributes }) {
|
|
2000
2024
|
if (tabs.length === 1) return jsx("div", {
|
|
2001
2025
|
...nodeAttributes,
|
|
@@ -2613,7 +2637,8 @@ function ColumnHeaderMenu({ label, sortDirection, sortable, onSort, pinned, onPi
|
|
|
2613
2637
|
}
|
|
2614
2638
|
//#endregion
|
|
2615
2639
|
//#region src/resource/column-accessor.ts
|
|
2616
|
-
function columnAccessor(column) {
|
|
2640
|
+
function columnAccessor(column, objectPath = false) {
|
|
2641
|
+
if (objectPath) return { accessorFn: (row) => readColumnValue(row, column, true) };
|
|
2617
2642
|
return column.includes(".") ? { accessorFn: (row) => row[column] } : { accessorKey: column };
|
|
2618
2643
|
}
|
|
2619
2644
|
//#endregion
|
|
@@ -3222,7 +3247,8 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3222
3247
|
});
|
|
3223
3248
|
for (const col of visibleColumnKeys) {
|
|
3224
3249
|
const target = columnTarget(app.registry, resource, col);
|
|
3225
|
-
const
|
|
3250
|
+
const objectPath = isObjectColumn(app.registry, resource, col);
|
|
3251
|
+
const field = target !== void 0 ? target.field : objectPath ? resolveObjectColumn(app.registry, resource, col)?.field : def === void 0 ? void 0 : declaredField(def, col);
|
|
3226
3252
|
const declaredLabel = declaredText("field", field, "label");
|
|
3227
3253
|
const headerLabel = target === void 0 ? resolveFieldLabel(volatileRef.current.i18nCaps, col, declaredLabel) : resolveFieldLabel(capsOf(volatileRef.current.i18nCaps, target.resource), target.name, declaredLabel);
|
|
3228
3254
|
const ui = columnUiOf(col);
|
|
@@ -3230,12 +3256,15 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3230
3256
|
...field ?? { type: "unknown" },
|
|
3231
3257
|
name: target === void 0 ? col : target.name
|
|
3232
3258
|
};
|
|
3233
|
-
const cellEntry = { display:
|
|
3259
|
+
const cellEntry = { display: {
|
|
3260
|
+
...ui.display,
|
|
3261
|
+
...ui.display.dateDisplay
|
|
3262
|
+
} };
|
|
3234
3263
|
const wraps = ui.display.overflow === "wrap";
|
|
3235
3264
|
const columnSortable = volatileRef.current.sortable?.(col) ?? (def !== void 0 && isColumnSortable(def, col, app, app.registry));
|
|
3236
3265
|
cols.push({
|
|
3237
3266
|
id: col,
|
|
3238
|
-
...columnAccessor(col),
|
|
3267
|
+
...columnAccessor(col, objectPath),
|
|
3239
3268
|
size: ui.default,
|
|
3240
3269
|
minSize: ui.min,
|
|
3241
3270
|
maxSize: ui.max ?? Number.MAX_SAFE_INTEGER,
|
|
@@ -3294,7 +3323,7 @@ function ResourceList({ resource: resourceInput, data, total, page = 1, pageSize
|
|
|
3294
3323
|
cell: ({ row }) => {
|
|
3295
3324
|
const raw = row.original;
|
|
3296
3325
|
const record = volatileRef.current.viewRow(raw);
|
|
3297
|
-
const value = record
|
|
3326
|
+
const value = readColumnValue(record, col, objectPath);
|
|
3298
3327
|
const customCell = volatileRef.current.renderCell?.(col, value, record);
|
|
3299
3328
|
const cellInner = customCell !== void 0 ? customCell : jsx(ResolvedFieldDisplay, {
|
|
3300
3329
|
resource: target === void 0 ? resourceRef : target.ref,
|
|
@@ -4941,6 +4970,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
4941
4970
|
const each = compiled?.each ?? false;
|
|
4942
4971
|
const [running, setRunning] = useState(false);
|
|
4943
4972
|
const [summary, setSummary] = useState(null);
|
|
4973
|
+
const afterSummary = useRef(null);
|
|
4944
4974
|
const testid = tid.bulkAction(resource, actionName);
|
|
4945
4975
|
if (control.state === "absent") return null;
|
|
4946
4976
|
const variant = chrome.destructive ? "destructive" : "outline";
|
|
@@ -4963,11 +4993,20 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
4963
4993
|
const finish = (result, progress) => {
|
|
4964
4994
|
setRunning(false);
|
|
4965
4995
|
if (progress === void 0) return;
|
|
4966
|
-
|
|
4996
|
+
const summarize = result.outcome !== "success" || progress.rereadSkipped.some((entry) => entry.policy === "warn");
|
|
4997
|
+
if (summarize) setSummary({
|
|
4967
4998
|
progress,
|
|
4968
4999
|
total: ids.length
|
|
4969
5000
|
});
|
|
4970
|
-
|
|
5001
|
+
const remaining = ids.filter((id) => !progress.success.includes(id));
|
|
5002
|
+
if (summarize && remaining.length === 0) afterSummary.current = () => onSelectionChange?.([]);
|
|
5003
|
+
else onSelectionChange?.(remaining);
|
|
5004
|
+
};
|
|
5005
|
+
const closeSummary = () => {
|
|
5006
|
+
setSummary(null);
|
|
5007
|
+
const pending = afterSummary.current;
|
|
5008
|
+
afterSummary.current = null;
|
|
5009
|
+
pending?.();
|
|
4971
5010
|
};
|
|
4972
5011
|
return jsxs(Fragment$1, { children: [
|
|
4973
5012
|
jsx(Button, {
|
|
@@ -4997,7 +5036,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
4997
5036
|
jsx(Dialog, {
|
|
4998
5037
|
open: summary !== null,
|
|
4999
5038
|
onOpenChange: (open) => {
|
|
5000
|
-
if (!open)
|
|
5039
|
+
if (!open) closeSummary();
|
|
5001
5040
|
},
|
|
5002
5041
|
children: jsxs(DialogContent, {
|
|
5003
5042
|
"data-testid": `${tid.bulkSummary(resource, actionName)}:dialog`,
|
|
@@ -5018,7 +5057,7 @@ function BulkFlowButton({ resource, actionName, ids, onSelectionChange }) {
|
|
|
5018
5057
|
type: "button",
|
|
5019
5058
|
variant: "outline",
|
|
5020
5059
|
"data-testid": `${tid.bulkSummary(resource, actionName)}:close`,
|
|
5021
|
-
onClick:
|
|
5060
|
+
onClick: closeSummary,
|
|
5022
5061
|
children: t("flow.close", { defaultValue: "Close" })
|
|
5023
5062
|
}) })
|
|
5024
5063
|
]
|
|
@@ -6084,10 +6123,7 @@ function RecordActionsView() {
|
|
|
6084
6123
|
const id = useFrameId();
|
|
6085
6124
|
const holder = useScreenState()?.inline;
|
|
6086
6125
|
if (mode === "create" || record === void 0 || id === void 0) return null;
|
|
6087
|
-
const row = {
|
|
6088
|
-
...policyRecordOf(controller, record),
|
|
6089
|
-
id
|
|
6090
|
-
};
|
|
6126
|
+
const row = withRecordKeys(policyRecordOf(controller) ?? record, { id });
|
|
6091
6127
|
holder?.declare(inlineFlowNames(controller.screen, controller.plan));
|
|
6092
6128
|
return jsxs("div", {
|
|
6093
6129
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -6130,26 +6166,33 @@ function FormActionsView() {
|
|
|
6130
6166
|
const labelCaps = useI18nCaps(resource);
|
|
6131
6167
|
const tid = useTestIds();
|
|
6132
6168
|
const id = useFrameId();
|
|
6169
|
+
const back = useReturnTarget(resource, mode === "create" ? "create" : "edit", mode === "edit" ? id : void 0);
|
|
6133
6170
|
const failedIssues = chrome.serverIssues;
|
|
6134
6171
|
const livePlan = controller.plan;
|
|
6135
|
-
const
|
|
6172
|
+
const placed = useMemo(() => new Set(livePlan?.placedPaths ?? []), [livePlan]);
|
|
6173
|
+
const alertIssues = useMemo(() => failedIssues === void 0 || failedIssues.length === 0 ? NO_ALERT_ISSUES : routeServerIssues({ issues: failedIssues }, (segment) => segment, (field, path) => field !== "_form" && (livePlan === null || livePlan.fields[field] === "active" && deepestPlacedPath(path, placed) !== void 0)).form, [
|
|
6174
|
+
failedIssues,
|
|
6175
|
+
livePlan,
|
|
6176
|
+
placed
|
|
6177
|
+
]);
|
|
6136
6178
|
const fieldDefs = app.registry.get(resource)?.fields;
|
|
6137
6179
|
if (mode === "show") return null;
|
|
6138
|
-
const busy = controller.isSubmitting;
|
|
6180
|
+
const busy = controller.isSubmitting || chrome.created === true;
|
|
6139
6181
|
const cancel = () => {
|
|
6140
6182
|
if (chrome.onCancel !== void 0) chrome.onCancel();
|
|
6141
|
-
else navigate(
|
|
6183
|
+
else navigate(back, { origin: "inherit" });
|
|
6142
6184
|
};
|
|
6143
6185
|
const plan = controller.plan;
|
|
6144
6186
|
const undrawn = (field) => plan === null || plan.fields[field] === void 0 || plan.fields[field] === "inactive";
|
|
6145
|
-
const recordLevel = (issue) => issue.field === "_form" || undrawn(issue.field);
|
|
6187
|
+
const recordLevel = (issue) => issue.field === "_form" || undrawn(pathHead(issue.field)) || !placed.has(issue.field);
|
|
6146
6188
|
const undrawnBlockers = (controller.checkOutcome?.blockers ?? []).flatMap((issue) => {
|
|
6147
6189
|
const field = typeof issue.path?.[0] === "string" ? issue.path[0] : "_form";
|
|
6148
|
-
if (field !== "_form" && !undrawn(field)) return [];
|
|
6190
|
+
if (field !== "_form" && !undrawn(field) && deepestPlacedPath(issue.path, placed) !== void 0) return [];
|
|
6149
6191
|
if (controller.errors.some((own) => own.code === issue.code && own.field === field)) return [];
|
|
6150
6192
|
return [{
|
|
6151
6193
|
...issue,
|
|
6152
|
-
field
|
|
6194
|
+
field,
|
|
6195
|
+
path: field === "_form" ? [] : issue.path.slice(1)
|
|
6153
6196
|
}];
|
|
6154
6197
|
});
|
|
6155
6198
|
const formErrors = firstPreferred([...controller.errors.filter(recordLevel), ...undrawnBlockers]);
|
|
@@ -6169,7 +6212,7 @@ function FormActionsView() {
|
|
|
6169
6212
|
if (!retryable.includes(checkId)) retryable.push(checkId);
|
|
6170
6213
|
}
|
|
6171
6214
|
const failure = chrome.submitError === void 0 ? void 0 : failureText(chrome.submitError, chrome.submitApplied, t, caps);
|
|
6172
|
-
const serverIssues = bySeverity(alertIssues).
|
|
6215
|
+
const serverIssues = bySeverity(alertIssues).flatMap((issue) => {
|
|
6173
6216
|
const head = issue.path[0];
|
|
6174
6217
|
const name = typeof head === "string" ? head : void 0;
|
|
6175
6218
|
const declared = name === void 0 ? void 0 : fieldDefs?.[name];
|
|
@@ -6182,11 +6225,12 @@ function FormActionsView() {
|
|
|
6182
6225
|
t: caps.t,
|
|
6183
6226
|
...declared === void 0 ? {} : { fieldKey: `resources.${resource}.fields.${name}` }
|
|
6184
6227
|
});
|
|
6185
|
-
return
|
|
6228
|
+
if (issue.path.length === 0 && message === failure) return [];
|
|
6229
|
+
return [{
|
|
6186
6230
|
label: declared === void 0 || name === void 0 ? void 0 : resolveFieldLabel(labelCaps, name, declaredText("field", declared, "label")),
|
|
6187
6231
|
message,
|
|
6188
6232
|
severity: issue.severity
|
|
6189
|
-
};
|
|
6233
|
+
}];
|
|
6190
6234
|
});
|
|
6191
6235
|
const steps = controller.steps;
|
|
6192
6236
|
const midSteps = steps !== null && steps.ids.length > 1 && steps.current !== void 0 && steps.current !== steps.ids[steps.ids.length - 1];
|
|
@@ -6678,8 +6722,8 @@ function declaresDisplay(field) {
|
|
|
6678
6722
|
return field !== void 0 && resolveSurfaceUi(field, "column").use !== void 0;
|
|
6679
6723
|
}
|
|
6680
6724
|
const NO_INITIAL_FILTERS = Object.freeze({});
|
|
6681
|
-
const RelatedCards = lazy(async () => ({ default: (await import("./related-list-cards-
|
|
6682
|
-
const RelatedTimeline = lazy(async () => ({ default: (await import("./related-list-timeline-
|
|
6725
|
+
const RelatedCards = lazy(async () => ({ default: (await import("./related-list-cards-BvkD5OcC.js")).RelatedCards }));
|
|
6726
|
+
const RelatedTimeline = lazy(async () => ({ default: (await import("./related-list-timeline-DCrwN9oO.js")).RelatedTimeline }));
|
|
6683
6727
|
function discriminatorOptionLabel(field, value) {
|
|
6684
6728
|
const text = fieldOptionText(field, value);
|
|
6685
6729
|
if (text !== void 0) return text;
|
|
@@ -8150,7 +8194,7 @@ function RelatedRecordView({ props, empty }) {
|
|
|
8150
8194
|
});
|
|
8151
8195
|
const result = query.data;
|
|
8152
8196
|
const raw = result?.data;
|
|
8153
|
-
const dtoRow = useMemo(() => raw !== null && typeof raw === "object" && projection !== void 0 ?
|
|
8197
|
+
const dtoRow = useMemo(() => raw !== null && typeof raw === "object" && projection !== void 0 ? deriveRecord(raw, (record) => projectDto(record, projection)) : void 0, [raw, projection]);
|
|
8154
8198
|
const access = useFieldAccess(resource, "record", dtoRow);
|
|
8155
8199
|
const projected = useProjectedRecord(resource, dtoRow, { placeholder: query.isPlaceholderData === true });
|
|
8156
8200
|
const fieldsKey = JSON.stringify(own.fields ?? null);
|
|
@@ -8191,10 +8235,7 @@ function RelatedRecordView({ props, empty }) {
|
|
|
8191
8235
|
children: own.title
|
|
8192
8236
|
}), own.toolbar === "item" ? jsx(ActionOverflow, {
|
|
8193
8237
|
resource,
|
|
8194
|
-
record: {
|
|
8195
|
-
...dtoRow,
|
|
8196
|
-
id
|
|
8197
|
-
},
|
|
8238
|
+
record: withRecordKeys(dtoRow, { id }),
|
|
8198
8239
|
surface: "show"
|
|
8199
8240
|
}) : null]
|
|
8200
8241
|
}), jsx("dl", {
|
|
@@ -8490,6 +8531,6 @@ function PlaceNode({ node }) {
|
|
|
8490
8531
|
});
|
|
8491
8532
|
}
|
|
8492
8533
|
//#endregion
|
|
8493
|
-
export { CursorLoadMore as $, ListSearchInput as A,
|
|
8534
|
+
export { CursorLoadMore as $, ListSearchInput as A, AppFlowButton as At, ExportDialog as B, ListControls as C, useShownItemActions as Ct, ListFlows as D, EnumSettlingRow as Dt, ListLive as E, EnumBadge as Et, ListColumns as F, toDisplayText as Ft, RouteScreenClaimContext as G, ScreenTree as H, ColumnsToggle as I, ShellProvider as It, FormControlProvider as J, RouteScreenContext as K, DataTableViewOptions as L, defaultUserMapper as Lt, ExportButton as M, FieldDisplay as Mt, ListCreate as N, i18nPrefixToRef$1 as Nt, ListFilters as O, unknownEnumValueLabel as Ot, CreateButton as P, FieldValueFrame as Pt, ResourceList as Q, ListBulkBar as R, usePaletteState as Rt, useFrameChrome as S, ActionOverflow as St, SavedViewsDropdown as T, downloadArtifact as Tt, useTabsUrlState as U, DeclarativeForm as V, QuickScreenClaimContext as W, useFormControlOf as X, useFormControl as Y, ListBody as Z, CopyId as _, ShowPageHeader as _t, peekFieldDefinition as a, DataTable as at, RecordTitle as b, useDocumentTitle as bt, peekRow as c, TabsContent as ct, resolveFrameView as d, RelatedItem as dt, ListErrorState as et, shadcnFrameViews as f, useItemDrawn as ft, UndeclaredTypeNotice as g, PageHeader as gt, TypeChromeDrawnContext as h, EditPageHeader as ht, RouteListContext as i, useBuroDataTable as it, ListExport as j, Field as jt, FilterRegion as k, DeepLinkScope as kt, useRelationPicker as l, TabsList as lt, HeaderTypeNotice as m, RelatedTimelineSkeleton as mt, viewOf as n, resolveUpdater as nt, peekLeafAllowed as o, Checkbox as ot, ChangeTypeButton as p, RELATED_GRID_CLASS as pt, useIsRouteScreen as q, shadcnBlockImplementations as r, tanStackSortingToBuro as rt, peekRecord as s, Tabs as st, selectImplementation as t, buroSortingToTanStack as tt, isBuiltinRecordView as u, TabsTrigger as ut, FormActions as v, resolveResourceTitle as vt, ListSavedViews as w, useExportRunWatcher as wt, FrameChromeContext as x, typography as xt, RecordActions as y, DocumentTitleProvider as yt, BulkActionToolbar as z, useShell as zt };
|
|
8494
8535
|
|
|
8495
|
-
//# sourceMappingURL=place-node-
|
|
8536
|
+
//# sourceMappingURL=place-node-BdxT-30h.js.map
|