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