@nivaro/react 0.2.53 → 0.2.54
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +113 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +4058 -3942
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { jsx as e, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import
|
|
6
|
-
import { fieldDrilldownConfig as
|
|
7
|
-
import { get as
|
|
8
|
-
import { useRecordReader as
|
|
9
|
-
import { choiceLabel as
|
|
10
|
-
import { DesignDropZone as
|
|
11
|
-
import { useLayoutDesign as
|
|
12
|
-
import { UserAvatar as
|
|
13
|
-
import { DropdownMenu as
|
|
14
|
-
import { WidgetSlot as
|
|
15
|
-
import { FieldRow as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
2
|
+
import { useQuery as ie, useQueryClient as ct } from "@tanstack/react-query";
|
|
3
|
+
import * as dt from "lucide-react";
|
|
4
|
+
import { ChevronDown as ut, Loader2 as mt, User as pt, Mail as ft } from "lucide-react";
|
|
5
|
+
import Ae, { useState as Z, useRef as pe, useEffect as fe } from "react";
|
|
6
|
+
import { fieldDrilldownConfig as ht, useDrilldown as bt, useOptionalNivaroClient as se, useNavigation as gt } from "../../context.js";
|
|
7
|
+
import { get as Ee, post as xt } from "../../lib/commands.js";
|
|
8
|
+
import { useRecordReader as Ye } from "../../lib/record-loader.js";
|
|
9
|
+
import { choiceLabel as yt, titleCase as Qe, cn as re } from "../../lib/utils.js";
|
|
10
|
+
import { DesignDropZone as Nt, designWrap as _t } from "../layout-editor/DesignNode.js";
|
|
11
|
+
import { useLayoutDesign as wt, revealGroupKey as vt } from "../layout-editor/design-context.js";
|
|
12
|
+
import { UserAvatar as St } from "../UserAvatar.js";
|
|
13
|
+
import { DropdownMenu as kt, DropdownMenuTrigger as Dt, DropdownMenuContent as $t, DropdownMenuItem as Je } from "../ui/dropdown-menu.js";
|
|
14
|
+
import { WidgetSlot as Pe } from "../WidgetSlot.js";
|
|
15
|
+
import { FieldRow as Ve } from "./FieldRow.js";
|
|
16
|
+
import { useFormHelpVideos as Ft, FormHelpVideoButton as jt } from "./FormHelpVideoButton.js";
|
|
17
|
+
import { applyDisplayTemplate as Ot, useContainerWidth as Lt, resolveColSpan as Ce } from "./helpers.js";
|
|
18
|
+
import { SectionIntro as Bt } from "./LayoutContentBlock.js";
|
|
19
|
+
import { UserChip as Ze, OwnersInline as Ke, OwnersInlineCompact as qt } from "./UserChip.js";
|
|
20
|
+
import { UserRosterCluster as on } from "./UserChip.js";
|
|
21
|
+
function Re(t) {
|
|
20
22
|
if (typeof t != "string") return t ?? [];
|
|
21
23
|
try {
|
|
22
24
|
return JSON.parse(t);
|
|
@@ -24,29 +26,29 @@ function Te(t) {
|
|
|
24
26
|
return [];
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
|
-
function
|
|
29
|
+
function It({
|
|
28
30
|
relCollection: t,
|
|
29
31
|
relId: r,
|
|
30
32
|
entries: i,
|
|
31
33
|
separator: u
|
|
32
34
|
}) {
|
|
33
|
-
const
|
|
35
|
+
const s = se(), l = Ye(), n = String(r), p = i.some((b) => b.field.includes(".")) ? ["id", ...i.map((b) => b.field)].join(",") : null, { data: h } = ie({
|
|
34
36
|
queryKey: ["inline-display", t, n, p],
|
|
35
|
-
queryFn: () =>
|
|
36
|
-
enabled: !!
|
|
37
|
+
queryFn: () => l(t, n, p),
|
|
38
|
+
enabled: !!s && !!n,
|
|
37
39
|
staleTime: 6e4
|
|
38
40
|
});
|
|
39
|
-
if (!
|
|
40
|
-
const v = (
|
|
41
|
-
let
|
|
42
|
-
for (const g of
|
|
43
|
-
if (
|
|
44
|
-
|
|
41
|
+
if (!h) return null;
|
|
42
|
+
const v = (b) => {
|
|
43
|
+
let f = h;
|
|
44
|
+
for (const g of b.split(".")) {
|
|
45
|
+
if (f == null || typeof f != "object") return;
|
|
46
|
+
f = f[g];
|
|
45
47
|
}
|
|
46
|
-
return
|
|
48
|
+
return f;
|
|
47
49
|
};
|
|
48
50
|
if (u != null) {
|
|
49
|
-
const
|
|
51
|
+
const b = ($) => {
|
|
50
52
|
const _ = v($.field);
|
|
51
53
|
if (_ == null || _ === "") return null;
|
|
52
54
|
const w = $.format ?? "text";
|
|
@@ -57,22 +59,22 @@ function _t({
|
|
|
57
59
|
return String(_);
|
|
58
60
|
}
|
|
59
61
|
return w === "boolean" ? _ ? "Yes" : "No" : String(_);
|
|
60
|
-
},
|
|
62
|
+
}, f = [];
|
|
61
63
|
let g = [];
|
|
62
64
|
for (const $ of i)
|
|
63
|
-
$.line_break && g.length > 0 ? (
|
|
64
|
-
g.length > 0 &&
|
|
65
|
-
const
|
|
65
|
+
$.line_break && g.length > 0 ? (f.push(g), g = [$]) : g.push($);
|
|
66
|
+
g.length > 0 && f.push(g);
|
|
67
|
+
const O = f.map(
|
|
66
68
|
($) => $.map((_) => {
|
|
67
|
-
const w =
|
|
69
|
+
const w = b(_);
|
|
68
70
|
return w ? { label: _.label ?? null, display: w } : null;
|
|
69
71
|
}).filter(Boolean)
|
|
70
72
|
).filter(($) => $.length > 0);
|
|
71
|
-
return
|
|
73
|
+
return O.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: O.map(($, _) => (
|
|
72
74
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
73
75
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: $.map((w, P) => (
|
|
74
76
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
75
|
-
/* @__PURE__ */ N(
|
|
77
|
+
/* @__PURE__ */ N(Ae.Fragment, { children: [
|
|
76
78
|
P > 0 && u,
|
|
77
79
|
w.label && /* @__PURE__ */ N("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
78
80
|
w.label,
|
|
@@ -84,34 +86,34 @@ function _t({
|
|
|
84
86
|
)) }, _)
|
|
85
87
|
)) });
|
|
86
88
|
}
|
|
87
|
-
const c = i.map((
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const g =
|
|
91
|
-
let
|
|
89
|
+
const c = i.map((b) => {
|
|
90
|
+
const f = v(b.field);
|
|
91
|
+
if (f == null || f === "") return null;
|
|
92
|
+
const g = b.format ?? "text";
|
|
93
|
+
let O;
|
|
92
94
|
if (g === "date" || g === "datetime")
|
|
93
95
|
try {
|
|
94
|
-
|
|
96
|
+
O = new Date(String(f)).toLocaleDateString();
|
|
95
97
|
} catch {
|
|
96
|
-
|
|
98
|
+
O = String(f);
|
|
97
99
|
}
|
|
98
|
-
else g === "boolean" ?
|
|
99
|
-
return { label:
|
|
100
|
+
else g === "boolean" ? O = f ? "Yes" : "No" : O = String(f);
|
|
101
|
+
return { label: b.label, display: O };
|
|
100
102
|
}).filter(Boolean);
|
|
101
|
-
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1 rounded border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800/50 px-3 py-1.5 space-y-0.5", children: c.map((
|
|
103
|
+
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1 rounded border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800/50 px-3 py-1.5 space-y-0.5", children: c.map((b, f) => (
|
|
102
104
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
103
105
|
/* @__PURE__ */ N("div", { className: "flex items-baseline gap-2", children: [
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children:
|
|
106
|
-
] },
|
|
106
|
+
b.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: b.label }),
|
|
107
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children: b.display })
|
|
108
|
+
] }, f)
|
|
107
109
|
)) });
|
|
108
110
|
}
|
|
109
|
-
function
|
|
111
|
+
function Ut(t) {
|
|
110
112
|
if (!t) return null;
|
|
111
|
-
const r = t.replace(/(^|-)([a-z])/g, (u,
|
|
113
|
+
const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i = dt[r];
|
|
112
114
|
return i || null;
|
|
113
115
|
}
|
|
114
|
-
function
|
|
116
|
+
function ze(t) {
|
|
115
117
|
if (!t.options) return {};
|
|
116
118
|
if (typeof t.options == "object") return t.options;
|
|
117
119
|
try {
|
|
@@ -120,7 +122,7 @@ function qe(t) {
|
|
|
120
122
|
return {};
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
|
-
function
|
|
125
|
+
function he(t, r) {
|
|
124
126
|
if (t == null || t === "") return "—";
|
|
125
127
|
if (typeof t == "boolean") return t ? "Yes" : "No";
|
|
126
128
|
const i = (r == null ? void 0 : r.interface) ?? "", u = (() => {
|
|
@@ -174,75 +176,75 @@ function de(t, r) {
|
|
|
174
176
|
return String(t);
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
|
-
const
|
|
178
|
-
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(
|
|
179
|
+
const s = String(t);
|
|
180
|
+
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(s) || /^\d{4}-\d{2}-\d{2}$/.test(s))
|
|
179
181
|
try {
|
|
180
|
-
let n = /^\d{4}-\d{2}-\d{2}$/.test(
|
|
182
|
+
let n = /^\d{4}-\d{2}-\d{2}$/.test(s) || i === "date";
|
|
181
183
|
if (!n && (r != null && r.options))
|
|
182
184
|
try {
|
|
183
185
|
const p = typeof r.options == "string" ? JSON.parse(r.options) : r.options;
|
|
184
186
|
p && p.date_mode === "date" && (n = !0);
|
|
185
187
|
} catch {
|
|
186
188
|
}
|
|
187
|
-
const o =
|
|
188
|
-
return o ? new Date(Number(o[1]), Number(o[2]) - 1, Number(o[3])).toLocaleDateString() : n ? new Date(
|
|
189
|
+
const o = s.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
190
|
+
return o ? new Date(Number(o[1]), Number(o[2]) - 1, Number(o[3])).toLocaleDateString() : n ? new Date(s).toLocaleDateString() : new Date(s).toLocaleString();
|
|
189
191
|
} catch {
|
|
190
192
|
}
|
|
191
193
|
if ((i === "select-dropdown" || i === "radio-buttons") && r) {
|
|
192
|
-
const o =
|
|
194
|
+
const o = ze(r).choices;
|
|
193
195
|
if (Array.isArray(o)) {
|
|
194
|
-
const p = o.find((
|
|
195
|
-
if (p) return
|
|
196
|
+
const p = o.find((h) => String(h.value) === s);
|
|
197
|
+
if (p) return yt(p.text);
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
|
-
const
|
|
199
|
-
if (!Number.isNaN(
|
|
200
|
-
const n =
|
|
200
|
+
const l = Number(s);
|
|
201
|
+
if (!Number.isNaN(l) && s !== "" && r) {
|
|
202
|
+
const n = ze(r), o = n.format, p = typeof n.unit == "string" ? n.unit.trim() : "";
|
|
201
203
|
if (p && !o) {
|
|
202
|
-
const
|
|
204
|
+
const h = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(l);
|
|
203
205
|
if (p === "$")
|
|
204
206
|
try {
|
|
205
207
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(
|
|
206
|
-
|
|
208
|
+
l
|
|
207
209
|
);
|
|
208
210
|
} catch {
|
|
209
|
-
return `$${
|
|
211
|
+
return `$${h}`;
|
|
210
212
|
}
|
|
211
|
-
return p === "%" ? `${
|
|
213
|
+
return p === "%" ? `${h}%` : `${h} ${p}`;
|
|
212
214
|
}
|
|
213
215
|
if (o === "currency")
|
|
214
216
|
try {
|
|
215
217
|
return new Intl.NumberFormat(void 0, {
|
|
216
218
|
style: "currency",
|
|
217
219
|
currency: n.currency || "USD"
|
|
218
|
-
}).format(
|
|
220
|
+
}).format(l);
|
|
219
221
|
} catch {
|
|
220
222
|
}
|
|
221
223
|
if (o === "int")
|
|
222
|
-
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(
|
|
224
|
+
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(l);
|
|
223
225
|
if (o === "decimal") {
|
|
224
|
-
const
|
|
226
|
+
const h = typeof n.precision == "number" ? n.precision : 2;
|
|
225
227
|
return new Intl.NumberFormat(void 0, {
|
|
226
|
-
minimumFractionDigits:
|
|
227
|
-
maximumFractionDigits:
|
|
228
|
-
}).format(
|
|
228
|
+
minimumFractionDigits: h,
|
|
229
|
+
maximumFractionDigits: h
|
|
230
|
+
}).format(l);
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
|
-
return !
|
|
233
|
+
return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ? Qe(s) : s;
|
|
232
234
|
}
|
|
233
|
-
function
|
|
234
|
-
const r =
|
|
235
|
+
function Ge({ userId: t }) {
|
|
236
|
+
const r = se(), { navigate: i, userUrl: u } = gt(), s = u ? u(t) : `/users/${t}`, { data: l } = ie({
|
|
235
237
|
queryKey: ["user-chip", t],
|
|
236
238
|
queryFn: () => r.request(
|
|
237
|
-
|
|
239
|
+
Ee(`/users/${t}`)
|
|
238
240
|
).then((p) => p.data ?? null),
|
|
239
241
|
enabled: !!r && !!t,
|
|
240
242
|
staleTime: 12e4
|
|
241
|
-
}), n =
|
|
242
|
-
return /* @__PURE__ */ N(
|
|
243
|
-
/* @__PURE__ */ e(
|
|
243
|
+
}), n = l ? [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email : t, o = n.split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
244
|
+
return /* @__PURE__ */ N(kt, { children: [
|
|
245
|
+
/* @__PURE__ */ e(Dt, { asChild: !0, children: /* @__PURE__ */ N("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 py-px pl-0.5 pr-2 hover:bg-slate-200 transition-colors", children: [
|
|
244
246
|
/* @__PURE__ */ e(
|
|
245
|
-
|
|
247
|
+
St,
|
|
246
248
|
{
|
|
247
249
|
userId: t,
|
|
248
250
|
className: "h-4 w-4",
|
|
@@ -251,27 +253,27 @@ function Me({ userId: t }) {
|
|
|
251
253
|
),
|
|
252
254
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: n })
|
|
253
255
|
] }) }),
|
|
254
|
-
/* @__PURE__ */ N(
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
/* @__PURE__ */ N($t, { align: "start", className: "text-[12px]", children: [
|
|
257
|
+
s && /* @__PURE__ */ N(
|
|
258
|
+
Je,
|
|
257
259
|
{
|
|
258
260
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
259
|
-
onSelect: () => i(
|
|
261
|
+
onSelect: () => i(s),
|
|
260
262
|
children: [
|
|
261
|
-
/* @__PURE__ */ e(
|
|
263
|
+
/* @__PURE__ */ e(pt, { className: "h-3.5 w-3.5" }),
|
|
262
264
|
" View profile"
|
|
263
265
|
]
|
|
264
266
|
}
|
|
265
267
|
),
|
|
266
|
-
(
|
|
267
|
-
|
|
268
|
+
(l == null ? void 0 : l.email) && /* @__PURE__ */ N(
|
|
269
|
+
Je,
|
|
268
270
|
{
|
|
269
271
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
270
272
|
onSelect: () => {
|
|
271
|
-
window.location.href = `mailto:${
|
|
273
|
+
window.location.href = `mailto:${l.email}`;
|
|
272
274
|
},
|
|
273
275
|
children: [
|
|
274
|
-
/* @__PURE__ */ e(
|
|
276
|
+
/* @__PURE__ */ e(ft, { className: "h-3.5 w-3.5" }),
|
|
275
277
|
" Send email"
|
|
276
278
|
]
|
|
277
279
|
}
|
|
@@ -279,29 +281,29 @@ function Me({ userId: t }) {
|
|
|
279
281
|
] })
|
|
280
282
|
] });
|
|
281
283
|
}
|
|
282
|
-
function
|
|
284
|
+
function Tt({
|
|
283
285
|
collection: t,
|
|
284
286
|
itemId: r,
|
|
285
287
|
layoutId: i,
|
|
286
288
|
attachField: u,
|
|
287
|
-
filenameTemplate:
|
|
288
|
-
label:
|
|
289
|
+
filenameTemplate: s,
|
|
290
|
+
label: l
|
|
289
291
|
}) {
|
|
290
|
-
const n =
|
|
292
|
+
const n = se(), o = ct(), [p, h] = Z(!1), v = async () => {
|
|
291
293
|
if (!(!n || p || !u)) {
|
|
292
|
-
|
|
294
|
+
h(!0);
|
|
293
295
|
try {
|
|
294
296
|
await n.request(
|
|
295
|
-
|
|
297
|
+
xt(`/collection-layouts/${i}/generate-and-attach`, {
|
|
296
298
|
collection: t,
|
|
297
299
|
item_id: r,
|
|
298
300
|
attach_field: u,
|
|
299
|
-
filename_template:
|
|
301
|
+
filename_template: s ?? void 0
|
|
300
302
|
})
|
|
301
303
|
), o.invalidateQueries({ queryKey: ["m2m-items"] }), o.invalidateQueries({ queryKey: ["items", t, r] });
|
|
302
304
|
} catch {
|
|
303
305
|
} finally {
|
|
304
|
-
|
|
306
|
+
h(!1);
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
}, c = !u;
|
|
@@ -331,48 +333,48 @@ function vt({
|
|
|
331
333
|
]
|
|
332
334
|
}
|
|
333
335
|
),
|
|
334
|
-
p ? "Generating…" :
|
|
336
|
+
p ? "Generating…" : l
|
|
335
337
|
]
|
|
336
338
|
}
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
|
-
function
|
|
341
|
+
function X({
|
|
340
342
|
relCollection: t,
|
|
341
343
|
id: r,
|
|
342
344
|
className: i
|
|
343
345
|
}) {
|
|
344
|
-
var
|
|
345
|
-
const u =
|
|
346
|
+
var f;
|
|
347
|
+
const u = se(), s = Ye(), l = r != null && r !== "" ? String(r) : null, { data: n } = ie({
|
|
346
348
|
queryKey: ["col-meta-dt", t],
|
|
347
349
|
queryFn: () => u.request(
|
|
348
|
-
|
|
350
|
+
Ee(`/collections/${t}`)
|
|
349
351
|
).then((g) => g.data).catch(() => ({})),
|
|
350
|
-
enabled: !!u && !!
|
|
352
|
+
enabled: !!u && !!l,
|
|
351
353
|
staleTime: 3e5
|
|
352
|
-
}), o = (((
|
|
353
|
-
queryKey: ["rel-display", t,
|
|
354
|
-
queryFn: () =>
|
|
355
|
-
enabled: !!u && !!
|
|
354
|
+
}), o = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((g) => g.replace(/[{}\s]/g, "")).filter((g) => g.includes(".")), p = o.length ? ["id", ...o].join(",") : null, { data: h, isLoading: v } = ie({
|
|
355
|
+
queryKey: ["rel-display", t, l, p],
|
|
356
|
+
queryFn: () => s(t, l, p),
|
|
357
|
+
enabled: !!u && !!l && n !== void 0,
|
|
356
358
|
staleTime: 6e4
|
|
357
359
|
});
|
|
358
|
-
if (!
|
|
360
|
+
if (!l) return /* @__PURE__ */ e("span", { children: "—" });
|
|
359
361
|
if (v || u && n === void 0)
|
|
360
362
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
361
363
|
const c = i ?? "text-[13px] text-slate-700";
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
return /* @__PURE__ */ e("span", { className: c, children:
|
|
364
|
+
if (!h) return /* @__PURE__ */ e("span", { className: c, children: l });
|
|
365
|
+
const b = n != null && n.display_template ? Ot(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
|
|
366
|
+
return /* @__PURE__ */ e("span", { className: c, children: b });
|
|
365
367
|
}
|
|
366
|
-
function
|
|
367
|
-
return /* @__PURE__ */ e(
|
|
368
|
+
function He({ userId: t }) {
|
|
369
|
+
return /* @__PURE__ */ e(Ze, { userId: t, size: "compact" });
|
|
368
370
|
}
|
|
369
|
-
function
|
|
371
|
+
function We({
|
|
370
372
|
relCollection: t,
|
|
371
373
|
id: r,
|
|
372
374
|
drillConfig: i
|
|
373
375
|
}) {
|
|
374
|
-
const u =
|
|
375
|
-
return !u || r == null || r === "" ?
|
|
376
|
+
const u = bt(), s = /* @__PURE__ */ e(X, { relCollection: t, id: r });
|
|
377
|
+
return !u || r == null || r === "" ? s : /* @__PURE__ */ e(
|
|
376
378
|
"button",
|
|
377
379
|
{
|
|
378
380
|
type: "button",
|
|
@@ -388,7 +390,7 @@ function Pe({
|
|
|
388
390
|
},
|
|
389
391
|
className: "group/drill cursor-pointer text-left transition-colors",
|
|
390
392
|
children: /* @__PURE__ */ e(
|
|
391
|
-
|
|
393
|
+
X,
|
|
392
394
|
{
|
|
393
395
|
relCollection: t,
|
|
394
396
|
id: r,
|
|
@@ -398,41 +400,41 @@ function Pe({
|
|
|
398
400
|
}
|
|
399
401
|
);
|
|
400
402
|
}
|
|
401
|
-
function
|
|
402
|
-
const [r, i] =
|
|
403
|
-
return
|
|
404
|
-
const
|
|
403
|
+
function Mt(t) {
|
|
404
|
+
const [r, i] = Z(!1), u = pe(!0), s = pe(JSON.stringify(t ?? null));
|
|
405
|
+
return fe(() => {
|
|
406
|
+
const l = JSON.stringify(t ?? null);
|
|
405
407
|
if (u.current) {
|
|
406
|
-
u.current = !1,
|
|
408
|
+
u.current = !1, s.current = l;
|
|
407
409
|
return;
|
|
408
410
|
}
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
+
if (l === s.current) return;
|
|
412
|
+
s.current = l, i(!1);
|
|
411
413
|
const n = window.setTimeout(() => i(!0), 0), o = window.setTimeout(() => i(!1), 1200);
|
|
412
414
|
return () => {
|
|
413
415
|
window.clearTimeout(n), window.clearTimeout(o);
|
|
414
416
|
};
|
|
415
417
|
}, [t]), r ? "nvr-value-pulse" : "";
|
|
416
418
|
}
|
|
417
|
-
function
|
|
419
|
+
function rn({
|
|
418
420
|
field: t,
|
|
419
421
|
val: r,
|
|
420
422
|
relations: i,
|
|
421
423
|
collection: u,
|
|
422
|
-
displayFormat:
|
|
423
|
-
textClassName:
|
|
424
|
+
displayFormat: s,
|
|
425
|
+
textClassName: l
|
|
424
426
|
}) {
|
|
425
|
-
const n =
|
|
427
|
+
const n = Mt(r), o = re(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), p = ht(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
|
|
426
428
|
(c) => c.one_collection === u && c.one_field === t.field && c.junction_field
|
|
427
429
|
);
|
|
428
|
-
if (
|
|
430
|
+
if (h) {
|
|
429
431
|
const c = i.find(
|
|
430
|
-
(g) => g.many_collection ===
|
|
431
|
-
),
|
|
432
|
-
return !
|
|
433
|
-
|
|
432
|
+
(g) => g.many_collection === h.many_collection && g.many_field === h.junction_field
|
|
433
|
+
), b = c == null ? void 0 : c.one_collection, f = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
434
|
+
return !b || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : b === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((g) => /* @__PURE__ */ e(He, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((g) => /* @__PURE__ */ e(
|
|
435
|
+
We,
|
|
434
436
|
{
|
|
435
|
-
relCollection:
|
|
437
|
+
relCollection: b,
|
|
436
438
|
id: g,
|
|
437
439
|
drillConfig: p
|
|
438
440
|
},
|
|
@@ -444,134 +446,134 @@ function zt({
|
|
|
444
446
|
);
|
|
445
447
|
if (v != null && v.one_collection) {
|
|
446
448
|
const c = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
447
|
-
return c.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : v.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: c.map((
|
|
448
|
-
|
|
449
|
+
return c.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : v.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: c.map((b) => /* @__PURE__ */ e(He, { userId: String(b) }, String(b))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: c.map((b) => /* @__PURE__ */ e(
|
|
450
|
+
We,
|
|
449
451
|
{
|
|
450
452
|
relCollection: v.one_collection,
|
|
451
|
-
id:
|
|
453
|
+
id: b,
|
|
452
454
|
drillConfig: p
|
|
453
455
|
},
|
|
454
|
-
String(
|
|
456
|
+
String(b)
|
|
455
457
|
)) });
|
|
456
458
|
}
|
|
457
459
|
if (r == null || r === "")
|
|
458
460
|
return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" });
|
|
459
|
-
if (
|
|
461
|
+
if (s && s !== "text") {
|
|
460
462
|
const c = Number(r);
|
|
461
|
-
if (
|
|
463
|
+
if (s === "currency" && !isNaN(c))
|
|
462
464
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Intl.NumberFormat(void 0, {
|
|
463
465
|
style: "currency",
|
|
464
466
|
currency: "USD",
|
|
465
467
|
minimumFractionDigits: 2
|
|
466
468
|
}).format(c) });
|
|
467
|
-
if (
|
|
469
|
+
if (s === "integer" && !isNaN(c))
|
|
468
470
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(Math.round(c)) });
|
|
469
|
-
if (
|
|
471
|
+
if (s === "decimal" && !isNaN(c))
|
|
470
472
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(c) });
|
|
471
|
-
if (
|
|
473
|
+
if (s === "percent" && !isNaN(c))
|
|
472
474
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Intl.NumberFormat(void 0, { style: "percent", maximumFractionDigits: 1 }).format(
|
|
473
475
|
c / 100
|
|
474
476
|
) });
|
|
475
|
-
if (
|
|
477
|
+
if (s === "date")
|
|
476
478
|
try {
|
|
477
479
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Date(String(r)).toLocaleDateString() });
|
|
478
480
|
} catch {
|
|
479
481
|
}
|
|
480
|
-
if (
|
|
482
|
+
if (s === "datetime")
|
|
481
483
|
try {
|
|
482
484
|
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: new Date(String(r)).toLocaleString() });
|
|
483
485
|
} catch {
|
|
484
486
|
}
|
|
485
487
|
}
|
|
486
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children:
|
|
488
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${o}`, children: he(r, t) });
|
|
487
489
|
}
|
|
488
|
-
function
|
|
490
|
+
function Jt({
|
|
489
491
|
summaryFields: t,
|
|
490
492
|
fields: r,
|
|
491
493
|
draft: i,
|
|
492
494
|
relations: u,
|
|
493
|
-
collection:
|
|
494
|
-
itemId:
|
|
495
|
+
collection: s,
|
|
496
|
+
itemId: l,
|
|
495
497
|
ownersCollection: n,
|
|
496
498
|
ownersItemId: o,
|
|
497
499
|
ownersAssignment: p,
|
|
498
|
-
m2mCounts:
|
|
500
|
+
m2mCounts: h,
|
|
499
501
|
o2mCounts: v,
|
|
500
502
|
o2mAggValues: c,
|
|
501
|
-
summaryAggConfigs:
|
|
502
|
-
o2mLoading:
|
|
503
|
+
summaryAggConfigs: b,
|
|
504
|
+
o2mLoading: f,
|
|
503
505
|
hideEmpty: g
|
|
504
506
|
}) {
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
if (
|
|
508
|
-
if (v &&
|
|
509
|
-
const
|
|
510
|
-
return
|
|
511
|
-
}) :
|
|
507
|
+
const O = t.map((x) => typeof x == "string" ? x : x.field), $ = g ? O.filter((x) => {
|
|
508
|
+
if (x === "__owners__" || f != null && f.has(x) || c && x in c) return !0;
|
|
509
|
+
if (h && x in h) return (h[x] ?? 0) > 0;
|
|
510
|
+
if (v && x in v) return (v[x] ?? 0) > 0;
|
|
511
|
+
const q = i[x];
|
|
512
|
+
return q != null && q !== "" && !(Array.isArray(q) && q.length === 0);
|
|
513
|
+
}) : O;
|
|
512
514
|
if ($.length === 0) return null;
|
|
513
|
-
const _ = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", w = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", P = "text-[12px] text-slate-300 dark:text-slate-600",
|
|
514
|
-
if (
|
|
515
|
+
const _ = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", w = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", P = "text-[12px] text-slate-300 dark:text-slate-600", V = "flex items-baseline gap-1.5", le = (x) => {
|
|
516
|
+
if (x === "__owners__") {
|
|
515
517
|
const d = (p == null ? void 0 : p.label_override) || "Owners";
|
|
516
518
|
return /* @__PURE__ */ N("div", { className: "flex items-center gap-1.5", children: [
|
|
517
519
|
/* @__PURE__ */ e("span", { className: _, children: d }),
|
|
518
520
|
/* @__PURE__ */ e(
|
|
519
|
-
|
|
521
|
+
qt,
|
|
520
522
|
{
|
|
521
|
-
collection: n ??
|
|
522
|
-
itemId: o ??
|
|
523
|
+
collection: n ?? s,
|
|
524
|
+
itemId: o ?? l
|
|
523
525
|
}
|
|
524
526
|
)
|
|
525
527
|
] });
|
|
526
528
|
}
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
529
|
+
const q = t.find((d) => (typeof d == "string" ? d : d.field) === x), ee = q && typeof q != "string" ? q.label : void 0, R = r.find((d) => d.field === x), I = ee || (R == null ? void 0 : R.label) || x.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
|
|
530
|
+
if (f != null && f.has(x))
|
|
529
531
|
return /* @__PURE__ */ N("div", { className: "flex items-center gap-1.5", children: [
|
|
530
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
531
|
-
/* @__PURE__ */ e(
|
|
532
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
533
|
+
/* @__PURE__ */ e(mt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
532
534
|
] });
|
|
533
|
-
if (c &&
|
|
534
|
-
const d =
|
|
535
|
+
if (c && x in c) {
|
|
536
|
+
const d = b == null ? void 0 : b[x], B = (d == null ? void 0 : d.label) || I, F = c[x];
|
|
535
537
|
let T;
|
|
536
538
|
if ((d == null ? void 0 : d.agg) === "count")
|
|
537
539
|
T = String(F);
|
|
538
540
|
else {
|
|
539
|
-
const
|
|
541
|
+
const C = d != null && d.field_options ? (() => {
|
|
540
542
|
try {
|
|
541
543
|
return JSON.parse(d.field_options);
|
|
542
544
|
} catch {
|
|
543
545
|
return {};
|
|
544
546
|
}
|
|
545
|
-
})() : {},
|
|
546
|
-
if (
|
|
547
|
+
})() : {}, z = C.format;
|
|
548
|
+
if (z === "currency")
|
|
547
549
|
try {
|
|
548
550
|
T = new Intl.NumberFormat(void 0, {
|
|
549
551
|
style: "currency",
|
|
550
|
-
currency:
|
|
552
|
+
currency: C.currency || "USD"
|
|
551
553
|
}).format(F);
|
|
552
554
|
} catch {
|
|
553
555
|
T = F.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
554
556
|
}
|
|
555
|
-
else if (
|
|
557
|
+
else if (z === "int")
|
|
556
558
|
T = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(F);
|
|
557
|
-
else if (
|
|
558
|
-
const
|
|
559
|
+
else if (z === "decimal") {
|
|
560
|
+
const G = typeof C.precision == "number" ? C.precision : 2;
|
|
559
561
|
T = new Intl.NumberFormat(void 0, {
|
|
560
|
-
minimumFractionDigits:
|
|
561
|
-
maximumFractionDigits:
|
|
562
|
+
minimumFractionDigits: G,
|
|
563
|
+
maximumFractionDigits: G
|
|
562
564
|
}).format(F);
|
|
563
565
|
} else
|
|
564
566
|
T = F.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
565
567
|
}
|
|
566
|
-
return /* @__PURE__ */ N("div", { className:
|
|
567
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
568
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
569
|
+
/* @__PURE__ */ e("span", { className: _, children: B }),
|
|
568
570
|
/* @__PURE__ */ e("span", { className: w, children: T })
|
|
569
571
|
] });
|
|
570
572
|
}
|
|
571
|
-
if (
|
|
572
|
-
const d =
|
|
573
|
-
return /* @__PURE__ */ N("div", { className:
|
|
574
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
573
|
+
if (h && x in h) {
|
|
574
|
+
const d = h[x];
|
|
575
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
576
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
575
577
|
/* @__PURE__ */ N("span", { className: w, children: [
|
|
576
578
|
d,
|
|
577
579
|
" item",
|
|
@@ -579,10 +581,10 @@ function kt({
|
|
|
579
581
|
] })
|
|
580
582
|
] });
|
|
581
583
|
}
|
|
582
|
-
if (v &&
|
|
583
|
-
const d = v[
|
|
584
|
-
return /* @__PURE__ */ N("div", { className:
|
|
585
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
584
|
+
if (v && x in v) {
|
|
585
|
+
const d = v[x];
|
|
586
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
587
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
586
588
|
/* @__PURE__ */ N("span", { className: w, children: [
|
|
587
589
|
d,
|
|
588
590
|
" row",
|
|
@@ -590,22 +592,22 @@ function kt({
|
|
|
590
592
|
] })
|
|
591
593
|
] });
|
|
592
594
|
}
|
|
593
|
-
const k = i[
|
|
594
|
-
(d) => d.many_collection ===
|
|
595
|
+
const k = i[x], U = u.find(
|
|
596
|
+
(d) => d.many_collection === s && d.many_field === x && !d.junction_field
|
|
595
597
|
);
|
|
596
|
-
if (
|
|
598
|
+
if (U != null && U.one_collection) {
|
|
597
599
|
const d = Array.isArray(k) ? k : k != null && k !== "" ? [k] : [];
|
|
598
|
-
return /* @__PURE__ */ N("div", { className:
|
|
599
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
600
|
-
d.length === 0 ? /* @__PURE__ */ e("span", { className: P, children: "—" }) :
|
|
600
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
601
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
602
|
+
d.length === 0 ? /* @__PURE__ */ e("span", { className: P, children: "—" }) : U.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((B) => /* @__PURE__ */ e(Ge, { userId: String(B) }, String(B))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((B) => /* @__PURE__ */ e(X, { relCollection: U.one_collection, id: B }, String(B))) })
|
|
601
603
|
] });
|
|
602
604
|
}
|
|
603
605
|
if (Array.isArray(k)) {
|
|
604
|
-
const d = u.find((F) => F.many_field ===
|
|
605
|
-
return /* @__PURE__ */ N("div", { className:
|
|
606
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
607
|
-
k.length === 0 ? /* @__PURE__ */ e("span", { className: P, children: "—" }) :
|
|
608
|
-
(F) =>
|
|
606
|
+
const d = u.find((F) => F.many_field === x && F.junction_field), B = d == null ? void 0 : d.one_collection;
|
|
607
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
608
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
609
|
+
k.length === 0 ? /* @__PURE__ */ e("span", { className: P, children: "—" }) : B ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: k.map(
|
|
610
|
+
(F) => B === "nivaro_users" ? /* @__PURE__ */ e(Ge, { userId: String(F) }, String(F)) : /* @__PURE__ */ e(X, { relCollection: B, id: F }, String(F))
|
|
609
611
|
) }) : /* @__PURE__ */ N("span", { className: w, children: [
|
|
610
612
|
k.length,
|
|
611
613
|
" item",
|
|
@@ -613,175 +615,196 @@ function kt({
|
|
|
613
615
|
] })
|
|
614
616
|
] });
|
|
615
617
|
}
|
|
616
|
-
return /* @__PURE__ */ N("div", { className:
|
|
617
|
-
/* @__PURE__ */ e("span", { className: _, children:
|
|
618
|
-
k == null || k === "" ? /* @__PURE__ */ e("span", { className: P, children: "—" }) : /* @__PURE__ */ e("span", { className: w, children:
|
|
618
|
+
return /* @__PURE__ */ N("div", { className: V, children: [
|
|
619
|
+
/* @__PURE__ */ e("span", { className: _, children: I }),
|
|
620
|
+
k == null || k === "" ? /* @__PURE__ */ e("span", { className: P, children: "—" }) : /* @__PURE__ */ e("span", { className: w, children: he(k, R) })
|
|
619
621
|
] });
|
|
620
622
|
};
|
|
621
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children: $.map((
|
|
623
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children: $.map((x) => /* @__PURE__ */ e(Ae.Fragment, { children: le(x) }, x)) });
|
|
622
624
|
}
|
|
623
|
-
function
|
|
625
|
+
function sn({
|
|
624
626
|
group: t,
|
|
625
627
|
fields: r,
|
|
626
628
|
draft: i,
|
|
627
629
|
onChange: u,
|
|
628
|
-
relations:
|
|
629
|
-
collection:
|
|
630
|
+
relations: s,
|
|
631
|
+
collection: l,
|
|
630
632
|
itemId: n,
|
|
631
633
|
errors: o,
|
|
632
634
|
visibleFields: p,
|
|
633
|
-
lockedFields:
|
|
635
|
+
lockedFields: h,
|
|
634
636
|
layoutAiEnabled: v,
|
|
635
637
|
displayOnly: c,
|
|
636
|
-
renderField:
|
|
637
|
-
onCountChange:
|
|
638
|
+
renderField: b,
|
|
639
|
+
onCountChange: f,
|
|
638
640
|
isNew: g,
|
|
639
|
-
fieldValues:
|
|
641
|
+
fieldValues: O,
|
|
640
642
|
isOpen: $,
|
|
641
643
|
onToggle: _,
|
|
642
644
|
summaryFields: w,
|
|
643
645
|
m2mCounts: P,
|
|
644
|
-
o2mCounts:
|
|
645
|
-
o2mAggValues:
|
|
646
|
-
summaryAggConfigs:
|
|
647
|
-
o2mLoading:
|
|
648
|
-
footerSlot:
|
|
649
|
-
ownersCollection:
|
|
650
|
-
ownersItemId:
|
|
646
|
+
o2mCounts: V,
|
|
647
|
+
o2mAggValues: le,
|
|
648
|
+
summaryAggConfigs: x,
|
|
649
|
+
o2mLoading: q,
|
|
650
|
+
footerSlot: ee,
|
|
651
|
+
ownersCollection: R,
|
|
652
|
+
ownersItemId: I,
|
|
651
653
|
ownersAssignment: k,
|
|
652
|
-
pdfAssignment:
|
|
654
|
+
pdfAssignment: U,
|
|
653
655
|
pdfAttachField: d,
|
|
654
|
-
pdfFilenameTemplate:
|
|
656
|
+
pdfFilenameTemplate: B,
|
|
655
657
|
layoutId: F,
|
|
656
658
|
hideEmptySummary: T,
|
|
657
|
-
widgetAssignments:
|
|
658
|
-
widgetApiBase:
|
|
659
|
-
fieldInlineDisplay:
|
|
660
|
-
swapConfig:
|
|
661
|
-
swapped:
|
|
662
|
-
onSwapToggle:
|
|
663
|
-
alternateFields:
|
|
664
|
-
alternateWidths:
|
|
659
|
+
widgetAssignments: C,
|
|
660
|
+
widgetApiBase: z,
|
|
661
|
+
fieldInlineDisplay: G,
|
|
662
|
+
swapConfig: M,
|
|
663
|
+
swapped: be,
|
|
664
|
+
onSwapToggle: ge,
|
|
665
|
+
alternateFields: W,
|
|
666
|
+
alternateWidths: ae
|
|
665
667
|
}) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
(
|
|
672
|
-
|
|
673
|
-
const
|
|
668
|
+
var Fe;
|
|
669
|
+
const [Xe, et] = Z(t.is_collapsed ?? !1), j = wt(), H = (m, a) => _t(j, m, a, { asChild: !0 }), te = (m) => ({ kind: "slot", field: m, group_key: t.key }), xe = !!(j != null && j.showHidden), [ye, Ne] = Z({}), { data: oe } = Ft(l), A = (j == null ? void 0 : j.fold) ?? null, E = (j == null ? void 0 : j.reveal) ?? null, [_e, ce] = Z(null);
|
|
670
|
+
fe(() => {
|
|
671
|
+
A && ce(!A.open);
|
|
672
|
+
}, [A == null ? void 0 : A.seq]), fe(() => {
|
|
673
|
+
E && vt(E.target) === t.key && ce(!1);
|
|
674
|
+
}, [E == null ? void 0 : E.seq]);
|
|
675
|
+
const we = _ !== void 0, Y = _e ?? (we ? !$ : Xe), tt = _e !== null ? () => ce((m) => !m) : we ? _ : () => et((m) => !m), nt = !c && r.some((m) => o[m.field]), ve = j ? "always" : t.visibility_mode ?? "always";
|
|
676
|
+
if (ve === "new_only" && !g || ve === "existing_only" && g) return null;
|
|
677
|
+
const Q = C ?? [], rt = !g && Q.some((m) => m.widget_id != null && ye[m.field] === void 0);
|
|
678
|
+
let de = !1;
|
|
679
|
+
if (t.hide_when_empty && O && !j && (de = O.every(
|
|
680
|
+
(a) => a == null || a === "" || Array.isArray(a) && a.length === 0
|
|
681
|
+
) && !rt && Q.every((a) => !ye[a.field])), de && Q.length === 0) return null;
|
|
682
|
+
const ue = pe(null), Se = Lt(ue), ke = Ut(t.icon), it = xe ? r : r.filter((m) => !m.hidden), De = (Fe = oe == null ? void 0 : oe.sections) == null ? void 0 : Fe[t.key], st = Array.isArray(De) && De.length > 0, lt = (m) => st ? /* @__PURE__ */ N("div", { className: "relative", children: [
|
|
683
|
+
m,
|
|
684
|
+
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
685
|
+
jt,
|
|
686
|
+
{
|
|
687
|
+
collection: l,
|
|
688
|
+
kind: "section",
|
|
689
|
+
name: t.key,
|
|
690
|
+
label: t.label || t.key
|
|
691
|
+
}
|
|
692
|
+
) })
|
|
693
|
+
] }) : m, $e = (m) => xe && (m.hidden || !(p.has(m.field) || !p.size));
|
|
674
694
|
return /* @__PURE__ */ N(
|
|
675
695
|
"div",
|
|
676
696
|
{
|
|
677
|
-
className:
|
|
697
|
+
className: re(
|
|
678
698
|
"nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
|
|
679
699
|
c && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
680
|
-
|
|
700
|
+
de && "hidden"
|
|
681
701
|
),
|
|
682
702
|
children: [
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
703
|
+
lt(
|
|
704
|
+
/* @__PURE__ */ N(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
type: "button",
|
|
708
|
+
onClick: tt,
|
|
709
|
+
"data-design-group-header": j ? "" : void 0,
|
|
710
|
+
className: re(
|
|
711
|
+
"flex w-full items-center gap-2 px-5 py-3 text-left hover:bg-slate-50/50 dark:hover:bg-white/[0.02] rounded-t-xl",
|
|
712
|
+
// Round the bottom only when nothing renders below the header — an
|
|
713
|
+
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
714
|
+
// rounded hover overlay would leave see-through notches at the seam.
|
|
715
|
+
Y && !(w && w.length > 0) && "rounded-b-xl"
|
|
716
|
+
),
|
|
717
|
+
children: [
|
|
718
|
+
ke && /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
719
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
720
|
+
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
721
|
+
nt && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
722
|
+
/* @__PURE__ */ e(
|
|
723
|
+
ut,
|
|
724
|
+
{
|
|
725
|
+
"data-design-pass": j ? "" : void 0,
|
|
726
|
+
className: re(
|
|
727
|
+
"h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
|
|
728
|
+
Y && "-rotate-90"
|
|
729
|
+
)
|
|
730
|
+
}
|
|
731
|
+
)
|
|
732
|
+
]
|
|
733
|
+
}
|
|
734
|
+
)
|
|
713
735
|
),
|
|
714
|
-
|
|
715
|
-
|
|
736
|
+
Y && w && w.length > 0 && /* @__PURE__ */ e(
|
|
737
|
+
Jt,
|
|
716
738
|
{
|
|
717
739
|
summaryFields: w,
|
|
718
740
|
fields: r,
|
|
719
741
|
draft: i,
|
|
720
|
-
relations:
|
|
721
|
-
collection:
|
|
742
|
+
relations: s,
|
|
743
|
+
collection: l,
|
|
722
744
|
itemId: n,
|
|
723
|
-
ownersCollection:
|
|
724
|
-
ownersItemId:
|
|
745
|
+
ownersCollection: R,
|
|
746
|
+
ownersItemId: I,
|
|
725
747
|
ownersAssignment: k,
|
|
726
748
|
m2mCounts: P,
|
|
727
|
-
o2mCounts:
|
|
728
|
-
o2mAggValues:
|
|
729
|
-
summaryAggConfigs:
|
|
730
|
-
o2mLoading:
|
|
749
|
+
o2mCounts: V,
|
|
750
|
+
o2mAggValues: le,
|
|
751
|
+
summaryAggConfigs: x,
|
|
752
|
+
o2mLoading: q,
|
|
731
753
|
hideEmpty: !!t.summary_hide_empty || !!T
|
|
732
754
|
}
|
|
733
755
|
),
|
|
734
|
-
|
|
735
|
-
|
|
756
|
+
Y && t.hide_when_empty && Q.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: Q.filter((m) => m.widget_id != null).map((m) => /* @__PURE__ */ e(
|
|
757
|
+
Pe,
|
|
736
758
|
{
|
|
737
|
-
widgetId:
|
|
738
|
-
inputBindings:
|
|
759
|
+
widgetId: m.widget_id,
|
|
760
|
+
inputBindings: Re(m.input_bindings),
|
|
739
761
|
itemDraft: i,
|
|
740
762
|
frameless: !0,
|
|
741
|
-
apiBase:
|
|
742
|
-
onContentChange: (
|
|
743
|
-
(y) => y[
|
|
763
|
+
apiBase: z,
|
|
764
|
+
onContentChange: (a) => Ne(
|
|
765
|
+
(y) => y[m.field] === a ? y : { ...y, [m.field]: a }
|
|
744
766
|
)
|
|
745
767
|
},
|
|
746
|
-
|
|
768
|
+
m.field
|
|
747
769
|
)) }),
|
|
748
|
-
!
|
|
770
|
+
!Y && /* @__PURE__ */ N("div", { className: "nvr-expand-in border-t border-slate-100 px-5 py-4", children: [
|
|
771
|
+
!c && /* @__PURE__ */ e(Bt, { group: t, className: "mb-3" }),
|
|
749
772
|
(() => {
|
|
750
|
-
const
|
|
751
|
-
_k:
|
|
752
|
-
sort:
|
|
773
|
+
const m = it.map((a) => ({
|
|
774
|
+
_k: a.field,
|
|
775
|
+
sort: a.sort ?? 0,
|
|
753
776
|
_t: "field",
|
|
754
|
-
f:
|
|
777
|
+
f: a
|
|
755
778
|
}));
|
|
756
|
-
k &&
|
|
779
|
+
k && m.push({
|
|
757
780
|
_k: "__owners__",
|
|
758
781
|
sort: k.sort,
|
|
759
782
|
_t: "owners",
|
|
760
783
|
slot: k
|
|
761
|
-
}),
|
|
784
|
+
}), U && m.push({
|
|
762
785
|
_k: "__pdf__",
|
|
763
|
-
sort:
|
|
786
|
+
sort: U.sort,
|
|
764
787
|
_t: "pdf",
|
|
765
|
-
slot:
|
|
788
|
+
slot: U
|
|
766
789
|
});
|
|
767
|
-
for (const
|
|
768
|
-
|
|
769
|
-
return
|
|
770
|
-
if (
|
|
771
|
-
const D =
|
|
772
|
-
return
|
|
773
|
-
|
|
790
|
+
for (const a of C ?? [])
|
|
791
|
+
m.push({ _k: a.field, sort: a.sort, _t: "widget", slot: a });
|
|
792
|
+
return m.sort((a, y) => a.sort - y.sort), j && m.length === 0 ? /* @__PURE__ */ e(Nt, {}) : c ? /* @__PURE__ */ e("div", { ref: ue, className: "grid grid-cols-12 gap-x-6 gap-y-3", children: m.map((a) => {
|
|
793
|
+
if (a._t === "owners") {
|
|
794
|
+
const D = a.slot.col_span ?? 12;
|
|
795
|
+
return H(
|
|
796
|
+
te("__owners__"),
|
|
774
797
|
/* @__PURE__ */ e(
|
|
775
798
|
"div",
|
|
776
799
|
{
|
|
777
800
|
className: "min-w-0",
|
|
778
801
|
style: { gridColumn: `span ${D}` },
|
|
779
802
|
children: /* @__PURE__ */ e(
|
|
780
|
-
|
|
803
|
+
Ke,
|
|
781
804
|
{
|
|
782
|
-
collection:
|
|
805
|
+
collection: l,
|
|
783
806
|
itemId: n,
|
|
784
|
-
label:
|
|
807
|
+
label: a.slot.label_override || "Owners"
|
|
785
808
|
}
|
|
786
809
|
)
|
|
787
810
|
},
|
|
@@ -789,100 +812,100 @@ function Kt({
|
|
|
789
812
|
)
|
|
790
813
|
);
|
|
791
814
|
}
|
|
792
|
-
if (
|
|
793
|
-
const y =
|
|
794
|
-
(D) => D.many_collection ===
|
|
815
|
+
if (a._t === "pdf" || a._t === "widget") return null;
|
|
816
|
+
const y = a.f, L = s.find(
|
|
817
|
+
(D) => D.many_collection === l && D.many_field === y.field && !D.junction_field
|
|
795
818
|
);
|
|
796
|
-
return
|
|
819
|
+
return H(
|
|
797
820
|
{ kind: "field", field: y.field, group_key: t.key },
|
|
798
821
|
/* @__PURE__ */ N(
|
|
799
822
|
"div",
|
|
800
823
|
{
|
|
801
824
|
className: "min-w-0",
|
|
802
|
-
style: { gridColumn: `span ${
|
|
825
|
+
style: { gridColumn: `span ${Ce(y.options, Se)}` },
|
|
803
826
|
children: [
|
|
804
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: y.label ||
|
|
805
|
-
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (
|
|
806
|
-
const D = i[y.field],
|
|
807
|
-
return
|
|
808
|
-
})() :
|
|
827
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: y.label || Qe(y.field) }),
|
|
828
|
+
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (L == null ? void 0 : L.one_collection) === "nivaro_users" ? (() => {
|
|
829
|
+
const D = i[y.field], ne = Array.isArray(D) ? D : D != null && D !== "" ? [D] : [];
|
|
830
|
+
return ne.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: ne.map((K) => /* @__PURE__ */ e(Ze, { userId: String(K) }, String(K))) });
|
|
831
|
+
})() : L != null && L.one_collection ? /* @__PURE__ */ e(X, { relCollection: L.one_collection, id: i[y.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: he(i[y.field], y) }) })
|
|
809
832
|
]
|
|
810
833
|
},
|
|
811
834
|
y.field
|
|
812
835
|
)
|
|
813
836
|
);
|
|
814
|
-
}) }) : /* @__PURE__ */ e("div", { ref:
|
|
815
|
-
var
|
|
816
|
-
if (
|
|
817
|
-
const S =
|
|
818
|
-
return
|
|
819
|
-
|
|
837
|
+
}) }) : /* @__PURE__ */ e("div", { ref: ue, className: "grid grid-cols-12 gap-4 items-start", children: m.map((a) => {
|
|
838
|
+
var Ue, Te;
|
|
839
|
+
if (a._t === "owners") {
|
|
840
|
+
const S = a.slot.col_span ?? 12;
|
|
841
|
+
return H(
|
|
842
|
+
te("__owners__"),
|
|
820
843
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
821
|
-
|
|
844
|
+
Ke,
|
|
822
845
|
{
|
|
823
|
-
collection:
|
|
846
|
+
collection: l,
|
|
824
847
|
itemId: n,
|
|
825
|
-
label:
|
|
848
|
+
label: a.slot.label_override || "Owners"
|
|
826
849
|
}
|
|
827
850
|
) }, "__owners__")
|
|
828
851
|
);
|
|
829
852
|
}
|
|
830
|
-
if (
|
|
853
|
+
if (a._t === "pdf") {
|
|
831
854
|
if (!F) return null;
|
|
832
|
-
const S =
|
|
833
|
-
return
|
|
834
|
-
|
|
855
|
+
const S = a.slot.col_span ?? 12, J = ((Ue = a.slot.label_override) == null ? void 0 : Ue.trim()) || "Generate PDF";
|
|
856
|
+
return H(
|
|
857
|
+
te("__pdf__"),
|
|
835
858
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
836
|
-
|
|
859
|
+
Tt,
|
|
837
860
|
{
|
|
838
|
-
collection:
|
|
861
|
+
collection: l,
|
|
839
862
|
itemId: n,
|
|
840
863
|
layoutId: F,
|
|
841
864
|
attachField: d ?? null,
|
|
842
|
-
filenameTemplate:
|
|
865
|
+
filenameTemplate: B,
|
|
843
866
|
label: J
|
|
844
867
|
}
|
|
845
868
|
) }, "__pdf__")
|
|
846
869
|
);
|
|
847
870
|
}
|
|
848
|
-
if (
|
|
849
|
-
if (!
|
|
850
|
-
const S =
|
|
851
|
-
return
|
|
852
|
-
|
|
871
|
+
if (a._t === "widget") {
|
|
872
|
+
if (!a.slot.widget_id) return null;
|
|
873
|
+
const S = a.slot.col_span ?? 12, J = Re(a.slot.input_bindings);
|
|
874
|
+
return H(
|
|
875
|
+
te(a.slot.field),
|
|
853
876
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
854
|
-
|
|
877
|
+
Pe,
|
|
855
878
|
{
|
|
856
|
-
widgetId:
|
|
879
|
+
widgetId: a.slot.widget_id,
|
|
857
880
|
inputBindings: J,
|
|
858
881
|
itemDraft: i,
|
|
859
|
-
label:
|
|
860
|
-
defaultExpanded:
|
|
882
|
+
label: a.slot.label_override ?? void 0,
|
|
883
|
+
defaultExpanded: a.slot.default_expanded ?? !0,
|
|
861
884
|
frameless: !0,
|
|
862
|
-
apiBase:
|
|
863
|
-
onContentChange: (
|
|
864
|
-
(
|
|
885
|
+
apiBase: z,
|
|
886
|
+
onContentChange: (Me) => Ne(
|
|
887
|
+
(me) => me[a.slot.field] === Me ? me : { ...me, [a.slot.field]: Me }
|
|
865
888
|
)
|
|
866
889
|
}
|
|
867
|
-
) },
|
|
890
|
+
) }, a.slot.field)
|
|
868
891
|
);
|
|
869
892
|
}
|
|
870
|
-
const y =
|
|
871
|
-
(S) => S.many_collection ===
|
|
872
|
-
)) == null ? void 0 :
|
|
873
|
-
const S = i[(
|
|
893
|
+
const y = a.f, L = G == null ? void 0 : G[y.field], D = L == null ? void 0 : L.entries, ne = (L == null ? void 0 : L.separator) ?? null, K = i[y.field], je = K != null && K !== "", Oe = D != null && D.length && je ? ((Te = s.find(
|
|
894
|
+
(S) => S.many_collection === l && S.many_field === y.field && !S.junction_field
|
|
895
|
+
)) == null ? void 0 : Te.one_collection) ?? null : null, Le = (M == null ? void 0 : M.enabled) && y.field === M.primary_field, Be = (() => {
|
|
896
|
+
const S = i[(M == null ? void 0 : M.primary_field) ?? ""];
|
|
874
897
|
return S != null && S !== "";
|
|
875
|
-
})(),
|
|
898
|
+
})(), qe = (W ?? []).some((S) => {
|
|
876
899
|
const J = i[S.field];
|
|
877
900
|
return J != null && J !== "";
|
|
878
|
-
}),
|
|
901
|
+
}), at = Le && ge ? /* @__PURE__ */ N("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
879
902
|
/* @__PURE__ */ e(
|
|
880
903
|
"button",
|
|
881
904
|
{
|
|
882
905
|
type: "button",
|
|
883
|
-
onClick:
|
|
906
|
+
onClick: ge,
|
|
884
907
|
className: "inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 transition-colors",
|
|
885
|
-
children:
|
|
908
|
+
children: be ? M.back_label ?? "Back" : M.toggle_label ?? "Enter manually"
|
|
886
909
|
}
|
|
887
910
|
),
|
|
888
911
|
/* @__PURE__ */ N(
|
|
@@ -890,7 +913,7 @@ function Kt({
|
|
|
890
913
|
{
|
|
891
914
|
className: [
|
|
892
915
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
893
|
-
|
|
916
|
+
Be ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
894
917
|
].join(" "),
|
|
895
918
|
title: "Original field",
|
|
896
919
|
children: [
|
|
@@ -899,7 +922,7 @@ function Kt({
|
|
|
899
922
|
{
|
|
900
923
|
className: [
|
|
901
924
|
"h-1.5 w-1.5 rounded-full",
|
|
902
|
-
|
|
925
|
+
Be ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
903
926
|
].join(" ")
|
|
904
927
|
}
|
|
905
928
|
),
|
|
@@ -912,7 +935,7 @@ function Kt({
|
|
|
912
935
|
{
|
|
913
936
|
className: [
|
|
914
937
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
915
|
-
|
|
938
|
+
qe ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
916
939
|
].join(" "),
|
|
917
940
|
title: "Manual fields",
|
|
918
941
|
children: [
|
|
@@ -921,7 +944,7 @@ function Kt({
|
|
|
921
944
|
{
|
|
922
945
|
className: [
|
|
923
946
|
"h-1.5 w-1.5 rounded-full",
|
|
924
|
-
|
|
947
|
+
qe ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
925
948
|
].join(" ")
|
|
926
949
|
}
|
|
927
950
|
),
|
|
@@ -929,61 +952,61 @@ function Kt({
|
|
|
929
952
|
]
|
|
930
953
|
}
|
|
931
954
|
)
|
|
932
|
-
] }) : void 0,
|
|
933
|
-
const J = (
|
|
955
|
+
] }) : void 0, ot = Le && be && (W != null && W.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: W.map((S) => {
|
|
956
|
+
const J = (ae == null ? void 0 : ae[S.field]) ?? 2;
|
|
934
957
|
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${J}` }, children: /* @__PURE__ */ e(
|
|
935
|
-
|
|
958
|
+
Ve,
|
|
936
959
|
{
|
|
937
960
|
field: S,
|
|
938
961
|
draft: i,
|
|
939
962
|
onChange: u,
|
|
940
|
-
relations:
|
|
941
|
-
collection:
|
|
963
|
+
relations: s,
|
|
964
|
+
collection: l,
|
|
942
965
|
itemId: n,
|
|
943
966
|
error: o[S.field],
|
|
944
967
|
visible: !0,
|
|
945
968
|
forceVisible: !0,
|
|
946
|
-
locked:
|
|
969
|
+
locked: h.has(S.field),
|
|
947
970
|
layoutAiEnabled: v,
|
|
948
|
-
renderField:
|
|
949
|
-
onCountChange:
|
|
971
|
+
renderField: b,
|
|
972
|
+
onCountChange: f
|
|
950
973
|
}
|
|
951
974
|
) }, S.field);
|
|
952
|
-
}) }) }) : void 0,
|
|
953
|
-
|
|
975
|
+
}) }) }) : void 0, Ie = /* @__PURE__ */ e(
|
|
976
|
+
Ve,
|
|
954
977
|
{
|
|
955
978
|
field: y,
|
|
956
979
|
draft: i,
|
|
957
980
|
onChange: u,
|
|
958
|
-
relations:
|
|
959
|
-
collection:
|
|
981
|
+
relations: s,
|
|
982
|
+
collection: l,
|
|
960
983
|
itemId: n,
|
|
961
984
|
error: o[y.field],
|
|
962
985
|
visible: p.has(y.field) || !p.size,
|
|
963
|
-
forceVisible:
|
|
964
|
-
locked:
|
|
986
|
+
forceVisible: $e(y) || void 0,
|
|
987
|
+
locked: h.has(y.field),
|
|
965
988
|
layoutAiEnabled: v,
|
|
966
|
-
renderField:
|
|
967
|
-
onCountChange:
|
|
968
|
-
swapButton:
|
|
969
|
-
swapContent:
|
|
989
|
+
renderField: b,
|
|
990
|
+
onCountChange: f,
|
|
991
|
+
swapButton: at,
|
|
992
|
+
swapContent: ot
|
|
970
993
|
}
|
|
971
994
|
);
|
|
972
|
-
return
|
|
995
|
+
return H(
|
|
973
996
|
{ kind: "field", field: y.field, group_key: t.key },
|
|
974
997
|
/* @__PURE__ */ N(
|
|
975
998
|
"div",
|
|
976
999
|
{
|
|
977
|
-
style: { gridColumn: `span ${
|
|
1000
|
+
style: { gridColumn: `span ${Ce(y.options, Se)}` },
|
|
978
1001
|
children: [
|
|
979
|
-
|
|
980
|
-
(D == null ? void 0 : D.length) &&
|
|
981
|
-
|
|
1002
|
+
$e(y) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Ie }) : Ie,
|
|
1003
|
+
(D == null ? void 0 : D.length) && je && Oe && /* @__PURE__ */ e(
|
|
1004
|
+
It,
|
|
982
1005
|
{
|
|
983
|
-
relCollection:
|
|
984
|
-
relId:
|
|
1006
|
+
relCollection: Oe,
|
|
1007
|
+
relId: K,
|
|
985
1008
|
entries: D,
|
|
986
|
-
separator:
|
|
1009
|
+
separator: ne
|
|
987
1010
|
}
|
|
988
1011
|
)
|
|
989
1012
|
]
|
|
@@ -993,21 +1016,21 @@ function Kt({
|
|
|
993
1016
|
);
|
|
994
1017
|
}) });
|
|
995
1018
|
})(),
|
|
996
|
-
|
|
1019
|
+
ee && /* @__PURE__ */ e("div", { className: "mt-4", children: ee })
|
|
997
1020
|
] })
|
|
998
1021
|
]
|
|
999
1022
|
}
|
|
1000
1023
|
);
|
|
1001
1024
|
}
|
|
1002
1025
|
export {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1026
|
+
sn as GroupSection,
|
|
1027
|
+
It as InlineDisplay,
|
|
1028
|
+
Ke as OwnersInline,
|
|
1029
|
+
qt as OwnersInlineCompact,
|
|
1030
|
+
X as RelationCell,
|
|
1031
|
+
rn as StripFieldValue,
|
|
1032
|
+
Ze as UserChip,
|
|
1033
|
+
on as UserRosterCluster,
|
|
1034
|
+
he as formatDisplayValue,
|
|
1035
|
+
Mt as useChangePulse
|
|
1013
1036
|
};
|