@burojs/ui-shadcn 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bulk-summary-CrEij5vq.cjs → bulk-summary-2HLgz7Il.cjs} +31 -5
- package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
- package/dist/{bulk-summary-BWSAS7k2.js → bulk-summary-D6A0ua21.js} +32 -6
- package/dist/bulk-summary-D6A0ua21.js.map +1 -0
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js → candidates-relation-picker-QvoY2bOQ.js} +3 -3
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js.map → candidates-relation-picker-QvoY2bOQ.js.map} +1 -1
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs → candidates-relation-picker-pEAWKQEY.cjs} +3 -3
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs.map → candidates-relation-picker-pEAWKQEY.cjs.map} +1 -1
- package/dist/{check-confirm-dialog-2j0gOd7x.js → check-confirm-dialog-B-CbJTln.js} +68 -8
- package/dist/{check-confirm-dialog-2j0gOd7x.js.map → check-confirm-dialog-B-CbJTln.js.map} +1 -1
- package/dist/{check-confirm-dialog-C-NHgMST.cjs → check-confirm-dialog-W-8WOmGh.cjs} +72 -6
- package/dist/check-confirm-dialog-W-8WOmGh.cjs.map +1 -0
- package/dist/{filter-builder-DaWHUZuV.js → filter-builder-04nas3eq.js} +127 -61
- package/dist/filter-builder-04nas3eq.js.map +1 -0
- package/dist/{filter-builder-DFu0JP-1.cjs → filter-builder-DQX-TMFh.cjs} +140 -68
- package/dist/filter-builder-DQX-TMFh.cjs.map +1 -0
- package/dist/{flow-runtime-DyqTmK3H.js → flow-runtime-BEIyym7d.js} +7 -4
- package/dist/{flow-runtime-DyqTmK3H.js.map → flow-runtime-BEIyym7d.js.map} +1 -1
- package/dist/{flow-runtime-BpmrIUb6.cjs → flow-runtime-DyNIYfUP.cjs} +7 -4
- package/dist/{flow-runtime-BpmrIUb6.cjs.map → flow-runtime-DyNIYfUP.cjs.map} +1 -1
- package/dist/{flow-screen-DCdli6Ha.js → flow-screen-DY1Z9PbG.js} +56 -15
- package/dist/flow-screen-DY1Z9PbG.js.map +1 -0
- package/dist/{flow-screen-Bcz9NF2V.cjs → flow-screen-FE5Xhb3t.cjs} +54 -13
- package/dist/flow-screen-FE5Xhb3t.cjs.map +1 -0
- package/dist/index.cjs +564 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +235 -95
- package/dist/index.d.ts +235 -95
- package/dist/index.js +562 -169
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-C0rI9B7f.js → inline-flow-host-D6u-RlsV.js} +3 -3
- package/dist/{inline-flow-host-C0rI9B7f.js.map → inline-flow-host-D6u-RlsV.js.map} +1 -1
- package/dist/{inline-flow-host-3vw7LzzD.cjs → inline-flow-host-yVLo6-sM.cjs} +3 -3
- package/dist/{inline-flow-host-3vw7LzzD.cjs.map → inline-flow-host-yVLo6-sM.cjs.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js → lazy-relation-picker-dialog-BaORufxQ.js} +2 -2
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js.map → lazy-relation-picker-dialog-BaORufxQ.js.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs → lazy-relation-picker-dialog-C_VlGlDz.cjs} +2 -2
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs.map → lazy-relation-picker-dialog-C_VlGlDz.cjs.map} +1 -1
- package/dist/{page-flow-route-BHUEpn0I.js → page-flow-route-CyMzUidK.js} +8 -9
- package/dist/page-flow-route-CyMzUidK.js.map +1 -0
- package/dist/{page-flow-route-DS8IVTVH.cjs → page-flow-route-OFx7h7Ja.cjs} +8 -9
- package/dist/page-flow-route-OFx7h7Ja.cjs.map +1 -0
- package/dist/{place-node-CNb3w-c7.cjs → place-node-BZF5Af6x.cjs} +224 -151
- package/dist/place-node-BZF5Af6x.cjs.map +1 -0
- package/dist/{place-node-CfzQvh4Y.js → place-node-DRjmJGQ_.js} +210 -125
- package/dist/place-node-DRjmJGQ_.js.map +1 -0
- package/dist/{related-list-cards-BIqqY69Y.js → related-list-cards-2hLitVkg.js} +3 -3
- package/dist/{related-list-cards-BIqqY69Y.js.map → related-list-cards-2hLitVkg.js.map} +1 -1
- package/dist/{related-list-cards-CelMxl4q.cjs → related-list-cards-xVvgSlu-.cjs} +3 -3
- package/dist/{related-list-cards-CelMxl4q.cjs.map → related-list-cards-xVvgSlu-.cjs.map} +1 -1
- package/dist/related-list-timeline-CxJqe6eK.js +167 -0
- package/dist/related-list-timeline-CxJqe6eK.js.map +1 -0
- package/dist/related-list-timeline-Dsf5WewG.cjs +167 -0
- package/dist/related-list-timeline-Dsf5WewG.cjs.map +1 -0
- package/dist/{related-rows-MPnLCmPF.cjs → related-rows-DDhp9axl.cjs} +4 -4
- package/dist/{related-rows-MPnLCmPF.cjs.map → related-rows-DDhp9axl.cjs.map} +1 -1
- package/dist/{related-rows--uP2iKQC.js → related-rows-DL6CWsrj.js} +4 -4
- package/dist/{related-rows--uP2iKQC.js.map → related-rows-DL6CWsrj.js.map} +1 -1
- package/dist/{relation-create-C43cdPQt.js → relation-create-6WicROWA.js} +33 -5
- package/dist/relation-create-6WicROWA.js.map +1 -0
- package/dist/{relation-create-DDEYcKfw.cjs → relation-create-_SFuPQGM.cjs} +37 -3
- package/dist/relation-create-_SFuPQGM.cjs.map +1 -0
- package/dist/{relation-many-picker-DzuGJpEl.cjs → relation-many-picker-BBNsmkaX.cjs} +18 -11
- package/dist/relation-many-picker-BBNsmkaX.cjs.map +1 -0
- package/dist/{relation-many-picker-BJhaEqxz.js → relation-many-picker-mGEQDWo2.js} +18 -11
- package/dist/relation-many-picker-mGEQDWo2.js.map +1 -0
- package/dist/{relation-picker-D-tBBZW_.js → relation-picker-BbO41cFV.js} +19 -11
- package/dist/relation-picker-BbO41cFV.js.map +1 -0
- package/dist/{relation-picker-dialog-DoEY8EkH.js → relation-picker-dialog-BgSG_8bU.js} +5 -5
- package/dist/relation-picker-dialog-BgSG_8bU.js.map +1 -0
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs → relation-picker-dialog-Duqy2r0n.cjs} +5 -5
- package/dist/relation-picker-dialog-Duqy2r0n.cjs.map +1 -0
- package/dist/{relation-picker-DaIMzf2H.cjs → relation-picker-jk9D_uwn.cjs} +19 -11
- package/dist/relation-picker-jk9D_uwn.cjs.map +1 -0
- package/dist/{relation-select-Cr3CfNLy.cjs → relation-select-C3aV18kT.cjs} +2 -2
- package/dist/{relation-select-Cr3CfNLy.cjs.map → relation-select-C3aV18kT.cjs.map} +1 -1
- package/dist/{relation-select-B8Fq4o-t.js → relation-select-CjQT9LpS.js} +2 -2
- package/dist/{relation-select-B8Fq4o-t.js.map → relation-select-CjQT9LpS.js.map} +1 -1
- package/dist/{resource-page-router-Diw6S6TK.js → resource-page-router-CzaNATSp.js} +209 -30
- package/dist/resource-page-router-CzaNATSp.js.map +1 -0
- package/dist/{resource-page-router-C_kGW2o_.cjs → resource-page-router-dmVIeu5s.cjs} +235 -32
- package/dist/resource-page-router-dmVIeu5s.cjs.map +1 -0
- package/dist/{success-notices-Dl3M1fZP.cjs → success-notices-Cl4b6MLQ.cjs} +3 -2
- package/dist/success-notices-Cl4b6MLQ.cjs.map +1 -0
- package/dist/{success-notices-LDEgEkc4.js → success-notices-CrcWOGSo.js} +3 -2
- package/dist/success-notices-CrcWOGSo.js.map +1 -0
- package/dist/{use-dialog-filter-state-B_MqzHaT.js → use-dialog-filter-state-CJoeY-1j.js} +2 -2
- package/dist/{use-dialog-filter-state-B_MqzHaT.js.map → use-dialog-filter-state-CJoeY-1j.js.map} +1 -1
- package/dist/{use-dialog-filter-state-tNvqAAjh.cjs → use-dialog-filter-state-lsTJxrB4.cjs} +2 -2
- package/dist/{use-dialog-filter-state-tNvqAAjh.cjs.map → use-dialog-filter-state-lsTJxrB4.cjs.map} +1 -1
- package/dist/use-record-subtitle-BJ9rnj6F.cjs +67 -0
- package/dist/use-record-subtitle-BJ9rnj6F.cjs.map +1 -0
- package/dist/use-record-subtitle-w3ZhXNlf.js +50 -0
- package/dist/use-record-subtitle-w3ZhXNlf.js.map +1 -0
- package/package.json +9 -9
- package/dist/bulk-summary-BWSAS7k2.js.map +0 -1
- package/dist/bulk-summary-CrEij5vq.cjs.map +0 -1
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +0 -1
- package/dist/filter-builder-DFu0JP-1.cjs.map +0 -1
- package/dist/filter-builder-DaWHUZuV.js.map +0 -1
- package/dist/flow-screen-Bcz9NF2V.cjs.map +0 -1
- package/dist/flow-screen-DCdli6Ha.js.map +0 -1
- package/dist/page-flow-route-BHUEpn0I.js.map +0 -1
- package/dist/page-flow-route-DS8IVTVH.cjs.map +0 -1
- package/dist/place-node-CNb3w-c7.cjs.map +0 -1
- package/dist/place-node-CfzQvh4Y.js.map +0 -1
- package/dist/related-list-timeline-CRh7xwLD.js +0 -141
- package/dist/related-list-timeline-CRh7xwLD.js.map +0 -1
- package/dist/related-list-timeline-DsLdi8sv.cjs +0 -141
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +0 -1
- package/dist/relation-create-C43cdPQt.js.map +0 -1
- package/dist/relation-create-DDEYcKfw.cjs.map +0 -1
- package/dist/relation-many-picker-BJhaEqxz.js.map +0 -1
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +0 -1
- package/dist/relation-picker-D-tBBZW_.js.map +0 -1
- package/dist/relation-picker-DaIMzf2H.cjs.map +0 -1
- package/dist/relation-picker-dialog-9Vg5vvR1.cjs.map +0 -1
- package/dist/relation-picker-dialog-DoEY8EkH.js.map +0 -1
- package/dist/resource-page-router-C_kGW2o_.cjs.map +0 -1
- package/dist/resource-page-router-Diw6S6TK.js.map +0 -1
- package/dist/success-notices-Dl3M1fZP.cjs.map +0 -1
- package/dist/success-notices-LDEgEkc4.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { c as scrollToDocAnchor, l as cn, n as useTheme, s as readDocHash, t as THEME_CHOICES } from "./use-theme-dnE3Od3I.js";
|
|
2
2
|
import { a as technicalText, c as LinkComponentProvider, d as PopoverAnchor, f as PopoverClose, l as useLinkComponent, m as PopoverTrigger, n as toast, p as PopoverContent, r as friendlyStringsFrom, s as toFriendlyError, t as Toaster, u as Popover } from "./toaster-Ct_YHGs6.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as DropdownMenuTrigger, A as useLoaded, B as DropdownMenuCheckboxItem, E as loadFlowScreen, F as SheetPresentationShell, G as DropdownMenuPortal, H as DropdownMenuGroup, I as Icon, J as DropdownMenuSeparator, K as DropdownMenuRadioGroup, L as hasIcon, N as DialogPresentationShell, P as OwnTitleContext, Q as DropdownMenuSubTrigger, R as registerIcons, U as DropdownMenuItem, V as DropdownMenuContent, W as DropdownMenuLabel, X as DropdownMenuSub, Y as DropdownMenuShortcut, Z as DropdownMenuSubContent, at as SheetClose, b as FlowLoadFailed, c as listSlot, ct as SheetFooter, d as openExternal, dt as SheetTrigger, et as Tooltip, ft as DocInfo, it as Sheet, j as OwnTitleHeading, l as useListSlot, lt as SheetHeader, n as ActionButton, nt as TooltipProvider, o as modeForSurface, ot as SheetContent, p as FlowActionButton, q as DropdownMenuRadioItem, r as DisabledAction, rt as TooltipTrigger, s as canonicalResourceName, st as SheetDescription, t as CheckConfirmDialog, tt as TooltipContent, u as isExternalHref, ut as SheetTitle, v as reasonText, y as FlowBoundary, z as DropdownMenu } from "./check-confirm-dialog-B-CbJTln.js";
|
|
4
4
|
import { n as buttonVariants, t as Button } from "./button-MWVeZaqj.js";
|
|
5
5
|
import { t as Input } from "./input-CUPStzZO.js";
|
|
6
6
|
import { a as DialogFooter, c as DialogTrigger, i as DialogDescription, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogTitle, t as Dialog } from "./dialog-C123sVQ8.js";
|
|
7
|
-
import { C as
|
|
7
|
+
import { A as CommandSeparator, C as CommandDialog, D as CommandItem, E as CommandInput, O as CommandList, S as Command, T as CommandGroup, b as LoadError, c as RelationField, d as peekAnchorOpener, f as PeekContext, g as recordDisplayName, k as CommandLoading, l as relationLinkClassName, p as PeekHostContext, s as RelationDisplay, u as focusWithoutPeek, w as CommandEmpty, x as RecordState, y as InvalidRouteId } from "./relation-create-6WicROWA.js";
|
|
8
8
|
import { t as Skeleton } from "./skeleton-U2noefj5.js";
|
|
9
|
-
import { $ as CursorLoadMore, A as ListSearchInput, At as
|
|
9
|
+
import { $ as CursorLoadMore, A as ListSearchInput, At as AppFlowButton, B as ExportDialog, C as ListControls, D as ListFlows, Dt as EnumSettlingRow, E as ListLive, Et as EnumBadge, F as ListColumns, Ft as toDisplayText, H as ScreenTree, I as ColumnsToggle, It as ShellProvider, L as DataTableViewOptions, Lt as defaultUserMapper, M as ExportButton, Mt as FieldDisplay, N as ListCreate, Nt as i18nPrefixToRef, O as ListFilters, Ot as unknownEnumValueLabel, P as CreateButton, Pt as FieldValueFrame, Q as ResourceList, R as ListBulkBar, Rt as usePaletteState, St as ActionOverflow, T as SavedViewsDropdown, Tt as downloadArtifact, V as DeclarativeForm, W as QuickScreenClaimContext, Y as useFormControl, Z as ListBody, _ as CopyId, _t as ShowPageHeader, a as peekFieldDefinition, at as DataTable, b as RecordTitle, bt as useDocumentTitle, c as peekRow, ct as TabsContent, d as resolveFrameView, et as ListErrorState, f as shadcnFrameViews, gt as PageHeader, ht as EditPageHeader, it as useBuroDataTable, j as ListExport, jt as Field, k as FilterRegion, l as useRelationPicker, lt as TabsList, nt as resolveUpdater, o as peekLeafAllowed, ot as Checkbox, r as shadcnBlockImplementations, rt as tanStackSortingToBuro, s as peekRecord, st as Tabs, tt as buroSortingToTanStack, ut as TabsTrigger, v as FormActions, vt as resolveResourceTitle, w as ListSavedViews, wt as useExportRunWatcher, xt as typography, y as RecordActions, yt as DocumentTitleProvider, z as BulkActionToolbar, zt as useShell } from "./place-node-DRjmJGQ_.js";
|
|
10
10
|
import { THEME_STORAGE_KEY } from "./layout/theme-storage-key.js";
|
|
11
|
-
import { A as
|
|
12
|
-
import { A as
|
|
11
|
+
import { A as TableHeader, B as DEFAULT_LANGUAGE_STORAGE_KEY, C as SelectTrigger, D as TableCaption, E as TableBody, F as ResolvedFieldDisplay, H as saveLocale, M as Badge, N as badgeVariants, O as TableCell, S as SelectSeparator, T as Table, V as loadLocale, _ as SelectGroup, a as PinnedFilterControls, b as SelectScrollDownButton, c as fromLocalDateTimeText, d as useFieldTimeZone, f as FilterBadges, g as SelectContent, h as Select, i as FacetedFilterPicker, j as TableRow, k as TableHead, l as toLocalDateTimeText, m as localeTag, n as PresetFilterControls, o as FilterPanel, p as formatNumber, r as DataTableFacetedFilter, s as FilterValueControl, t as FilterBuilder, u as dateDisplayParams, v as SelectItem, w as SelectValue, x as SelectScrollUpButton, y as SelectLabel, z as lowerLegacyField } from "./filter-builder-04nas3eq.js";
|
|
12
|
+
import { A as useLayoutResolver, C as useMatch, D as BUILTIN_LAYOUTS, E as useResourceVisible, F as groupNavHref, I as canonicalNavKey, L as canonicalResourceKey$1, M as TabsLayout, N as SecondarySidebarLayout, O as layoutSlot, P as buildNavItems, S as useHref, T as usePageAllowed, _ as RecordScreen, a as useRecordVisit, b as ResourceListPage, c as headerTrail, d as recordTrailRoute, f as useTrailContext, g as usePublishedRecordTrail, i as RecordPage, j as useReportUnresolvedLayouts, k as useLayout, l as originTrail, m as recordTrailKey, n as NavAreaPage, o as RECENT_LABEL_KEYS, p as isShowAvailable, r as ResourcePageRouter, s as readRecentRecords, t as NavAreaNotFound, u as recordTrail, v as useResourceDimensionOptions, w as useNavVisible, x as NavChromeMountedProvider, y as PlannedBody } from "./resource-page-router-CzaNATSp.js";
|
|
13
13
|
import { t as Label } from "./label-66W1qbke.js";
|
|
14
|
-
import { t as LazyRelationPickerDialog } from "./lazy-relation-picker-dialog-
|
|
15
|
-
import { n as
|
|
16
|
-
import {
|
|
14
|
+
import { t as LazyRelationPickerDialog } from "./lazy-relation-picker-dialog-BaORufxQ.js";
|
|
15
|
+
import { n as useRecordSubtitle, r as useRowSubtitle } from "./use-record-subtitle-w3ZhXNlf.js";
|
|
16
|
+
import { n as RelationPicker, r as RelationPickerInput } from "./relation-picker-BbO41cFV.js";
|
|
17
|
+
import { t as useDialogFilterState } from "./use-dialog-filter-state-CJoeY-1j.js";
|
|
17
18
|
import { useGlobalShortcut, webPlatform } from "@burojs/react/web";
|
|
18
|
-
import { ENUM_CONTROLS, builtinFrames, columnName, compilePageScreen, compiledScreenFor, declaredField, declaredText, dtoFields, effectiveFlow, enumFallbackKey, enumFallbackText, enumNamespaceOf, enumValueText, evaluateVisible, fieldOptionText, formatEntityRef, hasListPage, hasRecordPage, hrefFor, humanizeKey, isCustomPageDef, isEnumControl, isRelationField, isScreenFailure, linkOf,
|
|
19
|
-
import { ComponentsContext, DispatcherProvider, I18nContext, NO_RECORD_SCOPE_FRAMES, QUICK_ANCHOR_ATTRIBUTE, QuickEntryContext, RecordScopeChain, RouteSourceContext, ScreenStateProvider, formatBytes, optionFieldName, resolveErrorText, resolveOptionLabel, retryRecordRead, useApp, useAppActions, useApplicationSnapshot, useAvailabilityGate, useBoundEnum, useCapabilityResolver, useChangeLocale, useChromeT, useCommandPalette, useCurrentUserId, useDebouncedValue, useDispatcherEffects, useDocPanel, useDocScopes, useDocTopics, useDocTrailScopes, useDocsConfig, useDocumentedScopes, useEntryGate, useEnumValues, useFieldAccess, useFileField, useFileUrls, useFormController, useFrameImplementations, useFrameT, useI18nCaps, useIdentity, useLanguageStorageKey, useLinkKeys, useList, useListAccess, useLocale, useLogout, useNavigationGuardText, useOne, useOptionCaps, useOptionalApp, useOptionalAuthController, useOptionalDataRuntime, useOptionalFileStorage, useOptionalLocale, useOptionalRouterAdapter, useOptionalT, usePlatformStorage, usePresentBlock, useProjectedRecord, useProjectedTitle, useQuick, useQuickEntry, useQuickEntryValue, useQuickOpener, useRecordTitle, useRefresh, useRegisterNavigationGuardDialog, useRelatedRecord, useRouteNavigate, useRouteRecordId, useRouterAdapter, useScope, useT, useTestIds, useUIInstance, useUIPresentationRuntime, useVisibilityCtx } from "@burojs/react";
|
|
20
|
-
import { IconAlertCircle, IconArrowLeft, IconArrowUpRight, IconBook2, IconCheck, IconChevronDown, IconChevronRight, IconDeviceDesktop, IconDots, IconExternalLink, IconHelp, IconHelpHexagon, IconLayoutSidebar, IconLoader2, IconLogin, IconLogout, IconMaximize, IconMinimize, IconMoon, IconRefresh, IconRotate, IconSearch, IconSelector, IconSun, IconUpload, IconUser, IconX } from "@tabler/icons-react";
|
|
19
|
+
import { ENUM_CONTROLS, builtinFrames, canonicalInstant, columnName, compilePageScreen, compiledScreenFor, declaredField, declaredText, dtoFields, effectiveFlow, enumFallbackKey, enumFallbackText, enumNamespaceOf, enumValueText, epochMsToInstant, evaluateVisible, fieldOptionText, formatEntityRef, formatTimeValue, hasListPage, hasRecordPage, hrefFor, humanizeKey, isCalendarDate, isCustomPageDef, isEnumControl, isRelationField, isScreenFailure, linkOf, nodeKind, normalizeDataError, normalizeEntityRef, projectDto, recordEntries, relationAmbiguousError, resolveConceptLabel, resolveContentSlot, resolveDoc, resolveEnumLabel, resolveFieldLabel, resolveNavLabel, resolveResourceLabel, resolveResourceNavLabel, resolveStaticAvailability, resourceCreateHref, resourceKey, resourceShowHref, routeResourceKey, snapshotAppFrames, snapshotBlockLookup, snapshotFrameLookup, taskRunFraction, taskRunOutcome, zoneShortName } from "@burojs/core";
|
|
20
|
+
import { ComponentsContext, DispatcherProvider, I18nContext, NO_RECORD_SCOPE_FRAMES, QUICK_ANCHOR_ATTRIBUTE, QuickEntryContext, RecordScopeChain, RouteSourceContext, ScreenStateProvider, formatBytes, optionFieldName, recordRouteAvailable, resolveErrorText, resolveOptionLabel, retryRecordRead, useApp, useAppActions, useApplicationSnapshot, useAvailabilityGate, useAvailableEnumValues, useBoundEnum, useCapabilityResolver, useChangeLocale, useChromeT, useCommandPalette, useCurrentUserId, useDebouncedValue, useDispatcherEffects, useDocPanel, useDocScopes, useDocTopics, useDocTrailScopes, useDocsConfig, useDocumentedScopes, useEntryGate, useEnumValues, useFieldAccess, useFieldMetaSources, useFileField, useFileUrls, useFormController, useFrameImplementations, useFrameT, useI18nCaps, useIdentity, useLanguageStorageKey, useLinkKeys, useList, useListAccess, useLocale, useLogout, useNavigationGuardText, useNavigationOrigin, useOne, useOptionCaps, useOptionalApp, useOptionalAuthController, useOptionalDataRuntime, useOptionalFileStorage, useOptionalLocale, useOptionalRouterAdapter, useOptionalT, useOriginIntent, usePermissionsUndecided, usePlatformStorage, usePresentBlock, useProjectedRecord, useProjectedTitle, usePublishOriginTitle, useQuick, useQuickEntry, useQuickEntryValue, useQuickOpener, useRecordTitle, useRefresh, useRegisterNavigationGuardDialog, useRelatedRecord, useRouteNavigate, useRouteRecordId, useRouterAdapter, useScope, useT, useTestIds, useTimeZone, useUIInstance, useUIPresentationRuntime, useVisibilityCtx } from "@burojs/react";
|
|
21
|
+
import { IconAlertCircle, IconArrowDown, IconArrowLeft, IconArrowUp, IconArrowUpRight, IconBook2, IconCheck, IconChevronDown, IconChevronRight, IconDeviceDesktop, IconDots, IconExternalLink, IconHelp, IconHelpHexagon, IconLayoutSidebar, IconLoader2, IconLogin, IconLogout, IconMaximize, IconMinimize, IconMoon, IconPlus, IconRefresh, IconRotate, IconSearch, IconSelector, IconSun, IconTrash, IconUpload, IconUser, IconX } from "@tabler/icons-react";
|
|
21
22
|
import * as React from "react";
|
|
22
23
|
import { Children, Fragment, Suspense, cloneElement, createContext, createElement, isValidElement, lazy, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
23
24
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -29,7 +30,7 @@ import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
|
29
30
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
30
31
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
31
32
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
32
|
-
import { enumBindingKey } from "@burojs/core/internal";
|
|
33
|
+
import { enumBindingKey, enumParamsOf, narrowEntriesOf, resolveEnumParams } from "@burojs/core/internal";
|
|
33
34
|
import { Controller, FormProvider, useForm, useFormContext } from "react-hook-form";
|
|
34
35
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
35
36
|
import { z } from "zod";
|
|
@@ -1711,51 +1712,9 @@ function useNavIcon() {
|
|
|
1711
1712
|
return useCallback((name) => resolveNavIcon(name, (key) => components[key]), [components]);
|
|
1712
1713
|
}
|
|
1713
1714
|
//#endregion
|
|
1714
|
-
//#region src/
|
|
1715
|
-
function
|
|
1716
|
-
|
|
1717
|
-
const chain = match?.groupChain ?? [];
|
|
1718
|
-
const qualifiedMatch = match;
|
|
1719
|
-
const activeLeaf = qualifiedMatch == null ? void 0 : qualifiedMatch.kind === "group-index" ? canonicalNavKey({
|
|
1720
|
-
name: qualifiedMatch.target ?? qualifiedMatch.name,
|
|
1721
|
-
ref: qualifiedMatch.targetRef
|
|
1722
|
-
}) : canonicalNavKey(qualifiedMatch);
|
|
1723
|
-
const isEligible = (node) => isVisible(node) && (entryFilter ? entryFilter(node) : true);
|
|
1724
|
-
const out = [];
|
|
1725
|
-
for (const child of registry.groups.childrenOf(groupName)) {
|
|
1726
|
-
if (!isEligible(child)) continue;
|
|
1727
|
-
const kind = nodeKind(child);
|
|
1728
|
-
const childKey = canonicalNavKey(child);
|
|
1729
|
-
const href = navHrefFor(registry, childKey, { isVisible: isEligible });
|
|
1730
|
-
if (kind === "group") {
|
|
1731
|
-
const label = resolveNavLabel(caps, `groups.${childKey}`, declaredText("chrome", child, "label"));
|
|
1732
|
-
const active = chain.some((g) => canonicalNavKey(g) === childKey);
|
|
1733
|
-
out.push({
|
|
1734
|
-
kind: "group",
|
|
1735
|
-
name: childKey,
|
|
1736
|
-
label,
|
|
1737
|
-
href,
|
|
1738
|
-
icon: icons?.group?.(childKey),
|
|
1739
|
-
active
|
|
1740
|
-
});
|
|
1741
|
-
} else if (kind === "custom-page") out.push({
|
|
1742
|
-
kind: "custom-page",
|
|
1743
|
-
name: childKey,
|
|
1744
|
-
label: resolveNavLabel(caps, `pages.${childKey}`, declaredText("chrome", child, "label")),
|
|
1745
|
-
href,
|
|
1746
|
-
icon: icons?.page?.(childKey),
|
|
1747
|
-
active: activeLeaf === childKey
|
|
1748
|
-
});
|
|
1749
|
-
else out.push({
|
|
1750
|
-
kind: "resource",
|
|
1751
|
-
name: childKey,
|
|
1752
|
-
label: resolveResourceNavLabel(caps, childKey, child),
|
|
1753
|
-
href,
|
|
1754
|
-
icon: icons?.resource?.(childKey),
|
|
1755
|
-
active: activeLeaf === childKey
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
return out;
|
|
1715
|
+
//#region src/shell/use-shell-waiting.ts
|
|
1716
|
+
function useShellWaiting() {
|
|
1717
|
+
return usePermissionsUndecided();
|
|
1759
1718
|
}
|
|
1760
1719
|
//#endregion
|
|
1761
1720
|
//#region src/layout/use-nav-tree.ts
|
|
@@ -1885,7 +1844,8 @@ function useNavTree(opts = {}) {
|
|
|
1885
1844
|
if (!isNavEligible(group)) continue;
|
|
1886
1845
|
const gLabel = groupLabel(group);
|
|
1887
1846
|
if (resolveLayout(group.layout)) {
|
|
1888
|
-
const href =
|
|
1847
|
+
const href = groupNavHref(app.registry, groupKey, isNavEligible);
|
|
1848
|
+
if (href === void 0) continue;
|
|
1889
1849
|
const entry = groupEntry(group, gLabel, href, isActiveHref(href, currentPath));
|
|
1890
1850
|
out.push({
|
|
1891
1851
|
key: groupKey,
|
|
@@ -1974,6 +1934,11 @@ function NavMain({ topLabel, iconForResource, iconForCustomPage, iconForSection,
|
|
|
1974
1934
|
const t = useT();
|
|
1975
1935
|
const RouterLink = useLinkComponent();
|
|
1976
1936
|
const navIcon = useNavIcon();
|
|
1937
|
+
const waiting = useShellWaiting();
|
|
1938
|
+
const intent = useOriginIntent();
|
|
1939
|
+
const jump = (entry) => () => {
|
|
1940
|
+
if (entry.href !== void 0) intent(entry.href, "jump");
|
|
1941
|
+
};
|
|
1977
1942
|
const ownOr = (own, name) => own !== void 0 ? own : navIcon(name);
|
|
1978
1943
|
const groupAsSection = (key) => app.registry.sections.get(key) ?? app.registry.groups.get(key);
|
|
1979
1944
|
const sectionIcon = (key, name) => {
|
|
@@ -2000,6 +1965,7 @@ function NavMain({ topLabel, iconForResource, iconForCustomPage, iconForSection,
|
|
|
2000
1965
|
href: entry.href ?? "",
|
|
2001
1966
|
"aria-current": entry.active ? "page" : void 0,
|
|
2002
1967
|
"data-testid": entryTestId(entry),
|
|
1968
|
+
onClick: jump(entry),
|
|
2003
1969
|
children: [icon != null && jsx("span", {
|
|
2004
1970
|
className: "inline-flex h-4 w-4 items-center justify-center",
|
|
2005
1971
|
"aria-hidden": "true",
|
|
@@ -2015,9 +1981,20 @@ function NavMain({ topLabel, iconForResource, iconForCustomPage, iconForSection,
|
|
|
2015
1981
|
href: entry.href ?? "",
|
|
2016
1982
|
"aria-current": entry.active ? "page" : void 0,
|
|
2017
1983
|
"data-testid": entryTestId(entry),
|
|
1984
|
+
onClick: jump(entry),
|
|
2018
1985
|
children: jsx("span", { children: entry.label })
|
|
2019
1986
|
})
|
|
2020
1987
|
}) }, entry.key);
|
|
1988
|
+
if (waiting) return jsx(SidebarGroup, {
|
|
1989
|
+
"data-testid": "sidebar-nav-loading",
|
|
1990
|
+
"aria-busy": "true",
|
|
1991
|
+
children: jsx(SidebarGroupContent, { children: jsx(SidebarMenu, { children: [
|
|
1992
|
+
0,
|
|
1993
|
+
1,
|
|
1994
|
+
2,
|
|
1995
|
+
3
|
|
1996
|
+
].map((i) => jsx(SidebarMenuItem, { children: jsx(SidebarMenuSkeleton, { showIcon: true }) }, i)) }) })
|
|
1997
|
+
});
|
|
2021
1998
|
const [top, ...blocks] = tree;
|
|
2022
1999
|
return jsxs(Fragment$1, { children: [top !== void 0 && top.entries.length > 0 && jsxs(SidebarGroup, { children: [topLabel !== null && jsx(SidebarGroupLabel, { children: topLabel ?? t("nav.resources") }), jsx(SidebarGroupContent, { children: jsx(SidebarMenu, { children: top.entries.map(menuItem) }) })] }), blocks.map((block) => {
|
|
2023
2000
|
const key = block.key ?? "";
|
|
@@ -2128,11 +2105,17 @@ function Breadcrumbs(input) {
|
|
|
2128
2105
|
const t = useOptionalT();
|
|
2129
2106
|
const RouterLink = useLinkComponent();
|
|
2130
2107
|
const caps = useI18nCaps(def?.name);
|
|
2108
|
+
const intent = useOriginIntent();
|
|
2109
|
+
const onJump = (seg) => {
|
|
2110
|
+
const href = seg.href;
|
|
2111
|
+
return seg.jump === true && href !== void 0 ? () => intent(href, "jump") : void 0;
|
|
2112
|
+
};
|
|
2131
2113
|
const trailScopes = useDocTrailScopes(def?.name);
|
|
2132
2114
|
const leading = (name) => leadingSegments?.map((seg, i) => jsxs("span", {
|
|
2133
2115
|
className: "flex min-w-0 items-center gap-1",
|
|
2134
2116
|
children: [seg.href ? jsx(RouterLink, {
|
|
2135
2117
|
href: seg.href,
|
|
2118
|
+
onClick: onJump(seg),
|
|
2136
2119
|
"data-testid": `${tid.navBreadcrumb(name)}:lead:${i}`,
|
|
2137
2120
|
className: cn(LINK_CLASS, "truncate"),
|
|
2138
2121
|
title: seg.label,
|
|
@@ -2167,9 +2150,34 @@ function Breadcrumbs(input) {
|
|
|
2167
2150
|
]
|
|
2168
2151
|
});
|
|
2169
2152
|
if (!def) return null;
|
|
2170
|
-
const { recordId, pageLabel, middleSegments } = props;
|
|
2153
|
+
const { recordId, pageLabel, middleSegments, rootSegments } = props;
|
|
2171
2154
|
const resourceKey = canonicalResourceKey$1(def);
|
|
2172
|
-
|
|
2155
|
+
if (rootSegments !== void 0 && rootSegments.length > 0) return jsxs("nav", {
|
|
2156
|
+
className: navClass,
|
|
2157
|
+
"aria-label": ariaLabel,
|
|
2158
|
+
"data-testid": testId,
|
|
2159
|
+
children: [
|
|
2160
|
+
rootSegments.map((seg, i) => jsxs("span", {
|
|
2161
|
+
className: "flex min-w-0 items-center gap-1",
|
|
2162
|
+
children: [i > 0 && jsx(Chevron, {}), seg.href ? jsx(RouterLink, {
|
|
2163
|
+
href: seg.href,
|
|
2164
|
+
onClick: onJump(seg),
|
|
2165
|
+
"data-testid": `${tid.navBreadcrumb(resourceKey)}:root:${i}`,
|
|
2166
|
+
className: cn(LINK_CLASS, "truncate"),
|
|
2167
|
+
title: seg.label,
|
|
2168
|
+
children: seg.label
|
|
2169
|
+
}) : jsx("span", {
|
|
2170
|
+
"data-testid": `${tid.navBreadcrumb(resourceKey)}:root:${i}`,
|
|
2171
|
+
className: "truncate",
|
|
2172
|
+
title: seg.label,
|
|
2173
|
+
children: seg.label
|
|
2174
|
+
})]
|
|
2175
|
+
}, `root:${i}:${seg.label}`)),
|
|
2176
|
+
pageLabel && jsxs(Fragment$1, { children: [jsx(Chevron, {}), current(tid.navBreadcrumb(resourceKey, recordId), pageLabel)] }),
|
|
2177
|
+
help
|
|
2178
|
+
]
|
|
2179
|
+
});
|
|
2180
|
+
const listHref = props.resourceHref ?? hrefFor(app.registry, resourceKey);
|
|
2173
2181
|
const resourceLabel = resolveResourceLabel(caps, resourceKey, "plural", def);
|
|
2174
2182
|
const resourceIsCurrent = !pageLabel && !(middleSegments && middleSegments.length > 0);
|
|
2175
2183
|
return jsxs("nav", {
|
|
@@ -2194,6 +2202,7 @@ function Breadcrumbs(input) {
|
|
|
2194
2202
|
className: "flex min-w-0 items-center gap-1",
|
|
2195
2203
|
children: [jsx(Chevron, {}), seg.href ? jsx(RouterLink, {
|
|
2196
2204
|
href: seg.href,
|
|
2205
|
+
onClick: onJump(seg),
|
|
2197
2206
|
"data-testid": `${tid.navBreadcrumb(resourceKey)}:mid:${i}`,
|
|
2198
2207
|
className: cn(LINK_CLASS, "truncate"),
|
|
2199
2208
|
title: seg.label,
|
|
@@ -2211,6 +2220,12 @@ function Breadcrumbs(input) {
|
|
|
2211
2220
|
}
|
|
2212
2221
|
//#endregion
|
|
2213
2222
|
//#region src/layout/record-breadcrumbs.tsx
|
|
2223
|
+
function viewOrigin(ctx, trail, resource) {
|
|
2224
|
+
if (trail === void 0 || trail.resource === void 0 || trail.segments.length > 0) return void 0;
|
|
2225
|
+
const target = ctx.registry.get(trail.resource)?.routesTo?.show;
|
|
2226
|
+
if (target === void 0 || ctx.registry.get(target) !== ctx.registry.get(resource)) return void 0;
|
|
2227
|
+
return trail.resource;
|
|
2228
|
+
}
|
|
2214
2229
|
function RecordBreadcrumbs() {
|
|
2215
2230
|
const ctx = useTrailContext();
|
|
2216
2231
|
const match = useMatch();
|
|
@@ -2218,9 +2233,17 @@ function RecordBreadcrumbs() {
|
|
|
2218
2233
|
const route = recordTrailRoute(ctx.registry, match);
|
|
2219
2234
|
const published = usePublishedRecordTrail(route === null ? "" : recordTrailKey(route.resource, route.id, route.flow === void 0 ? route.action : `flow:${route.flow}`));
|
|
2220
2235
|
const idTitle = useRecordTitle(route?.resource, route?.id);
|
|
2236
|
+
usePublishOriginTitle(published?.title || void 0);
|
|
2237
|
+
const origin = useNavigationOrigin();
|
|
2238
|
+
const rooted = origin === null ? void 0 : originTrail(ctx, origin);
|
|
2239
|
+
const view = route === null ? void 0 : viewOrigin(ctx, rooted, route.resource);
|
|
2240
|
+
const viewScopes = useDocTrailScopes(view);
|
|
2241
|
+
const ownScopes = useDocTrailScopes(view === void 0 ? void 0 : route?.resource);
|
|
2242
|
+
const docScopes = view === void 0 ? {} : { docScopes: [...new Set([...viewScopes, ...ownScopes])] };
|
|
2221
2243
|
if (route === null || match === null) return null;
|
|
2222
2244
|
const { resource, id, groupChain } = route;
|
|
2223
2245
|
const title = published?.title ?? idTitle;
|
|
2246
|
+
const withOrigin = rooted === void 0 ? {} : { origin: rooted };
|
|
2224
2247
|
if (route.flow !== void 0) {
|
|
2225
2248
|
if (effectiveFlow(snapshot, match.ref, route.flow) === void 0) return null;
|
|
2226
2249
|
const flowLabel = published?.flowLabel;
|
|
@@ -2230,8 +2253,10 @@ function RecordBreadcrumbs() {
|
|
|
2230
2253
|
action: "show",
|
|
2231
2254
|
id,
|
|
2232
2255
|
title: idTitle,
|
|
2233
|
-
groupChain
|
|
2256
|
+
groupChain,
|
|
2257
|
+
...withOrigin
|
|
2234
2258
|
}),
|
|
2259
|
+
...docScopes,
|
|
2235
2260
|
"data-testid": "record-breadcrumbs"
|
|
2236
2261
|
});
|
|
2237
2262
|
return jsx(Breadcrumbs, {
|
|
@@ -2240,8 +2265,10 @@ function RecordBreadcrumbs() {
|
|
|
2240
2265
|
action: "edit",
|
|
2241
2266
|
id,
|
|
2242
2267
|
title,
|
|
2243
|
-
groupChain
|
|
2268
|
+
groupChain,
|
|
2269
|
+
...withOrigin
|
|
2244
2270
|
}),
|
|
2271
|
+
...docScopes,
|
|
2245
2272
|
pageLabel: flowLabel,
|
|
2246
2273
|
"data-testid": "record-breadcrumbs"
|
|
2247
2274
|
});
|
|
@@ -2252,8 +2279,10 @@ function RecordBreadcrumbs() {
|
|
|
2252
2279
|
action: route.action,
|
|
2253
2280
|
id,
|
|
2254
2281
|
title,
|
|
2255
|
-
groupChain
|
|
2282
|
+
groupChain,
|
|
2283
|
+
...withOrigin
|
|
2256
2284
|
}),
|
|
2285
|
+
...docScopes,
|
|
2257
2286
|
"data-testid": "record-breadcrumbs"
|
|
2258
2287
|
});
|
|
2259
2288
|
}
|
|
@@ -2598,7 +2627,7 @@ function CommandPaletteNavigationGroups({ onSelect, getTestId }) {
|
|
|
2598
2627
|
}, [app, visibilityCtx]);
|
|
2599
2628
|
const goTo = (href) => {
|
|
2600
2629
|
onSelect?.();
|
|
2601
|
-
navigate(href);
|
|
2630
|
+
navigate(href, { origin: "jump" });
|
|
2602
2631
|
};
|
|
2603
2632
|
const resourceLabel = (def) => resolveResourceLabel(caps, canonicalResourceKey$1(def), "plural", def);
|
|
2604
2633
|
const pageLabel = (def) => resolveNavLabel(caps, `pages.${canonicalNavKey(def)}`, declaredText("chrome", def, "label"));
|
|
@@ -2670,10 +2699,10 @@ function CommandPaletteNavigationGroups({ onSelect, getTestId }) {
|
|
|
2670
2699
|
}
|
|
2671
2700
|
const collectGroupItems = (group, idPath, depth) => {
|
|
2672
2701
|
const items = [];
|
|
2673
|
-
|
|
2702
|
+
const href = !!resolveLayout(group.layout) ? groupNavHref(app.registry, canonicalNavKey(group), isVisible) : void 0;
|
|
2703
|
+
if (href !== void 0) {
|
|
2674
2704
|
const groupKey = canonicalNavKey(group);
|
|
2675
2705
|
const label = resolveNavLabel(caps, `groups.${groupKey}`, declaredText("chrome", group, "label"));
|
|
2676
|
-
const href = navHrefFor(app.registry, groupKey, { isVisible });
|
|
2677
2706
|
items.push(jsx(CommandItem, {
|
|
2678
2707
|
value: `group:${idPath}:${label}`,
|
|
2679
2708
|
onSelect: () => goTo(href),
|
|
@@ -2692,6 +2721,7 @@ function CommandPaletteNavigationGroups({ onSelect, getTestId }) {
|
|
|
2692
2721
|
}
|
|
2693
2722
|
if (kind === "custom-page") {
|
|
2694
2723
|
const page = child;
|
|
2724
|
+
if (!isPageVisible(page)) continue;
|
|
2695
2725
|
const pageKey = canonicalNavKey(page);
|
|
2696
2726
|
const label = pageLabel(page);
|
|
2697
2727
|
const href = page.path;
|
|
@@ -2802,7 +2832,7 @@ function CommandPaletteRecentGroup({ onSelect, getTestId, heading, refreshKey, w
|
|
|
2802
2832
|
const goTo = (href, entry) => {
|
|
2803
2833
|
onSelect?.();
|
|
2804
2834
|
if (href === null) quick.show(entry.canonicalRef, entry.id);
|
|
2805
|
-
else navigate(href);
|
|
2835
|
+
else navigate(href, { origin: "jump" });
|
|
2806
2836
|
};
|
|
2807
2837
|
return jsxs(Fragment, { children: [jsx(CommandGroup, {
|
|
2808
2838
|
heading: resolvedHeading,
|
|
@@ -2877,7 +2907,7 @@ function CommandPaletteRecordsGroup({ enabled = true, pageSize = 5, minQueryLeng
|
|
|
2877
2907
|
const goTo = (href, resource, id) => {
|
|
2878
2908
|
onSelect?.();
|
|
2879
2909
|
if (href === null) quick.show(resource, id);
|
|
2880
|
-
else navigate(href);
|
|
2910
|
+
else navigate(href, { origin: "jump" });
|
|
2881
2911
|
};
|
|
2882
2912
|
return jsx(CommandGroup, {
|
|
2883
2913
|
heading: resolvedHeading,
|
|
@@ -2915,6 +2945,7 @@ function PerResourceSearchHits({ def, displayField, query, pageSize, goTo, recor
|
|
|
2915
2945
|
enabled: shouldFetch
|
|
2916
2946
|
});
|
|
2917
2947
|
const report = useCommandPaletteResults(`records:${resource}`);
|
|
2948
|
+
const rowSubtitle = useRowSubtitle(resource);
|
|
2918
2949
|
const rows = !shouldFetch || q.isLoading || q.isError ? [] : q.data?.data ?? [];
|
|
2919
2950
|
useEffect(() => {
|
|
2920
2951
|
report(rows.length);
|
|
@@ -2929,16 +2960,25 @@ function PerResourceSearchHits({ def, displayField, query, pageSize, goTo, recor
|
|
|
2929
2960
|
if (!id) return null;
|
|
2930
2961
|
const display = titleVisible ? row[displayField] : void 0;
|
|
2931
2962
|
const labelText = typeof display === "string" && display.length > 0 ? display : id;
|
|
2963
|
+
const subtitle = rowSubtitle(row) ?? null;
|
|
2932
2964
|
const href = recordHref ? recordHref(resource, id) : isShowAvailable(registry, resource) ? resourceShowHref(registry, def, resource, id) : null;
|
|
2933
2965
|
return jsxs(CommandItem, {
|
|
2934
2966
|
value: `record:${resource}:${id}:${labelText}`,
|
|
2935
2967
|
forceMount: true,
|
|
2936
2968
|
onSelect: () => goTo(href, resource, id),
|
|
2937
2969
|
"data-testid": getTestId?.("records-record", `${resource}:${id}`),
|
|
2938
|
-
children: [
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2970
|
+
children: [
|
|
2971
|
+
jsxs("span", {
|
|
2972
|
+
className: "text-muted-foreground group-data-[selected=true]:text-accent-foreground mr-2",
|
|
2973
|
+
children: [resourceLabel, ":"]
|
|
2974
|
+
}),
|
|
2975
|
+
labelText,
|
|
2976
|
+
subtitle === null ? null : jsx("span", {
|
|
2977
|
+
"data-buro-region": "record-subtitle",
|
|
2978
|
+
className: "ml-auto truncate pl-2 text-xs text-muted-foreground group-data-[selected=true]:text-accent-foreground",
|
|
2979
|
+
children: subtitle
|
|
2980
|
+
})
|
|
2981
|
+
]
|
|
2942
2982
|
}, `record:${resource}:${id}`);
|
|
2943
2983
|
}) });
|
|
2944
2984
|
}
|
|
@@ -3000,7 +3040,7 @@ function CommandPaletteActionsGroup({ actions, onSelect, getTestId, heading }) {
|
|
|
3000
3040
|
const propActions = actions ?? EMPTY_ACTIONS;
|
|
3001
3041
|
const resolvedHeading = heading ?? t("commandPalette.actions", { defaultValue: "Actions" });
|
|
3002
3042
|
const { items, collidingIds } = useMemo(() => {
|
|
3003
|
-
return mergeActions(registryEntries.map((entry) => appActionToItem(entry, present, caps)), propActions);
|
|
3043
|
+
return mergeActions(registryEntries.filter((entry) => entry.undecided !== true).map((entry) => appActionToItem(entry, present, caps)), propActions);
|
|
3004
3044
|
}, [
|
|
3005
3045
|
registryEntries,
|
|
3006
3046
|
propActions,
|
|
@@ -3086,7 +3126,7 @@ function CommandPaletteCreateGroup({ resourceFilter, onSelect, getTestId, headin
|
|
|
3086
3126
|
]);
|
|
3087
3127
|
if (visibleResources.length === 0) return null;
|
|
3088
3128
|
const goTo = (href) => {
|
|
3089
|
-
navigate(href);
|
|
3129
|
+
navigate(href, { origin: "jump" });
|
|
3090
3130
|
onSelect?.();
|
|
3091
3131
|
};
|
|
3092
3132
|
const createIn = (def, href) => {
|
|
@@ -3153,19 +3193,21 @@ function AppActions() {
|
|
|
3153
3193
|
className: "flex items-center gap-1",
|
|
3154
3194
|
"data-testid": "app-actions",
|
|
3155
3195
|
children: links.map(({ action, href }) => {
|
|
3196
|
+
const inert = action.disabledReason !== void 0 || action.undecided === true;
|
|
3156
3197
|
const label = resolveNavLabel(caps, `appActions.${action.name}`, action.label);
|
|
3157
3198
|
const content = action.icon === void 0 ? label : jsxs(Fragment$1, { children: [jsx(Icon, { name: action.icon }), jsx("span", {
|
|
3158
3199
|
className: "max-md:sr-only",
|
|
3159
3200
|
children: label
|
|
3160
3201
|
})] });
|
|
3161
3202
|
return jsx(Button, {
|
|
3162
|
-
asChild:
|
|
3203
|
+
asChild: !inert,
|
|
3163
3204
|
variant: "outline",
|
|
3164
3205
|
size: "sm",
|
|
3165
|
-
disabled:
|
|
3206
|
+
disabled: inert,
|
|
3207
|
+
"aria-busy": action.undecided === true ? "true" : void 0,
|
|
3166
3208
|
title: action.disabledReason === void 0 ? void 0 : reasonText(caps, action.disabledReason),
|
|
3167
3209
|
"data-testid": `app-action:${action.name}`,
|
|
3168
|
-
children:
|
|
3210
|
+
children: !inert ? jsx(RouterLink, {
|
|
3169
3211
|
href,
|
|
3170
3212
|
children: content
|
|
3171
3213
|
}) : jsx("span", { children: content })
|
|
@@ -3434,7 +3476,7 @@ const NONE = "__none__";
|
|
|
3434
3476
|
function isEmpty$1(value) {
|
|
3435
3477
|
return value === null || value === void 0 || value === "";
|
|
3436
3478
|
}
|
|
3437
|
-
function EnumChoiceGroup({ control, options, value, onChange, testid, name, id, required, disabled, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, className }) {
|
|
3479
|
+
function EnumChoiceGroup({ control, options, current, settling, value, onChange, testid, name, id, required, disabled, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, className }) {
|
|
3438
3480
|
const t = useOptionalT();
|
|
3439
3481
|
const generatedName = React.useId();
|
|
3440
3482
|
const groupName = name ?? generatedName;
|
|
@@ -3449,16 +3491,25 @@ function EnumChoiceGroup({ control, options, value, onChange, testid, name, id,
|
|
|
3449
3491
|
...ariaErrorMessage ? { "aria-errormessage": ariaErrorMessage } : {}
|
|
3450
3492
|
};
|
|
3451
3493
|
if (control === "segmented") {
|
|
3452
|
-
const
|
|
3494
|
+
const segmentLabel = (option) => jsxs(Fragment$1, { children: [option.icon ? jsx("span", {
|
|
3495
|
+
"data-testid": `${testid}:option:${option.value}:icon`,
|
|
3496
|
+
className: "contents",
|
|
3497
|
+
children: jsx(Icon, {
|
|
3498
|
+
name: option.icon,
|
|
3499
|
+
className: "size-3.5 shrink-0"
|
|
3500
|
+
})
|
|
3501
|
+
}) : null, option.label] });
|
|
3502
|
+
const segment = (key, label, active, select, currentItem = false) => jsx("button", {
|
|
3453
3503
|
type: "button",
|
|
3454
3504
|
"aria-pressed": active,
|
|
3455
3505
|
"data-state": active ? "active" : "inactive",
|
|
3456
|
-
"data-testid": `${testid}:option:${key}`,
|
|
3457
|
-
|
|
3506
|
+
"data-testid": currentItem ? `${testid}:current` : `${testid}:option:${key}`,
|
|
3507
|
+
...currentItem ? { "data-current": "" } : {},
|
|
3508
|
+
disabled: disabled || currentItem,
|
|
3458
3509
|
onClick: select,
|
|
3459
3510
|
className: cn("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all", "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs", "disabled:pointer-events-none disabled:opacity-50", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"),
|
|
3460
3511
|
children: label
|
|
3461
|
-
}, key);
|
|
3512
|
+
}, currentItem ? `current:${key}` : key);
|
|
3462
3513
|
return jsxs("div", {
|
|
3463
3514
|
role: "group",
|
|
3464
3515
|
id,
|
|
@@ -3466,22 +3517,24 @@ function EnumChoiceGroup({ control, options, value, onChange, testid, name, id,
|
|
|
3466
3517
|
"data-testid": testid,
|
|
3467
3518
|
className: cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className),
|
|
3468
3519
|
...ariaProps,
|
|
3469
|
-
children: [
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
})
|
|
3476
|
-
|
|
3520
|
+
children: [
|
|
3521
|
+
current === void 0 ? null : segment(current.value, segmentLabel(current), true, () => void 0, true),
|
|
3522
|
+
required || settling !== void 0 ? null : segment(NONE, noneLabel, empty, () => pick(void 0)),
|
|
3523
|
+
settling === void 0 ? null : jsx(EnumSettlingRow, {
|
|
3524
|
+
status: settling,
|
|
3525
|
+
testid
|
|
3526
|
+
}),
|
|
3527
|
+
options.map((option) => segment(option.value, segmentLabel(option), value === option.value, () => pick(option.value)))
|
|
3528
|
+
]
|
|
3477
3529
|
});
|
|
3478
3530
|
}
|
|
3479
3531
|
const cards = control === "cards";
|
|
3480
|
-
const choice = (key, option, label, checked, select) => {
|
|
3481
|
-
const inputId = `${id ?? groupName}:${key}`;
|
|
3532
|
+
const choice = (key, option, label, checked, select, currentItem = false) => {
|
|
3533
|
+
const inputId = `${id ?? groupName}:${currentItem ? "current:" : ""}${key}`;
|
|
3534
|
+
const inert = disabled || currentItem;
|
|
3482
3535
|
return jsxs("label", {
|
|
3483
3536
|
htmlFor: inputId,
|
|
3484
|
-
className: cn("flex items-start gap-2.5", cards && "cursor-pointer rounded-lg border px-3 py-2.5 transition-colors hover:bg-accent/50 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring", cards && (checked ? "border-primary" : "border-input"),
|
|
3537
|
+
className: cn("flex items-start gap-2.5", cards && "cursor-pointer rounded-lg border px-3 py-2.5 transition-colors hover:bg-accent/50 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring", cards && (checked ? "border-primary" : "border-input"), inert && "cursor-not-allowed opacity-60"),
|
|
3485
3538
|
children: [jsx("input", {
|
|
3486
3539
|
type: "radio",
|
|
3487
3540
|
id: inputId,
|
|
@@ -3489,9 +3542,10 @@ function EnumChoiceGroup({ control, options, value, onChange, testid, name, id,
|
|
|
3489
3542
|
value: key,
|
|
3490
3543
|
checked,
|
|
3491
3544
|
onChange: select,
|
|
3492
|
-
disabled,
|
|
3545
|
+
disabled: inert,
|
|
3493
3546
|
...ariaProps,
|
|
3494
|
-
"data-testid": `${testid}:option:${key}`,
|
|
3547
|
+
"data-testid": currentItem ? `${testid}:current` : `${testid}:option:${key}`,
|
|
3548
|
+
...currentItem ? { "data-current": "" } : {},
|
|
3495
3549
|
className: cn("h-4 w-4 shrink-0 accent-primary", cards ? "mt-0.5" : "mt-1")
|
|
3496
3550
|
}), jsxs("span", {
|
|
3497
3551
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
@@ -3511,7 +3565,7 @@ function EnumChoiceGroup({ control, options, value, onChange, testid, name, id,
|
|
|
3511
3565
|
children: option.summary
|
|
3512
3566
|
})]
|
|
3513
3567
|
})]
|
|
3514
|
-
}, key);
|
|
3568
|
+
}, currentItem ? `current:${key}` : key);
|
|
3515
3569
|
};
|
|
3516
3570
|
return jsxs("div", {
|
|
3517
3571
|
role: "radiogroup",
|
|
@@ -3520,23 +3574,40 @@ function EnumChoiceGroup({ control, options, value, onChange, testid, name, id,
|
|
|
3520
3574
|
"data-testid": testid,
|
|
3521
3575
|
"aria-required": required,
|
|
3522
3576
|
className: cn("flex flex-col", cards ? "gap-2" : "gap-1.5", className),
|
|
3523
|
-
children: [
|
|
3577
|
+
children: [
|
|
3578
|
+
current === void 0 ? null : choice(current.value, current, current.label, true, () => void 0, true),
|
|
3579
|
+
required || settling !== void 0 ? null : choice(NONE, void 0, noneLabel, empty, () => pick(void 0)),
|
|
3580
|
+
settling === void 0 ? null : jsx(EnumSettlingRow, {
|
|
3581
|
+
status: settling,
|
|
3582
|
+
testid
|
|
3583
|
+
}),
|
|
3584
|
+
options.map((option) => choice(option.value, option, option.label, value === option.value, () => pick(option.value)))
|
|
3585
|
+
]
|
|
3524
3586
|
});
|
|
3525
3587
|
}
|
|
3526
3588
|
//#endregion
|
|
3527
3589
|
//#region src/enum/enum-picker.tsx
|
|
3528
3590
|
const ENUM_PICKER_CLEAR_SENTINEL = "__buro_clear__";
|
|
3591
|
+
const NO_VALUES = Object.freeze([]);
|
|
3529
3592
|
function withSummary(summary) {
|
|
3530
3593
|
return summary === void 0 ? {} : { summary };
|
|
3531
3594
|
}
|
|
3532
|
-
function EnumPicker({ enumName: enumInput, value, onChange, control = "select", name, id, testid, placeholder, disabled, required, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, className, clearable = false, clearLabel = "All" }) {
|
|
3595
|
+
function EnumPicker({ enumName: enumInput, value, onChange, control = "select", name, id, testid, placeholder, disabled, required, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, className, clearable = false, clearLabel = "All", use }) {
|
|
3533
3596
|
const enumName = enumBindingKey(enumInput) ?? "";
|
|
3534
3597
|
const app = useApp();
|
|
3535
3598
|
const t = useOptionalT();
|
|
3536
3599
|
const def = app.registry.enums.get(enumName);
|
|
3537
3600
|
const caps = useI18nCaps();
|
|
3538
3601
|
const ns = def?.i18nNamespace ?? enumName;
|
|
3539
|
-
const
|
|
3602
|
+
const loaderParams = def !== void 0 && def.values === void 0 && use !== void 0 ? resolveEnumParams(def.params, use.params, use.sources) : void 0;
|
|
3603
|
+
const unsettledParams = loaderParams !== void 0 && loaderParams.status !== "ready";
|
|
3604
|
+
const { values: loadedValues, isLoading, error } = useEnumValues(enumName, loaderParams?.status === "ready" ? loaderParams.params : void 0, { enabled: !unsettledParams });
|
|
3605
|
+
const values = unsettledParams ? NO_VALUES : loadedValues;
|
|
3606
|
+
const available = useAvailableEnumValues({
|
|
3607
|
+
values: isLoading || values === void 0 ? "pending" : values,
|
|
3608
|
+
...def === void 0 ? {} : { enum: def },
|
|
3609
|
+
...use === void 0 ? {} : { use }
|
|
3610
|
+
});
|
|
3540
3611
|
const tid = testid ?? `enum-picker:${enumName}`;
|
|
3541
3612
|
if (!def) return jsxs("span", {
|
|
3542
3613
|
"data-testid": `${tid}:unregistered`,
|
|
@@ -3578,9 +3649,22 @@ function EnumPicker({ enumName: enumInput, value, onChange, control = "select",
|
|
|
3578
3649
|
});
|
|
3579
3650
|
const labelOf = (entry) => resolveEnumLabel(caps, ns, entry.value, enumValueText(def, entry.value) ?? entry.label);
|
|
3580
3651
|
const summaryOf = (entry) => resolveDoc(caps, `enum/${ns}/${entry.value}`)?.summary || void 0;
|
|
3652
|
+
const settling = available.status === "ready" ? void 0 : available.status;
|
|
3653
|
+
const offered = settling === void 0 ? available.values : [];
|
|
3654
|
+
const known = value == null ? void 0 : values.find((entry) => entry.value === value);
|
|
3655
|
+
const current = value == null || value === "" || offered.some((entry) => entry.value === value) ? void 0 : known === void 0 ? {
|
|
3656
|
+
value,
|
|
3657
|
+
label: unknownEnumValueLabel(caps, def, ns, value).label
|
|
3658
|
+
} : {
|
|
3659
|
+
value,
|
|
3660
|
+
label: labelOf(known),
|
|
3661
|
+
...known.icon === void 0 ? {} : { icon: known.icon }
|
|
3662
|
+
};
|
|
3581
3663
|
if (control !== "select") return jsx(EnumChoiceGroup, {
|
|
3582
3664
|
control,
|
|
3583
|
-
|
|
3665
|
+
...current === void 0 ? {} : { current },
|
|
3666
|
+
...settling === void 0 ? {} : { settling },
|
|
3667
|
+
options: offered.map((entry) => ({
|
|
3584
3668
|
value: entry.value,
|
|
3585
3669
|
label: labelOf(entry),
|
|
3586
3670
|
...entry.icon === void 0 ? {} : { icon: entry.icon },
|
|
@@ -3617,28 +3701,43 @@ function EnumPicker({ enumName: enumInput, value, onChange, control = "select",
|
|
|
3617
3701
|
name,
|
|
3618
3702
|
id,
|
|
3619
3703
|
"aria-required": required,
|
|
3704
|
+
"aria-busy": settling === "pending" || void 0,
|
|
3620
3705
|
"aria-invalid": ariaInvalid || void 0,
|
|
3621
3706
|
"aria-describedby": ariaDescribedBy,
|
|
3622
3707
|
...ariaErrorMessage ? { "aria-errormessage": ariaErrorMessage } : {},
|
|
3623
3708
|
className,
|
|
3624
3709
|
children: jsx(SelectValue, { placeholder: placeholder ?? t("field.select", { defaultValue: "Select…" }) })
|
|
3625
|
-
}), jsxs(SelectContent, { children: [
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
"data-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3710
|
+
}), jsxs(SelectContent, { children: [
|
|
3711
|
+
clearable && jsx(SelectItem, {
|
|
3712
|
+
value: "__buro_clear__",
|
|
3713
|
+
"data-testid": `${tid}:option:__clear__`,
|
|
3714
|
+
children: clearLabel
|
|
3715
|
+
}),
|
|
3716
|
+
current === void 0 ? null : jsx(SelectItem, {
|
|
3717
|
+
value: current.value,
|
|
3718
|
+
disabled: true,
|
|
3719
|
+
"data-current": "",
|
|
3720
|
+
"data-testid": `${tid}:current`,
|
|
3721
|
+
children: current.label
|
|
3722
|
+
}),
|
|
3723
|
+
settling === void 0 ? null : jsx(EnumSettlingRow, {
|
|
3724
|
+
status: settling,
|
|
3725
|
+
testid: tid
|
|
3726
|
+
}),
|
|
3727
|
+
offered.map((entry) => {
|
|
3728
|
+
const optionLabel = labelOf(entry);
|
|
3729
|
+
const optionDoc = summaryOf(entry);
|
|
3730
|
+
return jsx(SelectItem, {
|
|
3731
|
+
value: entry.value,
|
|
3732
|
+
"data-testid": `${tid}:option:${entry.value}`,
|
|
3733
|
+
description: optionDoc === void 0 ? void 0 : jsx("span", {
|
|
3734
|
+
"data-testid": `${tid}:option:${entry.value}:doc`,
|
|
3735
|
+
children: optionDoc
|
|
3736
|
+
}),
|
|
3737
|
+
children: optionLabel
|
|
3738
|
+
}, entry.value);
|
|
3739
|
+
})
|
|
3740
|
+
] })]
|
|
3642
3741
|
});
|
|
3643
3742
|
}
|
|
3644
3743
|
//#endregion
|
|
@@ -3688,41 +3787,63 @@ function BooleanInput({ name, id, value, onChange, testid, disabled, required, a
|
|
|
3688
3787
|
}
|
|
3689
3788
|
//#endregion
|
|
3690
3789
|
//#region src/fields/date.tsx
|
|
3691
|
-
function DateDisplay(
|
|
3790
|
+
function DateDisplay(props) {
|
|
3692
3791
|
return jsx(TemporalDisplay, {
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
format: formatDate
|
|
3792
|
+
kind: "date",
|
|
3793
|
+
...props
|
|
3696
3794
|
});
|
|
3697
3795
|
}
|
|
3698
|
-
function DateTimeDisplay(
|
|
3796
|
+
function DateTimeDisplay(props) {
|
|
3699
3797
|
return jsx(TemporalDisplay, {
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3798
|
+
kind: "dateTime",
|
|
3799
|
+
...props
|
|
3800
|
+
});
|
|
3801
|
+
}
|
|
3802
|
+
function TimeDisplay(props) {
|
|
3803
|
+
return jsx(TemporalDisplay, {
|
|
3804
|
+
kind: "time",
|
|
3805
|
+
...props
|
|
3703
3806
|
});
|
|
3704
3807
|
}
|
|
3705
|
-
function
|
|
3808
|
+
function storedText(value) {
|
|
3809
|
+
return value instanceof Date && !Number.isNaN(value.getTime()) ? value.toISOString() : String(value);
|
|
3810
|
+
}
|
|
3811
|
+
function TemporalDisplay({ kind, value, text, field, record }) {
|
|
3706
3812
|
const locale = useOptionalLocale();
|
|
3813
|
+
const zone = useFieldTimeZone(field?.zone, record);
|
|
3814
|
+
const viewer = useTimeZone();
|
|
3707
3815
|
if (value == null || value === "") return jsx("span", {
|
|
3708
3816
|
className: "text-muted-foreground",
|
|
3709
3817
|
children: "—"
|
|
3710
3818
|
});
|
|
3711
|
-
if (
|
|
3712
|
-
|
|
3713
|
-
|
|
3819
|
+
if (zone.status === "pending" || viewer.status === "pending") return jsx(Skeleton, {
|
|
3820
|
+
className: "h-4 w-24",
|
|
3821
|
+
"aria-busy": "true"
|
|
3822
|
+
});
|
|
3823
|
+
const raw = storedText(value);
|
|
3824
|
+
const formatted = formatTimeValue(kind, raw, {
|
|
3825
|
+
zone: zone.zone,
|
|
3826
|
+
viewerZone: viewer.zone,
|
|
3827
|
+
locale: localeTag(locale),
|
|
3828
|
+
params: {
|
|
3829
|
+
...kind === "time" && field?.ui?.seconds === true ? { timeStyle: "medium" } : {},
|
|
3830
|
+
...dateDisplayParams(field?.ui)
|
|
3831
|
+
}
|
|
3832
|
+
});
|
|
3833
|
+
if (text !== void 0) return jsx("span", {
|
|
3834
|
+
title: formatted,
|
|
3835
|
+
children: text
|
|
3836
|
+
});
|
|
3837
|
+
if (formatted === void 0) return jsx("span", { children: raw });
|
|
3714
3838
|
return jsx("span", {
|
|
3715
3839
|
className: "whitespace-nowrap",
|
|
3716
|
-
children:
|
|
3840
|
+
children: formatted
|
|
3717
3841
|
});
|
|
3718
3842
|
}
|
|
3719
3843
|
function toIsoDate(v) {
|
|
3720
3844
|
if (v == null || v === "") return "";
|
|
3721
3845
|
const s = String(v);
|
|
3722
|
-
|
|
3723
|
-
const d = new Date(s);
|
|
3724
|
-
if (Number.isNaN(d.getTime())) return "";
|
|
3725
|
-
return d.toISOString().slice(0, 10);
|
|
3846
|
+
return isCalendarDate(s) ? s : "";
|
|
3726
3847
|
}
|
|
3727
3848
|
function DateInput(props) {
|
|
3728
3849
|
return jsx(TemporalInput, {
|
|
@@ -3733,18 +3854,44 @@ function DateInput(props) {
|
|
|
3733
3854
|
});
|
|
3734
3855
|
}
|
|
3735
3856
|
function DateTimeInput(props) {
|
|
3857
|
+
const locale = useOptionalLocale();
|
|
3858
|
+
const zone = useFieldTimeZone(props.field?.zone, props.values === void 0 ? props.record : {
|
|
3859
|
+
...props.record,
|
|
3860
|
+
...props.values
|
|
3861
|
+
});
|
|
3862
|
+
const viewer = useTimeZone();
|
|
3863
|
+
const pending = zone.status === "pending";
|
|
3864
|
+
const fieldZone = zone.status === "ready" ? zone.zone : void 0;
|
|
3865
|
+
const named = fieldZone !== void 0 && viewer.status === "ready" && fieldZone !== viewer.zone ? zoneShortName(canonicalInstant(String(props.value ?? "")) ?? epochMsToInstant(Date.now()), fieldZone, localeTag(locale)) : void 0;
|
|
3736
3866
|
return jsx(TemporalInput, {
|
|
3737
3867
|
...props,
|
|
3738
3868
|
type: "datetime-local",
|
|
3739
|
-
|
|
3740
|
-
|
|
3869
|
+
disabled: props.disabled || pending,
|
|
3870
|
+
toText: (value) => fieldZone === void 0 ? "" : toLocalDateTimeText(value, fieldZone),
|
|
3871
|
+
fromText: (text) => fieldZone === void 0 ? null : fromLocalDateTimeText(text, fieldZone) ?? null,
|
|
3872
|
+
...named === void 0 ? {} : { zoneName: named }
|
|
3741
3873
|
});
|
|
3742
3874
|
}
|
|
3743
|
-
function
|
|
3744
|
-
|
|
3875
|
+
function TimeInput(props) {
|
|
3876
|
+
const seconds = props.field?.ui?.seconds === true;
|
|
3877
|
+
return jsx(TemporalInput, {
|
|
3878
|
+
...props,
|
|
3879
|
+
type: "time",
|
|
3880
|
+
step: seconds ? 1 : 60,
|
|
3881
|
+
toText: (value) => value == null ? "" : String(value),
|
|
3882
|
+
fromText: (text) => {
|
|
3883
|
+
if (text === "") return null;
|
|
3884
|
+
if (seconds) return text.length === 5 ? `${text}:00` : text;
|
|
3885
|
+
return text.slice(0, 5);
|
|
3886
|
+
}
|
|
3887
|
+
});
|
|
3888
|
+
}
|
|
3889
|
+
function TemporalInput({ type, step, toText, fromText, name, id, value, onChange, testid, disabled, required, ariaInvalid, ariaDescribedBy, ariaErrorMessage, zoneName }) {
|
|
3890
|
+
const input = jsx(Input, {
|
|
3745
3891
|
name,
|
|
3746
3892
|
id,
|
|
3747
3893
|
type,
|
|
3894
|
+
...step === void 0 ? {} : { step },
|
|
3748
3895
|
value: toText(value),
|
|
3749
3896
|
onChange: (e) => onChange(fromText(e.target.value)),
|
|
3750
3897
|
"data-testid": testid,
|
|
@@ -3755,6 +3902,15 @@ function TemporalInput({ type, toText, fromText, name, id, value, onChange, test
|
|
|
3755
3902
|
"aria-describedby": ariaDescribedBy,
|
|
3756
3903
|
...ariaErrorMessage ? { "aria-errormessage": ariaErrorMessage } : {}
|
|
3757
3904
|
});
|
|
3905
|
+
if (zoneName === void 0) return input;
|
|
3906
|
+
return jsxs("div", {
|
|
3907
|
+
className: "flex items-center gap-2",
|
|
3908
|
+
children: [input, jsx("span", {
|
|
3909
|
+
className: "whitespace-nowrap text-xs text-muted-foreground",
|
|
3910
|
+
"data-testid": testid === void 0 ? void 0 : `${testid}:zone`,
|
|
3911
|
+
children: zoneName
|
|
3912
|
+
})]
|
|
3913
|
+
});
|
|
3758
3914
|
}
|
|
3759
3915
|
//#endregion
|
|
3760
3916
|
//#region src/fields/enum.tsx
|
|
@@ -3775,13 +3931,30 @@ function EnumDisplay({ value, options, field, resource }) {
|
|
|
3775
3931
|
}) : null, label]
|
|
3776
3932
|
});
|
|
3777
3933
|
}
|
|
3778
|
-
function EnumInput({ name, id, value, onChange, testid, options, field, placeholder, disabled, required, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, resource }) {
|
|
3934
|
+
function EnumInput({ name, id, value, onChange, testid, options, field, placeholder, disabled, required, ariaInvalid, ariaDescribedBy, ariaErrorMessage, ariaLabelledBy, resource, record, values, metaSources, baseline }) {
|
|
3779
3935
|
const t = useOptionalT();
|
|
3780
3936
|
const caps = useOptionCaps(resource);
|
|
3781
3937
|
const enumDef = useBoundEnum(field);
|
|
3782
3938
|
const ns = enumNamespaceOf(field);
|
|
3783
3939
|
const control = resolveEnumControl(field?.ui?.control, enumDef, `field ${field?.name ?? name}`);
|
|
3784
|
-
const
|
|
3940
|
+
const sources = useFieldMetaSources({
|
|
3941
|
+
record,
|
|
3942
|
+
values,
|
|
3943
|
+
extra: metaSources
|
|
3944
|
+
});
|
|
3945
|
+
const available = useAvailableEnumValues({
|
|
3946
|
+
values: options ?? [],
|
|
3947
|
+
use: {
|
|
3948
|
+
narrow: narrowEntriesOf(field?.meta?.narrow),
|
|
3949
|
+
sources,
|
|
3950
|
+
mode: record === void 0 ? "create" : "edit",
|
|
3951
|
+
baseline: baseline ?? record
|
|
3952
|
+
}
|
|
3953
|
+
});
|
|
3954
|
+
const settling = available.status === "ready" ? void 0 : available.status;
|
|
3955
|
+
const offered = settling === void 0 ? available.values : [];
|
|
3956
|
+
const tid = testid ?? name;
|
|
3957
|
+
const resolved = offered.map((o) => {
|
|
3785
3958
|
const summary = ns === void 0 ? void 0 : resolveDoc(caps, `enum/${ns}/${o.value}`)?.summary;
|
|
3786
3959
|
return {
|
|
3787
3960
|
value: o.value,
|
|
@@ -3790,12 +3963,21 @@ function EnumInput({ name, id, value, onChange, testid, options, field, placehol
|
|
|
3790
3963
|
...summary === void 0 ? {} : { summary }
|
|
3791
3964
|
};
|
|
3792
3965
|
});
|
|
3966
|
+
const raw = value == null || value === "" ? void 0 : String(value);
|
|
3967
|
+
const known = raw === void 0 ? void 0 : options?.find((o) => o.value === raw);
|
|
3968
|
+
const current = raw === void 0 || resolved.some((o) => o.value === raw) ? void 0 : {
|
|
3969
|
+
value: raw,
|
|
3970
|
+
label: resolveOptionLabel(caps, field, raw, known, enumDef),
|
|
3971
|
+
...known?.icon === void 0 ? {} : { icon: known.icon }
|
|
3972
|
+
};
|
|
3793
3973
|
if (control !== "select") return jsx(EnumChoiceGroup, {
|
|
3794
3974
|
control,
|
|
3795
3975
|
options: resolved,
|
|
3976
|
+
...current === void 0 ? {} : { current },
|
|
3977
|
+
...settling === void 0 ? {} : { settling },
|
|
3796
3978
|
value,
|
|
3797
3979
|
onChange,
|
|
3798
|
-
testid:
|
|
3980
|
+
testid: tid,
|
|
3799
3981
|
name,
|
|
3800
3982
|
id,
|
|
3801
3983
|
required,
|
|
@@ -3815,25 +3997,39 @@ function EnumInput({ name, id, value, onChange, testid, options, field, placehol
|
|
|
3815
3997
|
name,
|
|
3816
3998
|
id,
|
|
3817
3999
|
"aria-required": required,
|
|
4000
|
+
"aria-busy": settling === "pending" || void 0,
|
|
3818
4001
|
"aria-invalid": ariaInvalid || void 0,
|
|
3819
4002
|
"aria-describedby": ariaDescribedBy,
|
|
3820
4003
|
...ariaErrorMessage ? { "aria-errormessage": ariaErrorMessage } : {},
|
|
3821
4004
|
children: jsx(SelectValue, { placeholder: placeholder ?? t("field.select", { defaultValue: "Select…" }) })
|
|
3822
|
-
}),
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
"data-
|
|
3827
|
-
|
|
4005
|
+
}), jsxs(SelectContent, { children: [
|
|
4006
|
+
current === void 0 ? null : jsx(SelectItem, {
|
|
4007
|
+
value: current.value,
|
|
4008
|
+
disabled: true,
|
|
4009
|
+
"data-current": "",
|
|
4010
|
+
"data-testid": `${tid}:current`,
|
|
4011
|
+
children: current.label
|
|
3828
4012
|
}),
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
4013
|
+
settling === void 0 ? null : jsx(EnumSettlingRow, {
|
|
4014
|
+
status: settling,
|
|
4015
|
+
testid: tid
|
|
4016
|
+
}),
|
|
4017
|
+
resolved.map((o) => jsx(SelectItem, {
|
|
4018
|
+
value: o.value,
|
|
4019
|
+
"data-testid": testid === void 0 ? void 0 : `${testid}:option:${o.value}`,
|
|
4020
|
+
description: o.summary === void 0 ? void 0 : jsx("span", {
|
|
4021
|
+
"data-testid": testid === void 0 ? void 0 : `${testid}:option:${o.value}:doc`,
|
|
4022
|
+
children: o.summary
|
|
4023
|
+
}),
|
|
4024
|
+
children: jsxs("span", {
|
|
4025
|
+
className: "inline-flex items-center gap-1.5",
|
|
4026
|
+
children: [o.icon ? jsx(Icon, {
|
|
4027
|
+
name: o.icon,
|
|
4028
|
+
className: "size-3.5 shrink-0 text-muted-foreground"
|
|
4029
|
+
}) : null, o.label]
|
|
4030
|
+
})
|
|
4031
|
+
}, o.value))
|
|
4032
|
+
] })]
|
|
3837
4033
|
});
|
|
3838
4034
|
}
|
|
3839
4035
|
//#endregion
|
|
@@ -4254,7 +4450,7 @@ function JsonInput({ name, id, value, onChange, testid, disabled, required, aria
|
|
|
4254
4450
|
}
|
|
4255
4451
|
//#endregion
|
|
4256
4452
|
//#region src/fields/lazy-relation-many.tsx
|
|
4257
|
-
const RelationManyPickerInput = lazy(() => import("./relation-many-picker-
|
|
4453
|
+
const RelationManyPickerInput = lazy(() => import("./relation-many-picker-mGEQDWo2.js").then((module) => ({ default: module.RelationManyPickerInput })));
|
|
4258
4454
|
function LazyRelationManyInput(props) {
|
|
4259
4455
|
return jsx(Suspense, {
|
|
4260
4456
|
fallback: jsx(Skeleton, {
|
|
@@ -4366,6 +4562,144 @@ function NumberInput({ name, id, value, onChange, testid, placeholder, disabled,
|
|
|
4366
4562
|
});
|
|
4367
4563
|
}
|
|
4368
4564
|
//#endregion
|
|
4565
|
+
//#region src/fields/object-group.tsx
|
|
4566
|
+
const GROUP = "rounded-md border border-input p-3";
|
|
4567
|
+
function ObjectGroupInput(props) {
|
|
4568
|
+
const { testIds, accessibility, children } = props;
|
|
4569
|
+
return jsx("div", {
|
|
4570
|
+
role: "group",
|
|
4571
|
+
"data-buro-object-group": "input",
|
|
4572
|
+
className: cn(GROUP, "space-y-3"),
|
|
4573
|
+
"data-testid": testIds.input,
|
|
4574
|
+
id: accessibility.input,
|
|
4575
|
+
"aria-labelledby": accessibility.label,
|
|
4576
|
+
"aria-describedby": accessibility.description,
|
|
4577
|
+
"aria-invalid": props.issues.some((issue) => issue.severity === "error" && issue.path.length === 0) || void 0,
|
|
4578
|
+
"aria-errormessage": accessibility.error,
|
|
4579
|
+
children
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
function ObjectGroupDisplay(props) {
|
|
4583
|
+
const { testIds, children } = props;
|
|
4584
|
+
return jsx("div", {
|
|
4585
|
+
role: "group",
|
|
4586
|
+
"data-buro-object-group": "display",
|
|
4587
|
+
className: cn(GROUP, "space-y-2"),
|
|
4588
|
+
"data-testid": testIds.display,
|
|
4589
|
+
children
|
|
4590
|
+
});
|
|
4591
|
+
}
|
|
4592
|
+
//#endregion
|
|
4593
|
+
//#region src/fields/repeater.tsx
|
|
4594
|
+
function useRepeaterTexts() {
|
|
4595
|
+
const t = useChromeT();
|
|
4596
|
+
return {
|
|
4597
|
+
add: t("field.repeater.add", { defaultValue: "Add" }),
|
|
4598
|
+
empty: t("field.repeater.empty", { defaultValue: "No items yet" }),
|
|
4599
|
+
remove: (position) => t("field.repeater.remove", {
|
|
4600
|
+
params: { position },
|
|
4601
|
+
defaultValue: "Remove item {{position}}"
|
|
4602
|
+
}),
|
|
4603
|
+
moveUp: (position) => t("field.repeater.moveUp", {
|
|
4604
|
+
params: { position },
|
|
4605
|
+
defaultValue: "Move item {{position}} up"
|
|
4606
|
+
}),
|
|
4607
|
+
moveDown: (position) => t("field.repeater.moveDown", {
|
|
4608
|
+
params: { position },
|
|
4609
|
+
defaultValue: "Move item {{position}} down"
|
|
4610
|
+
})
|
|
4611
|
+
};
|
|
4612
|
+
}
|
|
4613
|
+
function RepeaterInput(props) {
|
|
4614
|
+
const texts = useRepeaterTexts();
|
|
4615
|
+
const { value, renderElement, elementKeys, onAdd, onRemove, onMove, testIds, accessibility } = props;
|
|
4616
|
+
const root = testIds.input;
|
|
4617
|
+
const at = (suffix) => root === void 0 ? void 0 : `${root}:${suffix}`;
|
|
4618
|
+
const editable = props.disabled !== true && props.readOnly !== true;
|
|
4619
|
+
const canAdd = editable && onAdd !== void 0 && props.canAdd !== false;
|
|
4620
|
+
const canRemove = editable && onRemove !== void 0 && props.canRemove !== false;
|
|
4621
|
+
const last = value.length - 1;
|
|
4622
|
+
return jsxs("div", {
|
|
4623
|
+
role: "group",
|
|
4624
|
+
className: "space-y-2",
|
|
4625
|
+
"data-testid": root,
|
|
4626
|
+
id: accessibility.input,
|
|
4627
|
+
"aria-labelledby": accessibility.label,
|
|
4628
|
+
"aria-describedby": accessibility.description,
|
|
4629
|
+
"aria-errormessage": accessibility.error,
|
|
4630
|
+
children: [value.length === 0 ? jsx("p", {
|
|
4631
|
+
className: "text-sm text-muted-foreground",
|
|
4632
|
+
"data-testid": at("empty"),
|
|
4633
|
+
children: texts.empty
|
|
4634
|
+
}) : jsx("ol", {
|
|
4635
|
+
className: "space-y-2",
|
|
4636
|
+
children: value.map((_, index) => jsxs("li", {
|
|
4637
|
+
className: "flex items-start gap-2 rounded-md border border-input p-3",
|
|
4638
|
+
"data-testid": at(`item:${index}`),
|
|
4639
|
+
children: [jsx("div", {
|
|
4640
|
+
className: "min-w-0 flex-1",
|
|
4641
|
+
children: renderElement?.(index)
|
|
4642
|
+
}), onMove === void 0 && onRemove === void 0 ? null : jsxs("div", {
|
|
4643
|
+
className: "flex shrink-0 gap-1",
|
|
4644
|
+
children: [onMove === void 0 ? null : jsxs(Fragment$1, { children: [jsx(Button, {
|
|
4645
|
+
type: "button",
|
|
4646
|
+
variant: "ghost",
|
|
4647
|
+
size: "icon",
|
|
4648
|
+
"aria-label": texts.moveUp(index + 1),
|
|
4649
|
+
disabled: !editable || index === 0,
|
|
4650
|
+
"data-testid": at(`up:${index}`),
|
|
4651
|
+
onClick: () => onMove(index, index - 1),
|
|
4652
|
+
children: jsx(IconArrowUp, { "aria-hidden": "true" })
|
|
4653
|
+
}), jsx(Button, {
|
|
4654
|
+
type: "button",
|
|
4655
|
+
variant: "ghost",
|
|
4656
|
+
size: "icon",
|
|
4657
|
+
"aria-label": texts.moveDown(index + 1),
|
|
4658
|
+
disabled: !editable || index === last,
|
|
4659
|
+
"data-testid": at(`down:${index}`),
|
|
4660
|
+
onClick: () => onMove(index, index + 1),
|
|
4661
|
+
children: jsx(IconArrowDown, { "aria-hidden": "true" })
|
|
4662
|
+
})] }), onRemove === void 0 ? null : jsx(Button, {
|
|
4663
|
+
type: "button",
|
|
4664
|
+
variant: "ghost",
|
|
4665
|
+
size: "icon",
|
|
4666
|
+
"aria-label": texts.remove(index + 1),
|
|
4667
|
+
disabled: !canRemove,
|
|
4668
|
+
"data-testid": at(`remove:${index}`),
|
|
4669
|
+
onClick: () => onRemove(index),
|
|
4670
|
+
children: jsx(IconTrash, { "aria-hidden": "true" })
|
|
4671
|
+
})]
|
|
4672
|
+
})]
|
|
4673
|
+
}, elementKeys?.[index] ?? index))
|
|
4674
|
+
}), onAdd === void 0 ? null : jsxs(Button, {
|
|
4675
|
+
type: "button",
|
|
4676
|
+
variant: "outline",
|
|
4677
|
+
size: "sm",
|
|
4678
|
+
disabled: !canAdd,
|
|
4679
|
+
"data-testid": at("add"),
|
|
4680
|
+
onClick: onAdd,
|
|
4681
|
+
children: [jsx(IconPlus, { "aria-hidden": "true" }), texts.add]
|
|
4682
|
+
})]
|
|
4683
|
+
});
|
|
4684
|
+
}
|
|
4685
|
+
function RepeaterDisplay(props) {
|
|
4686
|
+
const texts = useRepeaterTexts();
|
|
4687
|
+
const { value, renderElement, testIds } = props;
|
|
4688
|
+
if (value.length === 0) return jsx("span", {
|
|
4689
|
+
className: "text-muted-foreground",
|
|
4690
|
+
"data-testid": testIds.display,
|
|
4691
|
+
children: texts.empty
|
|
4692
|
+
});
|
|
4693
|
+
return jsx("ol", {
|
|
4694
|
+
className: "space-y-2",
|
|
4695
|
+
"data-testid": testIds.display,
|
|
4696
|
+
children: value.map((_, index) => jsx("li", {
|
|
4697
|
+
className: "rounded-md border border-input p-3",
|
|
4698
|
+
children: renderElement?.(index)
|
|
4699
|
+
}, index))
|
|
4700
|
+
});
|
|
4701
|
+
}
|
|
4702
|
+
//#endregion
|
|
4369
4703
|
//#region src/fields/link-keys-display.tsx
|
|
4370
4704
|
const isRecord$1 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4371
4705
|
function qualify(name) {
|
|
@@ -4695,12 +5029,13 @@ function TextareaInput({ name, id, value, onChange, testid, placeholder, disable
|
|
|
4695
5029
|
//#region src/fields/default-renderers.ts
|
|
4696
5030
|
function legacyField(props) {
|
|
4697
5031
|
const name = optionFieldName(props.path);
|
|
4698
|
-
const texts = props.field
|
|
5032
|
+
const { texts, zone } = props.field;
|
|
4699
5033
|
return Object.freeze({
|
|
4700
5034
|
name,
|
|
4701
5035
|
meta: props.meta,
|
|
4702
5036
|
ui: props.ui,
|
|
4703
|
-
...texts === void 0 ? {} : { texts }
|
|
5037
|
+
...texts === void 0 ? {} : { texts },
|
|
5038
|
+
...zone === void 0 ? {} : { zone }
|
|
4704
5039
|
});
|
|
4705
5040
|
}
|
|
4706
5041
|
function legacyOptions(options, field) {
|
|
@@ -4763,9 +5098,12 @@ function input(renderer) {
|
|
|
4763
5098
|
field: legacyField(props),
|
|
4764
5099
|
resource: props.resource.id,
|
|
4765
5100
|
record: props.record,
|
|
5101
|
+
values: props.form,
|
|
4766
5102
|
relationSeeds: props.relationSeeds,
|
|
4767
5103
|
fixedFilters: props.fixedFilters,
|
|
5104
|
+
optionSubtitle: props.optionSubtitle,
|
|
4768
5105
|
metaSources: props.metaSources,
|
|
5106
|
+
...props.baseline === void 0 ? {} : { baseline: props.baseline },
|
|
4769
5107
|
link: props.link
|
|
4770
5108
|
});
|
|
4771
5109
|
};
|
|
@@ -4818,6 +5156,12 @@ function enumName(ui) {
|
|
|
4818
5156
|
}
|
|
4819
5157
|
function RegistryEnumInput(props) {
|
|
4820
5158
|
const app = useOptionalApp();
|
|
5159
|
+
const meta = props.field.meta;
|
|
5160
|
+
const sources = useFieldMetaSources({
|
|
5161
|
+
record: props.record,
|
|
5162
|
+
values: props.form,
|
|
5163
|
+
extra: props.metaSources
|
|
5164
|
+
});
|
|
4821
5165
|
const control = resolveEnumControl(props.ui.control, app?.registry.enums.get(props.enumName), `field ${typeof props.path.at(-1) === "string" ? String(props.path.at(-1)) : props.enumName}`);
|
|
4822
5166
|
return createElement(EnumPicker, {
|
|
4823
5167
|
enumName: props.enumName,
|
|
@@ -4833,7 +5177,14 @@ function RegistryEnumInput(props) {
|
|
|
4833
5177
|
ariaInvalid: props.issues.some(isErrorIssue),
|
|
4834
5178
|
ariaDescribedBy: props.accessibility.description,
|
|
4835
5179
|
ariaErrorMessage: props.accessibility.error,
|
|
4836
|
-
ariaLabelledBy: props.accessibility.label
|
|
5180
|
+
ariaLabelledBy: props.accessibility.label,
|
|
5181
|
+
use: {
|
|
5182
|
+
params: enumParamsOf(meta?.enumParams),
|
|
5183
|
+
narrow: narrowEntriesOf(meta?.narrow),
|
|
5184
|
+
sources,
|
|
5185
|
+
mode: props.record === void 0 ? "create" : "edit",
|
|
5186
|
+
baseline: props.baseline ?? props.record
|
|
5187
|
+
}
|
|
4837
5188
|
});
|
|
4838
5189
|
}
|
|
4839
5190
|
function enumAware(renderer, layout) {
|
|
@@ -4885,6 +5236,10 @@ const dateTime = {
|
|
|
4885
5236
|
Display: DateTimeDisplay,
|
|
4886
5237
|
Input: DateTimeInput
|
|
4887
5238
|
};
|
|
5239
|
+
const time = {
|
|
5240
|
+
Display: TimeDisplay,
|
|
5241
|
+
Input: TimeInput
|
|
5242
|
+
};
|
|
4888
5243
|
const en = {
|
|
4889
5244
|
Display: EnumDisplay,
|
|
4890
5245
|
Input: EnumInput
|
|
@@ -4923,6 +5278,8 @@ const shadcnFieldImplementations = Object.freeze({
|
|
|
4923
5278
|
dateTime: scalar(dateTime),
|
|
4924
5279
|
"date-time": scalar(dateTime),
|
|
4925
5280
|
"default:date-time": scalar(dateTime),
|
|
5281
|
+
time: scalar(time),
|
|
5282
|
+
"default:time": scalar(time),
|
|
4926
5283
|
enum: enumAware(en),
|
|
4927
5284
|
json: scalar({
|
|
4928
5285
|
Display: JsonDisplay,
|
|
@@ -4936,7 +5293,17 @@ const shadcnFieldImplementations = Object.freeze({
|
|
|
4936
5293
|
richText: scalar(rich, { size: "full" }),
|
|
4937
5294
|
"rich-text": scalar(rich, { size: "full" }),
|
|
4938
5295
|
"default:rich-text": scalar(rich, { size: "full" }),
|
|
4939
|
-
file: scalarOrCollection(file, { size: "full" })
|
|
5296
|
+
file: scalarOrCollection(file, { size: "full" }),
|
|
5297
|
+
object: Object.freeze({
|
|
5298
|
+
Input: ObjectGroupInput,
|
|
5299
|
+
Display: ObjectGroupDisplay,
|
|
5300
|
+
chrome: true
|
|
5301
|
+
}),
|
|
5302
|
+
array: Object.freeze({
|
|
5303
|
+
CollectionInput: RepeaterInput,
|
|
5304
|
+
CollectionDisplay: RepeaterDisplay,
|
|
5305
|
+
chrome: true
|
|
5306
|
+
})
|
|
4940
5307
|
});
|
|
4941
5308
|
//#endregion
|
|
4942
5309
|
//#region src/forms/declarative-display.tsx
|
|
@@ -5166,7 +5533,8 @@ const OPERATOR_LABELS = {
|
|
|
5166
5533
|
has: "has",
|
|
5167
5534
|
hasAny: "has any of",
|
|
5168
5535
|
hasAll: "has all of",
|
|
5169
|
-
hasNone: "has none of"
|
|
5536
|
+
hasNone: "has none of",
|
|
5537
|
+
some: "has an item where"
|
|
5170
5538
|
};
|
|
5171
5539
|
function formatOperatorLabel(op, chromeT) {
|
|
5172
5540
|
return chromeT ? chromeT(`filters.operators.${op}`, { defaultValue: OPERATOR_LABELS[op] }) : OPERATOR_LABELS[op];
|
|
@@ -5700,6 +6068,7 @@ function PeekRecord({ target, testid, row }) {
|
|
|
5700
6068
|
function DeclaredPeekBody({ target, testid, record, frameRecord, def, capabilityFor, fieldVisible, view: View, builtin, open, openable, t }) {
|
|
5701
6069
|
const host = useContext(PeekHostContext);
|
|
5702
6070
|
const title = recordDisplayName(record, def?.displayField);
|
|
6071
|
+
const subtitle = useRecordSubtitle(target)(record) ?? void 0;
|
|
5703
6072
|
const setLabel = host?.setLabel;
|
|
5704
6073
|
useEffect(() => setLabel?.(title), [setLabel, title]);
|
|
5705
6074
|
const controller = useFormController({
|
|
@@ -5735,6 +6104,7 @@ function DeclaredPeekBody({ target, testid, record, frameRecord, def, capability
|
|
|
5735
6104
|
children: [builtin ? jsx(PeekTitle, {
|
|
5736
6105
|
testid,
|
|
5737
6106
|
title,
|
|
6107
|
+
subtitle,
|
|
5738
6108
|
open: openable ? open : void 0
|
|
5739
6109
|
}) : null, jsx(Suspense, {
|
|
5740
6110
|
fallback: null,
|
|
@@ -5747,11 +6117,26 @@ function DeclaredPeekBody({ target, testid, record, frameRecord, def, capability
|
|
|
5747
6117
|
})]
|
|
5748
6118
|
});
|
|
5749
6119
|
}
|
|
5750
|
-
function PeekTitle({ testid, title, open }) {
|
|
5751
|
-
|
|
6120
|
+
function PeekTitle({ testid, title, subtitle, open }) {
|
|
6121
|
+
const heading = open === void 0 ? jsx("p", {
|
|
5752
6122
|
className: "text-sm font-semibold",
|
|
5753
6123
|
children: title
|
|
6124
|
+
}) : jsx(PeekTitleButton, {
|
|
6125
|
+
testid,
|
|
6126
|
+
title,
|
|
6127
|
+
open
|
|
5754
6128
|
});
|
|
6129
|
+
if (subtitle === void 0) return heading;
|
|
6130
|
+
return jsxs("div", {
|
|
6131
|
+
className: "flex flex-col gap-0.5",
|
|
6132
|
+
children: [heading, jsx("p", {
|
|
6133
|
+
"data-testid": `${testid}:subtitle`,
|
|
6134
|
+
className: "text-xs text-muted-foreground",
|
|
6135
|
+
children: subtitle
|
|
6136
|
+
})]
|
|
6137
|
+
});
|
|
6138
|
+
}
|
|
6139
|
+
function PeekTitleButton({ testid, title, open }) {
|
|
5755
6140
|
return jsx("button", {
|
|
5756
6141
|
type: "button",
|
|
5757
6142
|
"data-testid": `${testid}:title`,
|
|
@@ -5779,6 +6164,8 @@ function DefaultPeekBody({ target, testid, row, open }) {
|
|
|
5779
6164
|
const projected = useProjectedRecord(target, dtoRow);
|
|
5780
6165
|
const record = projected.value ?? {};
|
|
5781
6166
|
const title = recordDisplayName(record, def?.displayField);
|
|
6167
|
+
const subtitleOf = useRecordSubtitle(target);
|
|
6168
|
+
const subtitle = projected.status === "ready" ? subtitleOf(record) ?? void 0 : void 0;
|
|
5782
6169
|
const setLabel = host?.setLabel;
|
|
5783
6170
|
useEffect(() => setLabel?.(title), [setLabel, title]);
|
|
5784
6171
|
const columns = useMemo(() => {
|
|
@@ -5810,6 +6197,7 @@ function DefaultPeekBody({ target, testid, row, open }) {
|
|
|
5810
6197
|
children: [jsx(PeekTitle, {
|
|
5811
6198
|
testid,
|
|
5812
6199
|
title,
|
|
6200
|
+
subtitle,
|
|
5813
6201
|
open
|
|
5814
6202
|
}), columns.length === 0 ? null : jsx("dl", {
|
|
5815
6203
|
className: "grid gap-1.5",
|
|
@@ -6504,6 +6892,7 @@ const spacing = {
|
|
|
6504
6892
|
const groupTestId = (role, id) => `command-palette:${role}:${id}`;
|
|
6505
6893
|
function DefaultCommandPalette({ open, onOpenChange, actions, children }) {
|
|
6506
6894
|
const t = useOptionalT();
|
|
6895
|
+
const waiting = useShellWaiting();
|
|
6507
6896
|
const locale = useLocale();
|
|
6508
6897
|
const canSearchRecords = useOptionalDataRuntime() !== null;
|
|
6509
6898
|
const close = () => onOpenChange(false);
|
|
@@ -6542,21 +6931,21 @@ function DefaultCommandPalette({ open, onOpenChange, actions, children }) {
|
|
|
6542
6931
|
locale,
|
|
6543
6932
|
onSelect: close
|
|
6544
6933
|
}),
|
|
6545
|
-
jsx(CommandPaletteRecentGroup, {
|
|
6934
|
+
waiting ? null : jsx(CommandPaletteRecentGroup, {
|
|
6546
6935
|
onSelect: close,
|
|
6547
6936
|
refreshKey: open,
|
|
6548
6937
|
getTestId: groupTestId
|
|
6549
6938
|
}),
|
|
6550
|
-
canSearchRecords ? jsx(CommandPaletteRecordsGroup, {
|
|
6939
|
+
canSearchRecords && !waiting ? jsx(CommandPaletteRecordsGroup, {
|
|
6551
6940
|
enabled: open,
|
|
6552
6941
|
onSelect: close,
|
|
6553
6942
|
getTestId: groupTestId
|
|
6554
6943
|
}) : null,
|
|
6555
|
-
jsx(CommandPaletteNavigationGroups, {
|
|
6944
|
+
waiting ? null : jsx(CommandPaletteNavigationGroups, {
|
|
6556
6945
|
onSelect: close,
|
|
6557
6946
|
getTestId: (role, id) => `command-palette:nav:${role}:${id}`
|
|
6558
6947
|
}),
|
|
6559
|
-
jsx(CommandPaletteCreateGroup, {
|
|
6948
|
+
waiting ? null : jsx(CommandPaletteCreateGroup, {
|
|
6560
6949
|
onSelect: close,
|
|
6561
6950
|
getTestId: groupTestId
|
|
6562
6951
|
}),
|
|
@@ -6572,6 +6961,10 @@ function DefaultCommandPalette({ open, onOpenChange, actions, children }) {
|
|
|
6572
6961
|
//#region src/shell/app-shell.tsx
|
|
6573
6962
|
function AppShell({ brand, user, loginPath, sidebar, header, palette, docPanel, navChrome, children }) {
|
|
6574
6963
|
const enabled = palette !== false;
|
|
6964
|
+
const waiting = useShellWaiting();
|
|
6965
|
+
const decidedOnce = useRef(false);
|
|
6966
|
+
if (!waiting) decidedOnce.current = true;
|
|
6967
|
+
const holding = waiting && !decidedOnce.current;
|
|
6575
6968
|
const { open, setOpen, toggle } = useCommandPalette();
|
|
6576
6969
|
useGlobalShortcut({
|
|
6577
6970
|
key: "k",
|
|
@@ -6594,7 +6987,7 @@ function AppShell({ brand, user, loginPath, sidebar, header, palette, docPanel,
|
|
|
6594
6987
|
sidebar: fill(sidebar, () => jsx(AppSidebar, {})),
|
|
6595
6988
|
header: fill(header, () => jsx(AppHeader, {})),
|
|
6596
6989
|
...docPanel !== void 0 ? { docPanel } : {},
|
|
6597
|
-
children: navChrome === false ? children : jsx(NavChrome, { children })
|
|
6990
|
+
children: holding ? jsx(RecordState, { state: "loading" }) : navChrome === false ? children : jsx(NavChrome, { children })
|
|
6598
6991
|
}), paletteNode]
|
|
6599
6992
|
});
|
|
6600
6993
|
}
|
|
@@ -6702,6 +7095,6 @@ function ScopeSwitcher({ options, value, onChange, label, extra, placeholder })
|
|
|
6702
7095
|
const PACKAGE_NAME = "@burojs/ui-shadcn";
|
|
6703
7096
|
const PACKAGE_VERSION = "0.0.0";
|
|
6704
7097
|
//#endregion
|
|
6705
|
-
export { ActionButton, ActionOverflow, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppActions, AppFlowButton, AppHeader, AppLayout, AppShell, AppSidebar, AuthPage, Avatar, AvatarFallback, AvatarImage, Badge, BooleanDisplay, BooleanInput, BrandMark, Breadcrumbs, BulkActionToolbar, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckConfirmDialog, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColumnsToggle, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandPalette, CommandPaletteActionsGroup, CommandPaletteCreateGroup, CommandPaletteDocsGroup, CommandPaletteNavigationGroups, CommandPaletteRecentGroup, CommandPaletteRecordsGroup, CommandPaletteTrigger, CommandSeparator, ContextPicker, CopyId, CreateButton, CursorLoadMore, DEFAULT_LANGUAGE_STORAGE_KEY, DataTable, DataTableDateRangeFilter, DataTableEnumFilter, DataTableFacetedFilter, DataTableNumRangeFilter, DataTableOperatorFilter, DataTableRowActions, DataTableTextFilter, DataTableToolbar, DataTableViewOptions, DateDisplay, DateInput, DeclarativeDisplay, DeclarativeForm, DefaultCommandPalette, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPresentationHost, DialogPresentationShell, DialogTitle, DialogTrigger, DisabledAction, DocBrowser, DocInfo, DocPanel, DocTrailHelp, DocumentTitleProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENUM_PICKER_CLEAR_SENTINEL, EditPageHeader, EnumBadge, EnumDisplay, EnumInput, EnumPicker, EnumDisplay$1 as EnumValueDisplay, ExportButton, ExportDialog, FacetedFilterPicker, Field, FieldDisplay, FileDisplay, FileField, FileInput, FilterBadges, FilterBuilder, FilterPanel, FilterRegion, FilterValueControl, FlowActionButton, Form, FormActions, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HeaderBreadcrumbs, HelpButton, Icon, Input, Label, LanguageSubmenu, LanguageSwitch, LinkComponentProvider, LinkKeysDisplay, ListBody, ListBulkBar, ListColumns, ListControls, ListCreate, ListErrorState, ListExport, ListFilters, ListFlows, ListLive, ListSavedViews, ListSearchInput, LoginForm, NavAreaPage, NavChrome, NavMain, NavigationGuardDialog, NumberDisplay, NumberInput, PACKAGE_NAME, PACKAGE_VERSION, PageHeader, PinnedFilterControls, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPresentationHost, PopoverTrigger, PresetFilterControls, Progress, RecordActions, RecordBreadcrumbs, RecordPage, RecordScreen, RecordTitle, RefreshButton, RelationDisplay, RelationField, RelationManyDisplay, RelationPicker, LazyRelationPickerDialog as RelationPickerDialog, RelationPickerInput, ResourceList, ResourceListPage, ResourcePageRouter, SavedViewsDropdown, ScopeDimensionPicker, ScopeSwitcher, SecondarySidebarLayout, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetPresentationHost, SheetPresentationShell, SheetTitle, SheetTrigger, ShellProvider, ShowPageHeader, Sidebar, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, THEME_CHOICES, THEME_STORAGE_KEY, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLayout, TabsList, TabsTrigger, TaskRunPanel, TextDisplay, TextInput, Textarea, TextareaDisplay, TextareaInput, ThemeSubmenu, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserMenu, badgeVariants, buildNavItems, buroSortingToTanStack, buttonVariants, cn, defaultNavLayouts, defaultUserMapper, downloadArtifact, formatOperatorLabel, hasIcon, i18nPrefixToRef, isImage, layoutSlot, listSlot, loadLocale, localeLabel, modeForSurface, recordDisplayName, registerIcons, relationLinkClassName, resolveNavIcon, resolveUpdater, saveLocale, shadcnBlockImplementations, shadcnFieldImplementations, shadcnPresentationHosts, spacing, tanStackSortingToBuro, toast, typography, useBuroDataTable, useCurrentUser, useDialogFilterState, useDocumentTitle, useExportRunWatcher, useFormControl, useFormField, useHref, useIsMobile, useLanguagePaletteActions, useLanguageSwitch, useLayout, useLayoutResolver, useLinkComponent, useListSlot, useMatch, useNavIcon, useNavTree, useNavVisible, useOptionalSidebar, usePaletteState, usePresentationCopy, useRelationPicker, useShell, useSidebar, useTheme, useThemePaletteActions, webPlatform, wrapperEnabled };
|
|
7098
|
+
export { ActionButton, ActionOverflow, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppActions, AppFlowButton, AppHeader, AppLayout, AppShell, AppSidebar, AuthPage, Avatar, AvatarFallback, AvatarImage, Badge, BooleanDisplay, BooleanInput, BrandMark, Breadcrumbs, BulkActionToolbar, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckConfirmDialog, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColumnsToggle, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandPalette, CommandPaletteActionsGroup, CommandPaletteCreateGroup, CommandPaletteDocsGroup, CommandPaletteNavigationGroups, CommandPaletteRecentGroup, CommandPaletteRecordsGroup, CommandPaletteTrigger, CommandSeparator, ContextPicker, CopyId, CreateButton, CursorLoadMore, DEFAULT_LANGUAGE_STORAGE_KEY, DataTable, DataTableDateRangeFilter, DataTableEnumFilter, DataTableFacetedFilter, DataTableNumRangeFilter, DataTableOperatorFilter, DataTableRowActions, DataTableTextFilter, DataTableToolbar, DataTableViewOptions, DateDisplay, DateInput, DeclarativeDisplay, DeclarativeForm, DefaultCommandPalette, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPresentationHost, DialogPresentationShell, DialogTitle, DialogTrigger, DisabledAction, DocBrowser, DocInfo, DocPanel, DocTrailHelp, DocumentTitleProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENUM_PICKER_CLEAR_SENTINEL, EditPageHeader, EnumBadge, EnumDisplay, EnumInput, EnumPicker, EnumDisplay$1 as EnumValueDisplay, ExportButton, ExportDialog, FacetedFilterPicker, Field, FieldDisplay, FileDisplay, FileField, FileInput, FilterBadges, FilterBuilder, FilterPanel, FilterRegion, FilterValueControl, FlowActionButton, Form, FormActions, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HeaderBreadcrumbs, HelpButton, Icon, Input, Label, LanguageSubmenu, LanguageSwitch, LinkComponentProvider, LinkKeysDisplay, ListBody, ListBulkBar, ListColumns, ListControls, ListCreate, ListErrorState, ListExport, ListFilters, ListFlows, ListLive, ListSavedViews, ListSearchInput, LoginForm, NavAreaNotFound, NavAreaPage, NavChrome, NavMain, NavigationGuardDialog, NumberDisplay, NumberInput, PACKAGE_NAME, PACKAGE_VERSION, PageHeader, PinnedFilterControls, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPresentationHost, PopoverTrigger, PresetFilterControls, Progress, RecordActions, RecordBreadcrumbs, RecordPage, RecordScreen, RecordTitle, RefreshButton, RelationDisplay, RelationField, RelationManyDisplay, RelationPicker, LazyRelationPickerDialog as RelationPickerDialog, RelationPickerInput, ResourceList, ResourceListPage, ResourcePageRouter, SavedViewsDropdown, ScopeDimensionPicker, ScopeSwitcher, SecondarySidebarLayout, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetPresentationHost, SheetPresentationShell, SheetTitle, SheetTrigger, ShellProvider, ShowPageHeader, Sidebar, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, THEME_CHOICES, THEME_STORAGE_KEY, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLayout, TabsList, TabsTrigger, TaskRunPanel, TextDisplay, TextInput, Textarea, TextareaDisplay, TextareaInput, ThemeSubmenu, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserMenu, badgeVariants, buildNavItems, buroSortingToTanStack, buttonVariants, cn, defaultNavLayouts, defaultUserMapper, downloadArtifact, formatOperatorLabel, hasIcon, i18nPrefixToRef, isImage, layoutSlot, listSlot, loadLocale, localeLabel, modeForSurface, recordDisplayName, registerIcons, relationLinkClassName, resolveNavIcon, resolveUpdater, saveLocale, shadcnBlockImplementations, shadcnFieldImplementations, shadcnPresentationHosts, spacing, tanStackSortingToBuro, toast, typography, useBuroDataTable, useCurrentUser, useDialogFilterState, useDocumentTitle, useExportRunWatcher, useFormControl, useFormField, useHref, useIsMobile, useLanguagePaletteActions, useLanguageSwitch, useLayout, useLayoutResolver, useLinkComponent, useListSlot, useMatch, useNavIcon, useNavTree, useNavVisible, useOptionalSidebar, usePaletteState, usePresentationCopy, useRelationPicker, useShell, useSidebar, useTheme, useThemePaletteActions, webPlatform, wrapperEnabled };
|
|
6706
7099
|
|
|
6707
7100
|
//# sourceMappingURL=index.js.map
|