@nivaro/react 0.3.64 → 0.3.65
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 +49 -4
- package/dist/shared/components/CollectionBrowserView.js +3029 -2947
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4469 -4266
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
- package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/line-merge.js +58 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +22 -15
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Info as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useParentDraft as
|
|
7
|
-
import { showsAiButton as
|
|
8
|
-
import { get as
|
|
9
|
-
import { toastError as
|
|
10
|
-
import { titleCase as
|
|
11
|
-
import { requiredByRules as
|
|
12
|
-
import { GlossaryLabel as
|
|
13
|
-
import { useFieldSource as
|
|
14
|
-
import { Label as
|
|
2
|
+
import { useQueryClient as Ze, useQueries as kt, useQuery as le, useMutation as _t } from "@tanstack/react-query";
|
|
3
|
+
import { Info as Nt, Loader2 as Ft, Sparkles as Ct, Lock as Rt, SlidersHorizontal as Lt, History as St, BellRing as $t, Bell as qt, Sigma as At } from "lucide-react";
|
|
4
|
+
import { memo as Tt, useState as we, useRef as L, useId as Et, useEffect as ae, useCallback as ze } from "react";
|
|
5
|
+
import { toast as oe } from "sonner";
|
|
6
|
+
import { useParentDraft as Pt, useNivaroClient as ie } from "../../context.js";
|
|
7
|
+
import { showsAiButton as jt, AUTOFILL_CHECK_KEY as Bt, readAiFill as Dt } from "../../lib/ai-fill.js";
|
|
8
|
+
import { get as H, del as Mt, post as ve } from "../../lib/commands.js";
|
|
9
|
+
import { toastError as Ot } from "../../lib/error-toast.js";
|
|
10
|
+
import { titleCase as U, cn as D } from "../../lib/utils.js";
|
|
11
|
+
import { requiredByRules as Ge } from "../../lib/validation-rules.js";
|
|
12
|
+
import { GlossaryLabel as Qe } from "../ai/GlossaryText.js";
|
|
13
|
+
import { useFieldSource as Kt, FieldSourceInfo as Ut } from "../ConfigReadBack.js";
|
|
14
|
+
import { Label as Ht } from "../ui/label.js";
|
|
15
15
|
import { TooltipProvider as ee, Tooltip as te, TooltipTrigger as ne, TooltipContent as re } from "../ui/tooltip.js";
|
|
16
|
-
import { useAddendumFields as
|
|
17
|
-
import { AutoIdPreviewField as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
|
|
16
|
+
import { useAddendumFields as Wt } from "./AddendumFieldContext.js";
|
|
17
|
+
import { AutoIdPreviewField as Vt } from "./AutoIdPreviewField.js";
|
|
18
|
+
import { useCascadeClearNotifier as zt } from "./cascade-clear-notice.js";
|
|
19
|
+
import { FOCUSABLE as Ye } from "./entry/entry-keys.js";
|
|
20
|
+
import { useFieldAffordances as Gt, useFieldContextMenu as Qt, usePresenceSoftLock as Yt, LockReasonBadge as Jt, PresenceSoftLockStrip as Xt, RemoteChangeGhost as Zt } from "./FieldAffordances.js";
|
|
21
|
+
import { FieldCommentButton as It } from "./FieldComments.js";
|
|
22
|
+
import { FieldRenderer as en } from "./FieldRenderer.js";
|
|
23
|
+
import { FormHelpVideoButton as tn } from "./FormHelpVideoButton.js";
|
|
24
|
+
import { primaryControl as nn, applyFieldA11y as rn } from "./field-a11y.js";
|
|
25
|
+
import { getCascadeFilters as ln, SYSTEM_FIELDS as an, parseJson as on, buildCascadeFilter as sn, CascadeEffectController as cn } from "./helpers.js";
|
|
26
|
+
import { isDerivedForRecord as dn } from "./live-rollups.js";
|
|
27
|
+
import { useM2MStaging as un } from "./M2MStagingContext.js";
|
|
28
|
+
import { personalDefaultSlotFor as mn, PersonalDefaultSlot as pn } from "./PersonalDefaultControl.js";
|
|
29
|
+
import { PersonalDefaultHint as hn } from "./PersonalDefaultPill.js";
|
|
30
|
+
import { isDisplayFormulaRow as Je, usePlacementTextContext as fn, placementFieldText as xn, fieldCounterConfig as yn, fieldIsRecommended as bn, RecommendedMarker as gn, RepeatLastButton as vn, DisplayFormulaValue as wn, FieldCounter as kn } from "./placement-behaviour.js";
|
|
31
|
+
import { keepIfEqual as _n, jsonEqual as Nn } from "./render-stability.js";
|
|
32
|
+
import { softRuleWarning as Fn } from "./soft-rules.js";
|
|
33
|
+
import { usePersonalDefaultsApi as Cn } from "./usePersonalDefaults.js";
|
|
34
|
+
import { resolveOptionFilterTokens as Rn } from "../../lib/option-filter-tokens.js";
|
|
35
|
+
const Xe = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), Ln = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), Sn = /* @__PURE__ */ new Set([
|
|
34
36
|
"input",
|
|
35
37
|
"textarea",
|
|
36
38
|
"wysiwyg",
|
|
@@ -38,7 +40,7 @@ const Ge = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
38
40
|
"input-rich-text-html",
|
|
39
41
|
"rich_text",
|
|
40
42
|
"extension-editorjs"
|
|
41
|
-
]),
|
|
43
|
+
]), $n = /* @__PURE__ */ new Set([
|
|
42
44
|
"relation-m2o",
|
|
43
45
|
"relation-m2m",
|
|
44
46
|
"select-multiple-m2m",
|
|
@@ -49,216 +51,216 @@ const Ge = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
49
51
|
"file",
|
|
50
52
|
"files",
|
|
51
53
|
"image"
|
|
52
|
-
]),
|
|
53
|
-
function
|
|
54
|
-
const e =
|
|
55
|
-
return
|
|
54
|
+
]), qn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
|
|
55
|
+
function An(m) {
|
|
56
|
+
const e = m.interface ?? "";
|
|
57
|
+
return $n.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") || Xe.has(m.type ?? "") ? !1 : !!(Ln.has(m.type ?? "") || Sn.has(e) || !e && m.type && !Xe.has(m.type));
|
|
56
58
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
59
|
+
function Tn(m, e, i) {
|
|
60
|
+
return m.filter((h) => (i == null ? void 0 : i(h)) !== e);
|
|
59
61
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
+
function En(m, e, i, h) {
|
|
63
|
+
const x = ie();
|
|
62
64
|
return le({
|
|
63
|
-
queryKey: ["field-lineage",
|
|
64
|
-
queryFn: () =>
|
|
65
|
-
|
|
66
|
-
).then((
|
|
67
|
-
enabled:
|
|
65
|
+
queryKey: ["field-lineage", m, e, i],
|
|
66
|
+
queryFn: () => x.request(
|
|
67
|
+
H(`/lineage/${m}/${encodeURIComponent(e)}/${i}`)
|
|
68
|
+
).then((s) => s.data),
|
|
69
|
+
enabled: h,
|
|
68
70
|
staleTime: 3e4
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
|
-
function
|
|
73
|
+
function br(m, e = "rows") {
|
|
72
74
|
var l, w, g;
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
return `= ${
|
|
76
|
-
var
|
|
77
|
-
return
|
|
75
|
+
if (m && (m.kind === "write" || m.kind === "read") && m.formula) {
|
|
76
|
+
const p = (b) => typeof b == "number" ? b.toLocaleString(void 0, { maximumFractionDigits: 2 }) : b == null || b === "" ? "0" : String(b);
|
|
77
|
+
return `= ${m.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (b, a) => {
|
|
78
|
+
var f;
|
|
79
|
+
return p((f = m.inputs) == null ? void 0 : f[a]);
|
|
78
80
|
}).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
|
|
79
81
|
}
|
|
80
|
-
if (!
|
|
81
|
-
const i = (
|
|
82
|
+
if (!m || m.kind !== "rollup") return null;
|
|
83
|
+
const i = (m.sources ?? []).reduce((p, o) => p + o.rows.length, 0), h = (m.sources ?? []).reduce((p, o) => {
|
|
82
84
|
var b;
|
|
83
|
-
return
|
|
84
|
-
}, 0),
|
|
85
|
-
var
|
|
86
|
-
return (
|
|
87
|
-
})) == null ? void 0 : l.excluded) == null ? void 0 : w[0]) == null ? void 0 : g.reason,
|
|
88
|
-
return
|
|
89
|
-
`${
|
|
90
|
-
),
|
|
85
|
+
return p + (((b = o.excluded) == null ? void 0 : b.length) ?? 0);
|
|
86
|
+
}, 0), x = (g = (w = (l = (m.sources ?? []).find((p) => {
|
|
87
|
+
var o;
|
|
88
|
+
return (o = p.excluded) == null ? void 0 : o.length;
|
|
89
|
+
})) == null ? void 0 : l.excluded) == null ? void 0 : w[0]) == null ? void 0 : g.reason, s = [`= ${i} ${i === 1 ? e.replace(/s$/, "") : e}`];
|
|
90
|
+
return h && s.push(
|
|
91
|
+
`${h} excluded${x ? ` (${x.replace(/^does not match: /, "")})` : ""}`
|
|
92
|
+
), s.join(" · ");
|
|
91
93
|
}
|
|
92
|
-
function
|
|
93
|
-
collection:
|
|
94
|
+
function Pn({
|
|
95
|
+
collection: m,
|
|
94
96
|
itemId: e,
|
|
95
97
|
field: i
|
|
96
98
|
}) {
|
|
97
|
-
const [
|
|
98
|
-
|
|
99
|
-
if (!
|
|
100
|
-
const
|
|
101
|
-
var
|
|
102
|
-
(
|
|
99
|
+
const [h, x] = we(!1), s = L(null), { data: l, isLoading: w } = En(m, e, i, h);
|
|
100
|
+
ae(() => {
|
|
101
|
+
if (!h) return;
|
|
102
|
+
const o = (b) => {
|
|
103
|
+
var a;
|
|
104
|
+
(a = s.current) != null && a.contains(b.target) || x(!1);
|
|
103
105
|
};
|
|
104
|
-
return window.addEventListener("mousedown",
|
|
105
|
-
}, [
|
|
106
|
-
const g = (
|
|
107
|
-
return /* @__PURE__ */ u("div", { ref:
|
|
106
|
+
return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
|
|
107
|
+
}, [h]);
|
|
108
|
+
const g = (o) => o == null ? "—" : Number(o).toLocaleString(void 0, { maximumFractionDigits: 2 }), p = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
|
|
109
|
+
return /* @__PURE__ */ u("div", { ref: s, className: "relative inline-flex", children: [
|
|
108
110
|
/* @__PURE__ */ n(
|
|
109
111
|
"button",
|
|
110
112
|
{
|
|
111
113
|
type: "button",
|
|
112
|
-
onClick: () =>
|
|
114
|
+
onClick: () => x((o) => !o),
|
|
113
115
|
title: "Where does this number come from?",
|
|
114
|
-
className:
|
|
116
|
+
className: D(
|
|
115
117
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
116
|
-
|
|
118
|
+
h ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
117
119
|
),
|
|
118
120
|
"data-field-lineage": !0,
|
|
119
|
-
children: /* @__PURE__ */ n(
|
|
121
|
+
children: /* @__PURE__ */ n(At, { className: "h-3 w-3" })
|
|
120
122
|
}
|
|
121
123
|
),
|
|
122
|
-
|
|
124
|
+
h && /* @__PURE__ */ u("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
123
125
|
/* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
|
|
124
126
|
w && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
|
|
125
127
|
(l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ u("div", { className: "space-y-1 px-1 py-1", children: [
|
|
126
128
|
/* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: l.formula }),
|
|
127
|
-
Object.entries(l.inputs ?? {}).map(([
|
|
128
|
-
/* @__PURE__ */ n("span", { className: "font-mono", children:
|
|
129
|
+
Object.entries(l.inputs ?? {}).map(([o, b]) => /* @__PURE__ */ u("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
130
|
+
/* @__PURE__ */ n("span", { className: "font-mono", children: o }),
|
|
129
131
|
" = ",
|
|
130
132
|
g(b)
|
|
131
|
-
] },
|
|
133
|
+
] }, o)),
|
|
132
134
|
/* @__PURE__ */ u("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
|
|
133
135
|
"= ",
|
|
134
136
|
g(l.stored_value)
|
|
135
137
|
] })
|
|
136
138
|
] }),
|
|
137
|
-
(l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((
|
|
138
|
-
var
|
|
139
|
+
(l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((o, b) => {
|
|
140
|
+
var a;
|
|
139
141
|
return /* @__PURE__ */ u("div", { className: "mb-1.5", children: [
|
|
140
142
|
/* @__PURE__ */ u("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
|
|
141
|
-
(
|
|
142
|
-
|
|
143
|
+
(o.aggregate ?? "sum").toUpperCase(),
|
|
144
|
+
o.value_field ? ` of ${o.value_field}` : "",
|
|
143
145
|
" across ",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
o.collection,
|
|
147
|
+
o.filtered ? " (filtered)" : ""
|
|
146
148
|
] }),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
o.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: o.error }),
|
|
150
|
+
o.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: o.note }),
|
|
151
|
+
o.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: o.rows.map((f) => /* @__PURE__ */ u(
|
|
150
152
|
"div",
|
|
151
153
|
{
|
|
152
154
|
className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
|
|
153
155
|
children: [
|
|
154
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children:
|
|
155
|
-
/* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: g(
|
|
156
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: f.label }),
|
|
157
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: g(f.value) }),
|
|
156
158
|
/* @__PURE__ */ n(
|
|
157
159
|
"span",
|
|
158
160
|
{
|
|
159
161
|
className: "w-[88px] shrink-0 truncate text-right text-[10px] text-slate-400",
|
|
160
|
-
"data-tip":
|
|
161
|
-
children:
|
|
162
|
+
"data-tip": f.updated_at ? `${f.updated_by ?? "unknown"} · ${new Date(f.updated_at).toLocaleString()}` : void 0,
|
|
163
|
+
children: f.updated_by ?? ""
|
|
162
164
|
}
|
|
163
165
|
)
|
|
164
166
|
]
|
|
165
167
|
},
|
|
166
|
-
|
|
168
|
+
f.id
|
|
167
169
|
)) }),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
o.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
|
|
171
|
+
o.subtotal != null && /* @__PURE__ */ u("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
|
|
170
172
|
"subtotal ",
|
|
171
|
-
g(
|
|
173
|
+
g(o.subtotal)
|
|
172
174
|
] }),
|
|
173
|
-
(((
|
|
175
|
+
(((a = o.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ u("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
|
|
174
176
|
/* @__PURE__ */ u("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
175
|
-
|
|
177
|
+
o.excluded.length,
|
|
176
178
|
" excluded —",
|
|
177
179
|
" ",
|
|
178
|
-
|
|
180
|
+
o.excluded[0].reason.replace(/^does not match: /, "")
|
|
179
181
|
] }),
|
|
180
|
-
|
|
182
|
+
o.excluded.slice(0, 8).map((f) => /* @__PURE__ */ u(
|
|
181
183
|
"div",
|
|
182
184
|
{
|
|
183
185
|
className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
|
|
184
186
|
children: [
|
|
185
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children:
|
|
186
|
-
/* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: g(
|
|
187
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: f.label }),
|
|
188
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: g(f.value) })
|
|
187
189
|
]
|
|
188
190
|
},
|
|
189
|
-
|
|
191
|
+
f.id
|
|
190
192
|
)),
|
|
191
|
-
|
|
193
|
+
o.excluded.length > 8 && /* @__PURE__ */ u("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
|
|
192
194
|
"+",
|
|
193
|
-
|
|
195
|
+
o.excluded.length - 8,
|
|
194
196
|
" more"
|
|
195
197
|
] })
|
|
196
198
|
] })
|
|
197
199
|
] }, b);
|
|
198
200
|
}),
|
|
199
|
-
(l == null ? void 0 : l.kind) === "rollup" &&
|
|
201
|
+
(l == null ? void 0 : l.kind) === "rollup" && p != null && /* @__PURE__ */ u("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
200
202
|
"stored ",
|
|
201
|
-
g(
|
|
203
|
+
g(p),
|
|
202
204
|
(() => {
|
|
203
|
-
const
|
|
204
|
-
return (l.sources ?? []).some((
|
|
205
|
+
const o = (l.sources ?? []).reduce((a, f) => a + (f.subtotal ?? 0), 0);
|
|
206
|
+
return (l.sources ?? []).some((a) => a.truncated) ? null : Math.abs(o - p) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
|
|
205
207
|
})()
|
|
206
208
|
] })
|
|
207
209
|
] })
|
|
208
210
|
] });
|
|
209
211
|
}
|
|
210
|
-
function
|
|
211
|
-
collection:
|
|
212
|
+
function jn({
|
|
213
|
+
collection: m,
|
|
212
214
|
itemId: e,
|
|
213
215
|
field: i,
|
|
214
|
-
formatValue:
|
|
215
|
-
onRestore:
|
|
216
|
+
formatValue: h,
|
|
217
|
+
onRestore: x
|
|
216
218
|
}) {
|
|
217
|
-
const
|
|
218
|
-
queryKey: ["field-value-history",
|
|
219
|
-
queryFn: () =>
|
|
219
|
+
const s = ie(), [l, w] = we(!1), g = L(null), { data: p, isLoading: o } = le({
|
|
220
|
+
queryKey: ["field-value-history", m, e, i],
|
|
221
|
+
queryFn: () => s.request(H(`/field-history/${m}/${encodeURIComponent(e)}/${i}`)).then((a) => a.data ?? []),
|
|
220
222
|
enabled: l,
|
|
221
223
|
staleTime: 6e4
|
|
222
224
|
});
|
|
223
|
-
|
|
225
|
+
ae(() => {
|
|
224
226
|
if (!l) return;
|
|
225
|
-
const
|
|
226
|
-
var
|
|
227
|
-
(
|
|
227
|
+
const a = (f) => {
|
|
228
|
+
var W;
|
|
229
|
+
(W = g.current) != null && W.contains(f.target) || w(!1);
|
|
228
230
|
};
|
|
229
|
-
return window.addEventListener("mousedown",
|
|
231
|
+
return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
|
|
230
232
|
}, [l]);
|
|
231
|
-
const b = (
|
|
233
|
+
const b = (a, f) => f || (a == null || a === "" ? "—" : h ? h(a) : typeof a == "boolean" || a === "true" || a === "false" ? a === !0 || a === "true" ? "Yes" : "No" : typeof a == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(a) ? new Date(a).toLocaleString() : typeof a == "object" ? JSON.stringify(a).slice(0, 60) : String(a).slice(0, 80));
|
|
232
234
|
return /* @__PURE__ */ u("div", { ref: g, className: "relative inline-flex", children: [
|
|
233
235
|
/* @__PURE__ */ n(
|
|
234
236
|
"button",
|
|
235
237
|
{
|
|
236
238
|
type: "button",
|
|
237
|
-
onClick: () => w((
|
|
239
|
+
onClick: () => w((a) => !a),
|
|
238
240
|
title: "Value history",
|
|
239
|
-
className:
|
|
241
|
+
className: D(
|
|
240
242
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
241
243
|
l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
242
244
|
),
|
|
243
245
|
"data-field-history": !0,
|
|
244
|
-
children: /* @__PURE__ */ n(
|
|
246
|
+
children: /* @__PURE__ */ n(St, { className: "h-3 w-3" })
|
|
245
247
|
}
|
|
246
248
|
),
|
|
247
249
|
l && /* @__PURE__ */ u("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
248
250
|
/* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
|
|
249
|
-
|
|
251
|
+
o ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (p ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (p ?? []).map((a, f) => /* @__PURE__ */ u(
|
|
250
252
|
"div",
|
|
251
253
|
{
|
|
252
254
|
className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
|
|
253
255
|
children: [
|
|
254
256
|
/* @__PURE__ */ u("span", { className: "flex items-baseline justify-between gap-2", children: [
|
|
255
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: b(
|
|
256
|
-
|
|
257
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: b(a.value, a.display) }),
|
|
258
|
+
x && f > 0 && /* @__PURE__ */ n(
|
|
257
259
|
"button",
|
|
258
260
|
{
|
|
259
261
|
type: "button",
|
|
260
262
|
onClick: () => {
|
|
261
|
-
|
|
263
|
+
x(a.value ?? null), w(!1);
|
|
262
264
|
},
|
|
263
265
|
className: "shrink-0 rounded border border-slate-200 px-1.5 py-px text-[10px] text-slate-500 hover:border-nvr-cyan/60 hover:text-nvr-navy dark:border-border dark:hover:text-nvr-cyan",
|
|
264
266
|
children: "Restore"
|
|
@@ -266,193 +268,191 @@ function qn({
|
|
|
266
268
|
)
|
|
267
269
|
] }),
|
|
268
270
|
/* @__PURE__ */ u("span", { className: "block text-[10.5px] text-slate-400", children: [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
a.action === "create" ? "initial value" : "changed",
|
|
272
|
+
a.timestamp ? ` · ${new Date(a.timestamp).toLocaleString()}` : "",
|
|
273
|
+
a.user_name ? ` · ${a.user_name}` : "",
|
|
274
|
+
a.origin && a.origin.kind !== "user" && /* @__PURE__ */ n(
|
|
273
275
|
"span",
|
|
274
276
|
{
|
|
275
|
-
className:
|
|
276
|
-
children:
|
|
277
|
+
className: a.origin.kind === "integration" ? "ml-1 rounded bg-purple-500/10 px-1 py-px text-[9.5px] font-medium text-purple-700 dark:text-purple-400" : a.origin.kind === "import" ? "ml-1 rounded bg-sky-500/10 px-1 py-px text-[9.5px] font-medium text-sky-700 dark:text-sky-400" : "ml-1 rounded bg-amber-500/10 px-1 py-px text-[9.5px] font-medium text-amber-700 dark:text-amber-400",
|
|
278
|
+
children: a.origin.label ?? a.origin.kind
|
|
277
279
|
}
|
|
278
280
|
)
|
|
279
281
|
] }),
|
|
280
|
-
|
|
282
|
+
a.note && /* @__PURE__ */ u("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
|
|
281
283
|
"“",
|
|
282
|
-
|
|
284
|
+
a.note,
|
|
283
285
|
"”"
|
|
284
286
|
] })
|
|
285
287
|
]
|
|
286
288
|
},
|
|
287
|
-
|
|
289
|
+
f
|
|
288
290
|
)) })
|
|
289
291
|
] })
|
|
290
292
|
] });
|
|
291
293
|
}
|
|
292
|
-
function
|
|
293
|
-
collection:
|
|
294
|
+
function Bn({
|
|
295
|
+
collection: m,
|
|
294
296
|
itemId: e,
|
|
295
297
|
field: i
|
|
296
298
|
}) {
|
|
297
|
-
const
|
|
299
|
+
const h = ie(), x = Ze(), { data: s } = le({
|
|
298
300
|
queryKey: ["field-watch-config"],
|
|
299
|
-
queryFn: () =>
|
|
301
|
+
queryFn: () => h.request(H("/field-watches/config")).then((o) => o.data).catch(() => ({ enabled: !1 })),
|
|
300
302
|
staleTime: 5 * 6e4
|
|
301
|
-
}), l = ["field-watch-self",
|
|
303
|
+
}), l = ["field-watch-self", m, e], { data: w = [] } = le({
|
|
302
304
|
queryKey: l,
|
|
303
|
-
queryFn: () =>
|
|
304
|
-
enabled: !!(
|
|
305
|
+
queryFn: () => h.request(H("/field-watches/self", { collection: m, item_id: e })).then((o) => o.data ?? []).catch(() => []),
|
|
306
|
+
enabled: !!(s != null && s.enabled),
|
|
305
307
|
staleTime: 6e4
|
|
306
|
-
}), g = w.includes(i),
|
|
307
|
-
mutationFn: () => g ?
|
|
308
|
-
|
|
309
|
-
`/field-watches/self?collection=${encodeURIComponent(
|
|
308
|
+
}), g = w.includes(i), p = _t({
|
|
309
|
+
mutationFn: () => g ? h.request(
|
|
310
|
+
Mt(
|
|
311
|
+
`/field-watches/self?collection=${encodeURIComponent(m)}&field=${encodeURIComponent(i)}&item_id=${encodeURIComponent(e)}`
|
|
310
312
|
)
|
|
311
|
-
) :
|
|
313
|
+
) : h.request(ve("/field-watches/self", { collection: m, field: i, item_id: e })),
|
|
312
314
|
onSuccess: () => {
|
|
313
|
-
|
|
315
|
+
x.invalidateQueries({ queryKey: l }), oe.success(
|
|
314
316
|
g ? "No longer watching this field" : "Watching — you will be notified when it changes"
|
|
315
317
|
);
|
|
316
318
|
},
|
|
317
|
-
onError: () =>
|
|
319
|
+
onError: () => oe.error("Could not update the watch")
|
|
318
320
|
});
|
|
319
|
-
return
|
|
321
|
+
return s != null && s.enabled ? /* @__PURE__ */ n(
|
|
320
322
|
"button",
|
|
321
323
|
{
|
|
322
324
|
type: "button",
|
|
323
|
-
onClick: () =>
|
|
325
|
+
onClick: () => p.mutate(),
|
|
324
326
|
title: g ? "Stop watching this field on this record" : "Watch this field on this record",
|
|
325
327
|
"data-field-watch": i,
|
|
326
328
|
className: `rounded p-0.5 transition-colors ${g ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
|
|
327
|
-
children: g ? /* @__PURE__ */ n(
|
|
329
|
+
children: g ? /* @__PURE__ */ n($t, { className: "h-3 w-3" }) : /* @__PURE__ */ n(qt, { className: "h-3 w-3" })
|
|
328
330
|
}
|
|
329
331
|
) : null;
|
|
330
332
|
}
|
|
331
|
-
|
|
332
|
-
return s ? s.querySelector(
|
|
333
|
-
'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
|
|
334
|
-
) ?? s.querySelector("button") : null;
|
|
335
|
-
}
|
|
336
|
-
const pr = $t(function({
|
|
333
|
+
const gr = Tt(function({
|
|
337
334
|
field: e,
|
|
338
335
|
draft: i,
|
|
339
|
-
onChange:
|
|
340
|
-
relations:
|
|
341
|
-
collection:
|
|
336
|
+
onChange: h,
|
|
337
|
+
relations: x,
|
|
338
|
+
collection: s,
|
|
342
339
|
itemId: l,
|
|
343
340
|
error: w,
|
|
344
341
|
visible: g,
|
|
345
|
-
locked:
|
|
346
|
-
layoutAiEnabled:
|
|
342
|
+
locked: p,
|
|
343
|
+
layoutAiEnabled: o,
|
|
347
344
|
renderField: b,
|
|
348
|
-
onCountChange:
|
|
349
|
-
swapButton:
|
|
350
|
-
swapContent:
|
|
351
|
-
forceVisible:
|
|
345
|
+
onCountChange: a,
|
|
346
|
+
swapButton: f,
|
|
347
|
+
swapContent: W,
|
|
348
|
+
forceVisible: Ie,
|
|
352
349
|
autoFillTick: se
|
|
353
350
|
}) {
|
|
354
|
-
var
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
const
|
|
351
|
+
var Ke, Ue, He, We;
|
|
352
|
+
const V = qn.has(e.interface ?? ""), N = Pt(), y = un(), ke = Ze(), ce = ie(), [_e, z] = we(!1), c = Gt(), de = zt(), Ne = Kt(e.field), G = L(null), P = Et(), ue = L(null), Fe = L(!1), Ce = L({
|
|
353
|
+
required: !1,
|
|
354
|
+
hasError: !1
|
|
355
|
+
});
|
|
356
|
+
ae(() => {
|
|
357
|
+
const t = Fe.current ? nn(ue.current) : null;
|
|
358
|
+
if (!t || (rn(t, { ...Ce.current, errorId: `${P}-error` }), t.hasAttribute("aria-label"))) return;
|
|
359
|
+
t.id || (t.id = `${P}-control`);
|
|
360
|
+
const r = t.tagName === "BUTTON" ? `${P} ${t.id}` : P;
|
|
361
361
|
t.getAttribute("aria-labelledby") !== r && t.setAttribute("aria-labelledby", r);
|
|
362
362
|
});
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
const t =
|
|
363
|
+
const Re = p && !V, Le = L(null);
|
|
364
|
+
ae(() => {
|
|
365
|
+
const t = Le.current;
|
|
366
366
|
if (!t) return;
|
|
367
|
-
if (!
|
|
367
|
+
if (!Re) {
|
|
368
368
|
t.removeAttribute("inert");
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
const r = typeof document < "u" ? document.activeElement : null;
|
|
372
372
|
r instanceof HTMLElement && t.contains(r) && r.blur(), t.setAttribute("inert", "");
|
|
373
|
-
}, [
|
|
374
|
-
const
|
|
373
|
+
}, [Re, se]);
|
|
374
|
+
const Q = e.field, Se = ze(
|
|
375
375
|
(t) => {
|
|
376
|
-
|
|
376
|
+
p || h(Q, t);
|
|
377
377
|
},
|
|
378
|
-
[
|
|
379
|
-
),
|
|
380
|
-
(t) =>
|
|
381
|
-
[
|
|
382
|
-
),
|
|
383
|
-
onContextMenu:
|
|
384
|
-
onKeyDown:
|
|
385
|
-
menu:
|
|
386
|
-
confirmSaveFrom:
|
|
387
|
-
openedBy:
|
|
388
|
-
} =
|
|
389
|
-
wrapperRef:
|
|
378
|
+
[p, h, Q]
|
|
379
|
+
), et = ze(
|
|
380
|
+
(t) => a == null ? void 0 : a(Q, t),
|
|
381
|
+
[a, Q]
|
|
382
|
+
), tt = L(void 0), $e = L(void 0), qe = L(void 0), Ae = !p && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !Je(e), {
|
|
383
|
+
onContextMenu: nt,
|
|
384
|
+
onKeyDown: rt,
|
|
385
|
+
menu: lt,
|
|
386
|
+
confirmSaveFrom: at,
|
|
387
|
+
openedBy: me
|
|
388
|
+
} = Qt({
|
|
389
|
+
wrapperRef: G,
|
|
390
390
|
field: e,
|
|
391
391
|
value: i[e.field],
|
|
392
|
-
relations:
|
|
393
|
-
collection:
|
|
392
|
+
relations: x,
|
|
393
|
+
collection: s,
|
|
394
394
|
itemId: l,
|
|
395
|
-
openRelated:
|
|
396
|
-
editable:
|
|
397
|
-
}),
|
|
395
|
+
openRelated: c == null ? void 0 : c.openRelated,
|
|
396
|
+
editable: Ae
|
|
397
|
+
}), j = Yt(G), ot = fn(), Te = c == null ? void 0 : c.remoteChanges[e.field], M = c == null ? void 0 : c.lockReasons[e.field], T = c == null ? void 0 : c.applyToLines[e.field], R = Cn(), it = (R == null ? void 0 : R.applied(e.field)) ?? !1, Ee = (R == null ? void 0 : R.hintFor(e.field)) ?? null, pe = mn(R, e.field, Ae), he = () => {
|
|
398
398
|
var t, r;
|
|
399
|
-
return ((t =
|
|
400
|
-
},
|
|
401
|
-
async function
|
|
399
|
+
return ((t = ue.current) == null ? void 0 : t.querySelector(Ye)) ?? ((r = G.current) == null ? void 0 : r.querySelector(Ye));
|
|
400
|
+
}, Y = jt(e._overrides, o, An(e)), fe = !!(c != null && c.fromAutofill) && !!e._overrides && e._overrides[Bt] === !0;
|
|
401
|
+
async function st() {
|
|
402
402
|
var t;
|
|
403
|
-
if (
|
|
404
|
-
|
|
403
|
+
if (Y.perField) return ct();
|
|
404
|
+
z(!0);
|
|
405
405
|
try {
|
|
406
406
|
const r = await ce.request(
|
|
407
|
-
|
|
408
|
-
collection:
|
|
407
|
+
ve("/ai/generate", {
|
|
408
|
+
collection: s,
|
|
409
409
|
item_id: l !== "new" ? l : void 0,
|
|
410
410
|
field: e.field
|
|
411
411
|
})
|
|
412
412
|
);
|
|
413
|
-
((t = r.data) == null ? void 0 : t.value) != null &&
|
|
413
|
+
((t = r.data) == null ? void 0 : t.value) != null && h(e.field, r.data.value);
|
|
414
414
|
} catch {
|
|
415
415
|
} finally {
|
|
416
|
-
|
|
416
|
+
z(!1);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
async function
|
|
420
|
-
var r,
|
|
419
|
+
async function ct() {
|
|
420
|
+
var r, d, k, S;
|
|
421
421
|
const t = {};
|
|
422
|
-
for (const _ of ((r =
|
|
423
|
-
|
|
422
|
+
for (const _ of ((r = Dt(e._overrides)) == null ? void 0 : r.tokens) ?? []) _ in i && (t[_] = i[_]);
|
|
423
|
+
z(!0);
|
|
424
424
|
try {
|
|
425
425
|
const _ = await ce.request(
|
|
426
|
-
|
|
427
|
-
collection:
|
|
428
|
-
layout_id: (
|
|
426
|
+
ve("/ai/field-fill", {
|
|
427
|
+
collection: s,
|
|
428
|
+
layout_id: (c == null ? void 0 : c.layoutId) ?? null,
|
|
429
429
|
field: e.field,
|
|
430
430
|
item_id: l && l !== "new" ? l : null,
|
|
431
431
|
values: t
|
|
432
432
|
})
|
|
433
|
-
), F = (
|
|
434
|
-
typeof F == "string" && F !== "" ?
|
|
433
|
+
), F = (d = _.data) == null ? void 0 : d.value;
|
|
434
|
+
typeof F == "string" && F !== "" ? h(e.field, F) : oe.info("The AI had nothing to write here"), (S = (k = _.data) == null ? void 0 : k.missing) != null && S.length && oe.info(`Filled without ${_.data.missing.join(", ")} (empty or not visible to you)`);
|
|
435
435
|
} catch (_) {
|
|
436
|
-
|
|
436
|
+
Ot(_, "AI fill failed", { action: "Fill with AI" });
|
|
437
437
|
} finally {
|
|
438
|
-
|
|
438
|
+
z(!1);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
const r =
|
|
443
|
-
(k) => k.one_collection ===
|
|
441
|
+
const E = ln(e.dependency_config), Pe = E.flatMap((t) => {
|
|
442
|
+
const r = x.find(
|
|
443
|
+
(k) => k.one_collection === s && k.one_field === t.parent_field
|
|
444
444
|
);
|
|
445
445
|
if (!r) return [];
|
|
446
446
|
if (r.junction_field) return [{ rule: t, rel: r }];
|
|
447
|
-
const
|
|
447
|
+
const d = x.find(
|
|
448
448
|
(k) => k.many_collection === r.many_collection && k.id !== r.id
|
|
449
449
|
);
|
|
450
|
-
return
|
|
451
|
-
}),
|
|
452
|
-
queries:
|
|
450
|
+
return d != null && d.many_field ? [{ rule: t, rel: { ...r, junction_field: d.many_field } }] : [];
|
|
451
|
+
}), dt = kt({
|
|
452
|
+
queries: Pe.map(({ rel: t }) => ({
|
|
453
453
|
queryKey: ["m2m-items", t.many_collection, t.many_field, l],
|
|
454
454
|
queryFn: () => ce.request(
|
|
455
|
-
|
|
455
|
+
H(`/items/${t.many_collection}`, {
|
|
456
456
|
filter: JSON.stringify({ [t.many_field]: { _eq: l } }),
|
|
457
457
|
limit: 200,
|
|
458
458
|
fields: `id,${t.junction_field}`
|
|
@@ -461,42 +461,45 @@ const pr = $t(function({
|
|
|
461
461
|
enabled: !!l && l !== "new",
|
|
462
462
|
staleTime: 3e4
|
|
463
463
|
}))
|
|
464
|
-
}),
|
|
465
|
-
|
|
464
|
+
}), ut = Object.fromEntries(
|
|
465
|
+
Pe.map(({ rule: t, rel: r }, d) => {
|
|
466
466
|
var _;
|
|
467
|
-
const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`,
|
|
467
|
+
const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, S = (y == null ? void 0 : y.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
|
|
468
468
|
return [
|
|
469
469
|
t.parent_field,
|
|
470
|
-
(((_ =
|
|
470
|
+
(((_ = dt[d]) == null ? void 0 : _.data) ?? []).filter((F) => !S.has(F.id)).map((F) => F[r.junction_field])
|
|
471
471
|
];
|
|
472
472
|
})
|
|
473
|
-
),
|
|
474
|
-
if (!
|
|
473
|
+
), J = Wt()[e.field] ?? [];
|
|
474
|
+
if (!Ie && (!g || !e.layout_assigned && (e.hidden || an.has(e.field))))
|
|
475
475
|
return null;
|
|
476
|
-
const xe = i[e.field] ?? null,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
476
|
+
const xe = i[e.field] ?? null, X = xn(e, ot), C = X.label ?? U(e.field);
|
|
477
|
+
Fe.current = C !== "", Ce.current = {
|
|
478
|
+
required: !!(e.required || Ge(e.validation_rules, i)),
|
|
479
|
+
hasError: !!w
|
|
480
|
+
};
|
|
481
|
+
const q = Je(e), je = q ? null : yn(e), Be = q || !(l === "new" || !l || (Ke = N == null ? void 0 : N.dirtyFields) != null && Ke.has(e.field)) ? null : Fn(e, i), mt = !q && !p && !e.readonly && ((Ue = e._overrides) == null ? void 0 : Ue.repeat_last) === !0, pt = dn(e, i), ht = (We = (He = on(e.options)) == null ? void 0 : He.auto_id) == null ? void 0 : We.pattern, v = (() => {
|
|
482
|
+
const t = x.find(
|
|
483
|
+
(d) => d.one_collection === s && d.one_field === e.field
|
|
481
484
|
);
|
|
482
485
|
if (!t) return null;
|
|
483
486
|
if (t.junction_field) return t;
|
|
484
|
-
const r =
|
|
485
|
-
(
|
|
487
|
+
const r = x.find(
|
|
488
|
+
(d) => d.many_collection === t.many_collection && d.id !== t.id
|
|
486
489
|
);
|
|
487
490
|
return r ? { ...t, junction_field: r.many_field } : null;
|
|
488
|
-
})(),
|
|
491
|
+
})(), ye = v ? null : x.find((t) => t.many_collection === s && t.many_field === e.field) ?? null, be = v ? x.find(
|
|
489
492
|
(t) => t.many_collection === v.many_collection && t.many_field === v.junction_field && t.id !== v.id
|
|
490
|
-
) ?? null : null,
|
|
493
|
+
) ?? null : null, B = v ? v.one_field ?? `${v.many_collection}.${v.junction_field}` : null, De = B ? (y == null ? void 0 : y.getStagedLinks(B)) ?? [] : [], ft = v ? (ke.getQueryData([
|
|
491
494
|
"m2m-items",
|
|
492
495
|
v.many_collection,
|
|
493
496
|
v.many_field,
|
|
494
497
|
l
|
|
495
|
-
]) ?? []).map((t) => t[v.junction_field]) : [],
|
|
498
|
+
]) ?? []).map((t) => t[v.junction_field]) : [], Me = v ? De[0] ?? ft[0] ?? null : xe, xt = (be == null ? void 0 : be.one_collection) ?? (ye == null ? void 0 : ye.one_collection) ?? void 0, Z = (t) => {
|
|
496
499
|
var r;
|
|
497
|
-
return ((N == null ? void 0 : N.collection) ===
|
|
498
|
-
}, A =
|
|
499
|
-
rules:
|
|
500
|
+
return ((N == null ? void 0 : N.collection) === s ? (r = N == null ? void 0 : N.fieldLabels) == null ? void 0 : r[t] : void 0) ?? U(String(t));
|
|
501
|
+
}, A = sn({
|
|
502
|
+
rules: E,
|
|
500
503
|
// A parent whose value THIS field's own pick derived must not narrow this
|
|
501
504
|
// field's options — otherwise picking a region locks the region picker
|
|
502
505
|
// into the zone the pick itself filled, and cross-zone changes read as
|
|
@@ -507,50 +510,50 @@ const pr = $t(function({
|
|
|
507
510
|
},
|
|
508
511
|
parentValue: (t) => {
|
|
509
512
|
if (i[t] != null) return i[t];
|
|
510
|
-
const r =
|
|
513
|
+
const r = x.find(($) => $.one_collection === s && $.one_field === t);
|
|
511
514
|
if (!r) return null;
|
|
512
|
-
let
|
|
513
|
-
if (!
|
|
514
|
-
const
|
|
515
|
-
(
|
|
515
|
+
let d = r;
|
|
516
|
+
if (!d.junction_field) {
|
|
517
|
+
const $ = x.find(
|
|
518
|
+
(Ve) => Ve.many_collection === r.many_collection && Ve.id !== r.id
|
|
516
519
|
);
|
|
517
|
-
if (
|
|
520
|
+
if ($ != null && $.many_field) d = { ...r, junction_field: $.many_field };
|
|
518
521
|
else return null;
|
|
519
522
|
}
|
|
520
|
-
const k =
|
|
523
|
+
const k = d.one_field ?? `${d.many_collection}.${d.junction_field}`, S = (y == null ? void 0 : y.getStagedLinks(k)) ?? [], _ = ut[t] ?? [], F = [...new Set([...S, ..._].map(($) => String($)))];
|
|
521
524
|
return F.length === 0 ? null : F.length === 1 ? F[0] : F;
|
|
522
525
|
},
|
|
523
526
|
parentOptionFilter: (t) => {
|
|
524
|
-
var
|
|
525
|
-
const r = (N == null ? void 0 : N.collection) ===
|
|
526
|
-
return r ?
|
|
527
|
+
var d;
|
|
528
|
+
const r = (N == null ? void 0 : N.collection) === s ? (d = N.fieldOptionFilters) == null ? void 0 : d[t] : void 0;
|
|
529
|
+
return r ? Rn(r, i, l) : void 0;
|
|
527
530
|
}
|
|
528
|
-
}),
|
|
529
|
-
function
|
|
530
|
-
const t =
|
|
531
|
+
}), O = A.filter ? _n(tt, A.filter, Nn) : A.filter, K = A.satisfiedParents.map(Z), I = A.satisfiedParents, yt = A.unsatisfiedParents.length ? Z(A.unsatisfiedParents[0]) : null, ge = A.missingRequiredParents, Oe = ge.length ? Z(ge[0]) : null;
|
|
532
|
+
function bt() {
|
|
533
|
+
const t = qe.current;
|
|
531
534
|
if (t && t.src === e) return t.value;
|
|
532
535
|
const r = { ...e, readonly: !0 };
|
|
533
|
-
return
|
|
536
|
+
return qe.current = { src: e, value: r }, r;
|
|
534
537
|
}
|
|
535
|
-
function
|
|
536
|
-
const t =
|
|
537
|
-
|
|
538
|
+
function gt() {
|
|
539
|
+
const t = Tn(
|
|
540
|
+
I,
|
|
538
541
|
e.field,
|
|
539
542
|
y == null ? void 0 : y.getDerivedOrigin
|
|
540
|
-
), r = JSON.stringify([
|
|
541
|
-
if (
|
|
543
|
+
), r = JSON.stringify([K, I, t]), d = $e.current;
|
|
544
|
+
if (d && d.sig === r && d.onChange === h) return d.value;
|
|
542
545
|
const k = {
|
|
543
|
-
labels:
|
|
544
|
-
keys:
|
|
546
|
+
labels: K,
|
|
547
|
+
keys: I,
|
|
545
548
|
clearable: t,
|
|
546
|
-
onClear: t.length > 0 ? (
|
|
547
|
-
t.includes(
|
|
549
|
+
onClear: t.length > 0 ? (S) => {
|
|
550
|
+
t.includes(S) && h(S, null);
|
|
548
551
|
} : void 0
|
|
549
552
|
};
|
|
550
|
-
return
|
|
553
|
+
return $e.current = { sig: r, onChange: h, value: k }, k;
|
|
551
554
|
}
|
|
552
|
-
function
|
|
553
|
-
for (const t of
|
|
555
|
+
function vt() {
|
|
556
|
+
for (const t of I) {
|
|
554
557
|
const r = document.querySelector(`[data-field="${t}"]`);
|
|
555
558
|
r && (r.scrollIntoView({ behavior: "smooth", block: "center" }), r.style.transition = "box-shadow 0.15s ease", r.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", r.style.borderRadius = "12px", setTimeout(() => {
|
|
556
559
|
r.style.boxShadow = "none", setTimeout(() => {
|
|
@@ -559,103 +562,108 @@ const pr = $t(function({
|
|
|
559
562
|
}, 900));
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
565
|
+
const wt = () => {
|
|
566
|
+
const t = v && B ? Me : i[e.field];
|
|
567
|
+
if (t != null && t !== "" && !(Array.isArray(t) && !t.length) && (de == null || de({
|
|
568
|
+
field: e.field,
|
|
569
|
+
label: C || U(e.field),
|
|
570
|
+
parents: E.map((r) => r.parent_field).filter(Boolean)
|
|
571
|
+
})), v && B) {
|
|
572
|
+
for (const d of De) y == null || y.unstageLink(B, d);
|
|
573
|
+
const r = ke.getQueryData([
|
|
566
574
|
"m2m-items",
|
|
567
575
|
v.many_collection,
|
|
568
576
|
v.many_field,
|
|
569
577
|
l
|
|
570
578
|
]) ?? [];
|
|
571
|
-
for (const
|
|
579
|
+
for (const d of r) y == null || y.stageUnlink(B, d.id);
|
|
572
580
|
} else
|
|
573
|
-
|
|
581
|
+
h(e.field, null);
|
|
574
582
|
};
|
|
575
583
|
return (
|
|
576
584
|
// biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only hosts the field context menu (right-click / Shift+F10); the inputs inside stay the controls
|
|
577
585
|
/* @__PURE__ */ u(
|
|
578
586
|
"div",
|
|
579
587
|
{
|
|
580
|
-
ref:
|
|
588
|
+
ref: G,
|
|
581
589
|
"data-field": e.field,
|
|
582
|
-
"data-field-collection":
|
|
590
|
+
"data-field-collection": s,
|
|
583
591
|
"data-field-interface": e.interface ?? void 0,
|
|
584
|
-
"data-autofill-check":
|
|
585
|
-
className:
|
|
592
|
+
"data-autofill-check": fe ? "" : void 0,
|
|
593
|
+
className: D(
|
|
586
594
|
"group/fieldrow space-y-1.5",
|
|
587
|
-
|
|
595
|
+
fe && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
|
|
588
596
|
),
|
|
589
|
-
onContextMenu:
|
|
590
|
-
onKeyDown:
|
|
591
|
-
onFocusCapture:
|
|
597
|
+
onContextMenu: nt,
|
|
598
|
+
onKeyDown: rt,
|
|
599
|
+
onFocusCapture: j.onFocusCapture,
|
|
592
600
|
children: [
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
601
|
+
lt,
|
|
602
|
+
E.length > 0 && /* @__PURE__ */ n(
|
|
603
|
+
cn,
|
|
596
604
|
{
|
|
597
|
-
cascadeRules:
|
|
598
|
-
cascadeFilter:
|
|
599
|
-
currentValue:
|
|
600
|
-
relatedCollection:
|
|
601
|
-
missingRequiredParents:
|
|
602
|
-
onClear:
|
|
605
|
+
cascadeRules: E,
|
|
606
|
+
cascadeFilter: O,
|
|
607
|
+
currentValue: Me,
|
|
608
|
+
relatedCollection: xt,
|
|
609
|
+
missingRequiredParents: ge,
|
|
610
|
+
onClear: wt
|
|
603
611
|
}
|
|
604
612
|
),
|
|
605
|
-
(
|
|
613
|
+
(C !== "" || J.length > 0) && /* @__PURE__ */ u(
|
|
606
614
|
"div",
|
|
607
615
|
{
|
|
608
616
|
className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]",
|
|
609
|
-
"data-pd-row":
|
|
617
|
+
"data-pd-row": pe ? "" : void 0,
|
|
610
618
|
children: [
|
|
611
|
-
|
|
612
|
-
/* @__PURE__ */ n(
|
|
613
|
-
(e.required ||
|
|
614
|
-
|
|
619
|
+
C !== "" && /* @__PURE__ */ u(Ht, { id: P, "data-field-label": !0, className: "text-sm font-medium", children: [
|
|
620
|
+
/* @__PURE__ */ n(Qe, { text: C, collection: s }),
|
|
621
|
+
(e.required || Ge(e.validation_rules, i)) && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
|
|
622
|
+
bn(e) && /* @__PURE__ */ n(gn, {})
|
|
615
623
|
] }),
|
|
616
|
-
|
|
617
|
-
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(
|
|
618
|
-
/* @__PURE__ */ n(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (
|
|
624
|
+
X.note && /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ u(te, { children: [
|
|
625
|
+
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(Nt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
|
|
626
|
+
/* @__PURE__ */ n(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (c == null ? void 0 : c.glossaryHelp) === !1 ? X.note : /* @__PURE__ */ n(Qe, { text: X.note, collection: s }) })
|
|
619
627
|
] }) }),
|
|
620
|
-
|
|
628
|
+
Ne && /* @__PURE__ */ n(Ut, { source: Ne, label: C }),
|
|
621
629
|
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
622
|
-
|
|
630
|
+
jn,
|
|
623
631
|
{
|
|
624
|
-
collection:
|
|
632
|
+
collection: s,
|
|
625
633
|
itemId: l,
|
|
626
634
|
field: e.field,
|
|
627
|
-
onRestore: e.readonly ? void 0 : (t) =>
|
|
635
|
+
onRestore: e.readonly ? void 0 : (t) => h(e.field, t)
|
|
628
636
|
}
|
|
629
637
|
),
|
|
630
|
-
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
631
|
-
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
632
|
-
l && l !== "new" &&
|
|
633
|
-
|
|
634
|
-
|
|
638
|
+
!q && l && l !== "new" && /* @__PURE__ */ n(Bn, { collection: s, itemId: l, field: e.field }),
|
|
639
|
+
!q && l && l !== "new" && /* @__PURE__ */ n(It, { field: e.field, label: C || U(e.field) }),
|
|
640
|
+
l && l !== "new" && pt && /* @__PURE__ */ n(Pn, { collection: s, itemId: l, field: e.field }),
|
|
641
|
+
mt && /* @__PURE__ */ n(
|
|
642
|
+
vn,
|
|
635
643
|
{
|
|
636
|
-
collection:
|
|
644
|
+
collection: s,
|
|
637
645
|
itemId: l,
|
|
638
646
|
field: e.field,
|
|
639
|
-
label:
|
|
640
|
-
onFill: (t) =>
|
|
647
|
+
label: C || U(e.field),
|
|
648
|
+
onFill: (t) => h(e.field, t)
|
|
641
649
|
}
|
|
642
650
|
),
|
|
643
|
-
!q &&
|
|
651
|
+
!q && Y.show && !(Y.perField && (p || e.readonly)) && /* @__PURE__ */ u(
|
|
644
652
|
"button",
|
|
645
653
|
{
|
|
646
654
|
type: "button",
|
|
647
|
-
onClick:
|
|
648
|
-
disabled:
|
|
649
|
-
"data-ai-fill":
|
|
655
|
+
onClick: st,
|
|
656
|
+
disabled: _e,
|
|
657
|
+
"data-ai-fill": Y.perField ? e.field : void 0,
|
|
650
658
|
className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-50 transition-colors",
|
|
651
659
|
title: "Generate with AI",
|
|
652
660
|
children: [
|
|
653
|
-
|
|
661
|
+
_e ? /* @__PURE__ */ n(Ft, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(Ct, { className: "h-3 w-3" }),
|
|
654
662
|
"AI"
|
|
655
663
|
]
|
|
656
664
|
}
|
|
657
665
|
),
|
|
658
|
-
|
|
666
|
+
fe && /* @__PURE__ */ n(
|
|
659
667
|
"span",
|
|
660
668
|
{
|
|
661
669
|
"data-tip": "People often change what the AI read from the document here — check it",
|
|
@@ -663,8 +671,8 @@ const pr = $t(function({
|
|
|
663
671
|
children: "Check this"
|
|
664
672
|
}
|
|
665
673
|
),
|
|
666
|
-
|
|
667
|
-
T && !
|
|
674
|
+
f,
|
|
675
|
+
T && !p && !e.readonly && /* @__PURE__ */ u(
|
|
668
676
|
"button",
|
|
669
677
|
{
|
|
670
678
|
type: "button",
|
|
@@ -679,7 +687,7 @@ const pr = $t(function({
|
|
|
679
687
|
]
|
|
680
688
|
}
|
|
681
689
|
),
|
|
682
|
-
|
|
690
|
+
J.length > 0 && /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ u(te, { children: [
|
|
683
691
|
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
|
|
684
692
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
685
693
|
"addendum"
|
|
@@ -687,10 +695,10 @@ const pr = $t(function({
|
|
|
687
695
|
/* @__PURE__ */ u(re, { side: "top", className: "max-w-[220px] text-[12px]", children: [
|
|
688
696
|
/* @__PURE__ */ u("p", { className: "font-medium mb-1", children: [
|
|
689
697
|
"In active addendum",
|
|
690
|
-
|
|
698
|
+
J.length > 1 ? "s" : "",
|
|
691
699
|
":"
|
|
692
700
|
] }),
|
|
693
|
-
|
|
701
|
+
J.map((t) => /* @__PURE__ */ u("p", { className: "text-slate-400", children: [
|
|
694
702
|
t.title,
|
|
695
703
|
" ",
|
|
696
704
|
/* @__PURE__ */ u("span", { className: "capitalize", children: [
|
|
@@ -702,65 +710,65 @@ const pr = $t(function({
|
|
|
702
710
|
] })
|
|
703
711
|
] }) }),
|
|
704
712
|
/* @__PURE__ */ n(
|
|
705
|
-
|
|
713
|
+
tn,
|
|
706
714
|
{
|
|
707
|
-
collection:
|
|
715
|
+
collection: s,
|
|
708
716
|
kind: "field",
|
|
709
717
|
name: e.field,
|
|
710
|
-
label:
|
|
718
|
+
label: C
|
|
711
719
|
}
|
|
712
720
|
),
|
|
713
|
-
(
|
|
714
|
-
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(
|
|
721
|
+
(p || e.readonly) && M ? /* @__PURE__ */ n(Jt, { reason: M, onHover: c == null ? void 0 : c.onLockHover }) : p ? /* @__PURE__ */ n(ee, { delayDuration: 200, children: /* @__PURE__ */ u(te, { children: [
|
|
722
|
+
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(Rt, { className: "h-3 w-3" }) }) }),
|
|
715
723
|
/* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: "This field is locked" })
|
|
716
724
|
] }) }) : null,
|
|
717
|
-
|
|
718
|
-
const t = !!
|
|
719
|
-
(
|
|
725
|
+
E.length > 0 && (() => {
|
|
726
|
+
const t = !!O && Object.keys(O).length > 0 && K.length > 0, r = E.map(
|
|
727
|
+
(d) => Z(String(d.parent_field))
|
|
720
728
|
);
|
|
721
729
|
return /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ u(te, { children: [
|
|
722
730
|
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(
|
|
723
731
|
"button",
|
|
724
732
|
{
|
|
725
733
|
type: "button",
|
|
726
|
-
"aria-label": `Show the fields that narrow ${
|
|
727
|
-
onClick:
|
|
728
|
-
className:
|
|
734
|
+
"aria-label": `Show the fields that narrow ${C || "this list"}`,
|
|
735
|
+
onClick: vt,
|
|
736
|
+
className: D(
|
|
729
737
|
"inline-flex items-center transition-colors",
|
|
730
738
|
t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
|
|
731
739
|
),
|
|
732
|
-
children: /* @__PURE__ */ n(
|
|
740
|
+
children: /* @__PURE__ */ n(Lt, { className: "h-3 w-3" })
|
|
733
741
|
}
|
|
734
742
|
) }),
|
|
735
|
-
/* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${
|
|
743
|
+
/* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${K.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
|
|
736
744
|
] }) });
|
|
737
745
|
})(),
|
|
738
|
-
|
|
746
|
+
pe && // Right-anchored: the personal-default control flush with the field's right edge
|
|
739
747
|
// (it carries Make / Update / Clear itself — no ⋯ button; right-click and
|
|
740
748
|
// Shift+F10 still open the field menu). The slot keeps one box whatever it shows,
|
|
741
749
|
// so nothing to its left moves.
|
|
742
750
|
/* @__PURE__ */ n("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ n(
|
|
743
|
-
|
|
751
|
+
pn,
|
|
744
752
|
{
|
|
745
753
|
field: e.field,
|
|
746
|
-
label:
|
|
747
|
-
state:
|
|
748
|
-
confirmOpen:
|
|
754
|
+
label: C,
|
|
755
|
+
state: pe,
|
|
756
|
+
confirmOpen: me === "make" || me === "update" ? me : null,
|
|
749
757
|
onConfirm: (t, r) => (
|
|
750
758
|
// After a save the button becomes "Your default": focus goes to the field.
|
|
751
|
-
|
|
759
|
+
at(t, he, r)
|
|
752
760
|
),
|
|
753
761
|
onUndo: () => {
|
|
754
|
-
|
|
762
|
+
R == null || R.undo(e.field), requestAnimationFrame(() => {
|
|
755
763
|
var t;
|
|
756
|
-
return (t =
|
|
764
|
+
return (t = he()) == null ? void 0 : t.focus();
|
|
757
765
|
});
|
|
758
766
|
},
|
|
759
767
|
onCleared: () => (
|
|
760
768
|
// The Clear button is gone (and not a tab stop): focus goes to the field.
|
|
761
769
|
requestAnimationFrame(() => {
|
|
762
770
|
var t;
|
|
763
|
-
return (t =
|
|
771
|
+
return (t = he()) == null ? void 0 : t.focus();
|
|
764
772
|
})
|
|
765
773
|
)
|
|
766
774
|
}
|
|
@@ -768,42 +776,42 @@ const pr = $t(function({
|
|
|
768
776
|
]
|
|
769
777
|
}
|
|
770
778
|
),
|
|
771
|
-
|
|
772
|
-
|
|
779
|
+
j.editor && !p && /* @__PURE__ */ n(
|
|
780
|
+
Xt,
|
|
773
781
|
{
|
|
774
|
-
editor:
|
|
775
|
-
confirming:
|
|
776
|
-
onConfirm:
|
|
777
|
-
onCancel:
|
|
782
|
+
editor: j.editor,
|
|
783
|
+
confirming: j.confirming,
|
|
784
|
+
onConfirm: j.confirm,
|
|
785
|
+
onCancel: j.cancel
|
|
778
786
|
}
|
|
779
787
|
),
|
|
780
|
-
|
|
788
|
+
W ?? /* @__PURE__ */ n(
|
|
781
789
|
"div",
|
|
782
790
|
{
|
|
783
|
-
ref:
|
|
784
|
-
className:
|
|
785
|
-
"data-tip": (
|
|
786
|
-
onPointerEnter: (
|
|
791
|
+
ref: ue,
|
|
792
|
+
className: D(p && !V && "cursor-not-allowed"),
|
|
793
|
+
"data-tip": (p || e.readonly) && M ? M : void 0,
|
|
794
|
+
onPointerEnter: (p || e.readonly) && M ? c == null ? void 0 : c.onLockHover : void 0,
|
|
787
795
|
children: /* @__PURE__ */ n(
|
|
788
796
|
"div",
|
|
789
797
|
{
|
|
790
|
-
ref:
|
|
791
|
-
className:
|
|
798
|
+
ref: Le,
|
|
799
|
+
className: D(
|
|
792
800
|
// A locked FILE field stays interactive: its chips keep the
|
|
793
801
|
// download link and preview click (the component itself hides
|
|
794
802
|
// upload/replace/remove when readonly) — blocking pointer events
|
|
795
803
|
// made attachments unopenable on every locked form (addendum
|
|
796
804
|
// view, terminal states).
|
|
797
|
-
|
|
805
|
+
p && !V && "pointer-events-none opacity-60",
|
|
798
806
|
// The ring lands with a 2px shake so the eye finds the field;
|
|
799
807
|
// the animation runs once when the class is added.
|
|
800
808
|
w && "nvr-shake ring-1 ring-red-400 rounded-md",
|
|
801
809
|
se && "nvr-autofill-glow"
|
|
802
810
|
),
|
|
803
|
-
children: q ? /* @__PURE__ */ n(
|
|
804
|
-
|
|
811
|
+
children: q ? /* @__PURE__ */ n(wn, { field: e, values: i }) : ht ? /* @__PURE__ */ n(
|
|
812
|
+
Vt,
|
|
805
813
|
{
|
|
806
|
-
collection:
|
|
814
|
+
collection: s,
|
|
807
815
|
field: e,
|
|
808
816
|
draft: i,
|
|
809
817
|
itemId: l
|
|
@@ -811,27 +819,27 @@ const pr = $t(function({
|
|
|
811
819
|
) : b ? b({
|
|
812
820
|
field: e,
|
|
813
821
|
value: xe,
|
|
814
|
-
onChange:
|
|
815
|
-
disabled:
|
|
816
|
-
collection:
|
|
822
|
+
onChange: Se,
|
|
823
|
+
disabled: p,
|
|
824
|
+
collection: s,
|
|
817
825
|
itemId: l,
|
|
818
|
-
relations:
|
|
819
|
-
cascadeFilter:
|
|
820
|
-
unsatisfiedParentLabel:
|
|
821
|
-
requiredParentLabel:
|
|
826
|
+
relations: x,
|
|
827
|
+
cascadeFilter: O,
|
|
828
|
+
unsatisfiedParentLabel: yt,
|
|
829
|
+
requiredParentLabel: Oe
|
|
822
830
|
}) : /* @__PURE__ */ n(
|
|
823
|
-
|
|
831
|
+
en,
|
|
824
832
|
{
|
|
825
|
-
field:
|
|
833
|
+
field: p && V ? bt() : e,
|
|
826
834
|
value: xe,
|
|
827
|
-
onChange:
|
|
828
|
-
relations:
|
|
829
|
-
collection:
|
|
835
|
+
onChange: Se,
|
|
836
|
+
relations: x,
|
|
837
|
+
collection: s,
|
|
830
838
|
itemId: l,
|
|
831
|
-
cascadeFilter:
|
|
832
|
-
requiredParentLabel:
|
|
833
|
-
narrowedBy:
|
|
834
|
-
onCountChange:
|
|
839
|
+
cascadeFilter: O,
|
|
840
|
+
requiredParentLabel: Oe,
|
|
841
|
+
narrowedBy: K.length > 0 ? gt() : void 0,
|
|
842
|
+
onCountChange: a ? et : void 0
|
|
835
843
|
}
|
|
836
844
|
)
|
|
837
845
|
},
|
|
@@ -839,36 +847,38 @@ const pr = $t(function({
|
|
|
839
847
|
)
|
|
840
848
|
}
|
|
841
849
|
),
|
|
842
|
-
|
|
850
|
+
je && /* @__PURE__ */ n(kn, { value: i[e.field], config: je }),
|
|
843
851
|
w && // The message under the field: a red border alone never said WHY (Service End before
|
|
844
|
-
// Start, b01-N5). The form's summary at the top lists it too
|
|
852
|
+
// Start, b01-N5). The form's summary at the top lists it too — and is
|
|
853
|
+
// the ONE live announcement (army11 f3: ten role=alert regions fired at
|
|
854
|
+
// once); this message is tied to the control by aria-describedby.
|
|
845
855
|
/* @__PURE__ */ n(
|
|
846
856
|
"p",
|
|
847
857
|
{
|
|
848
|
-
|
|
858
|
+
id: `${P}-error`,
|
|
849
859
|
"data-field-error": e.field,
|
|
850
860
|
className: "text-[11.5px] leading-snug text-red-600 dark:text-red-400",
|
|
851
861
|
children: w
|
|
852
862
|
}
|
|
853
863
|
),
|
|
854
|
-
!w &&
|
|
864
|
+
!w && Be && // A soft (warning-only) rule the value breaks: said here, never blocks the save.
|
|
855
865
|
/* @__PURE__ */ n(
|
|
856
866
|
"p",
|
|
857
867
|
{
|
|
858
868
|
"data-field-warning": e.field,
|
|
859
869
|
className: "text-[11.5px] leading-snug text-amber-700 dark:text-amber-400",
|
|
860
|
-
children:
|
|
870
|
+
children: Be
|
|
861
871
|
}
|
|
862
872
|
),
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
873
|
+
Ee && !it && /* @__PURE__ */ n(hn, { field: e.field, text: Ee }),
|
|
874
|
+
Te && /* @__PURE__ */ n(
|
|
875
|
+
Zt,
|
|
866
876
|
{
|
|
867
|
-
change:
|
|
868
|
-
onDismiss: () =>
|
|
869
|
-
onTakeTheirs:
|
|
877
|
+
change: Te,
|
|
878
|
+
onDismiss: () => c == null ? void 0 : c.dismissRemoteChange(e.field),
|
|
879
|
+
onTakeTheirs: c != null && c.takeRemoteChange ? () => {
|
|
870
880
|
var t;
|
|
871
|
-
return (t =
|
|
881
|
+
return (t = c.takeRemoteChange) == null ? void 0 : t.call(c, e.field);
|
|
872
882
|
} : void 0
|
|
873
883
|
}
|
|
874
884
|
)
|
|
@@ -878,9 +888,9 @@ const pr = $t(function({
|
|
|
878
888
|
);
|
|
879
889
|
});
|
|
880
890
|
export {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
891
|
+
gr as FieldRow,
|
|
892
|
+
Tn as clearableParents,
|
|
893
|
+
An as isAiEligible,
|
|
894
|
+
br as lineageSummary,
|
|
895
|
+
En as useFieldLineage
|
|
886
896
|
};
|