@nivaro/react 0.3.33 → 0.3.35
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 +79 -5
- package/dist/index.js +338 -329
- package/dist/shared/components/ItemEditForm.js +5274 -5069
- package/dist/shared/components/ProfileView.js +46 -44
- package/dist/shared/components/ReportView.js +208 -205
- package/dist/shared/components/SearchHighlight.js +30 -0
- package/dist/shared/components/TipLayer.js +39 -37
- package/dist/shared/components/item-edit/CatalogPickerField.js +1484 -1232
- package/dist/shared/components/item-edit/FieldAffordances.js +424 -213
- package/dist/shared/components/item-edit/FieldRow.js +475 -427
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +211 -0
- package/dist/shared/components/item-edit/PersonalDefaultPill.js +20 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -110
- package/dist/shared/components/item-edit/RelationCombobox.js +42 -41
- package/dist/shared/components/item-edit/catalog-search.js +34 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +43 -43
- package/dist/shared/components/item-edit/live-record-marks.js +13 -0
- package/dist/shared/components/item-edit/personal-default-checks.js +134 -0
- package/dist/shared/components/item-edit/usePersonalDefaults.js +442 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +130 -111
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +76 -75
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/profile/MyDefaultsCard.js +667 -0
- package/dist/shared/components/profile/PersonProfile.js +42 -40
- package/dist/shared/components/profile/my-defaults-labels.js +76 -0
- package/dist/shared/components/profile/primitives.js +72 -67
- package/dist/shared/lib/personal-defaults.js +76 -0
- package/dist/shared/lib/request-gate.js +78 -76
- package/dist/shared/lib/search-text.js +111 -0
- package/package.json +1 -1
|
@@ -1,27 +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
|
|
12
|
-
import { TooltipProvider as
|
|
13
|
-
import { useAddendumFields as
|
|
14
|
-
import { AutoIdPreviewField as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
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
|
+
import { TooltipProvider as ee, Tooltip as te, TooltipTrigger as ne, TooltipContent as re } from "../ui/tooltip.js";
|
|
13
|
+
import { useAddendumFields as Et } from "./AddendumFieldContext.js";
|
|
14
|
+
import { AutoIdPreviewField as Pt } from "./AutoIdPreviewField.js";
|
|
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([
|
|
25
29
|
"input",
|
|
26
30
|
"textarea",
|
|
27
31
|
"wysiwyg",
|
|
@@ -29,7 +33,7 @@ const It = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
29
33
|
"input-rich-text-html",
|
|
30
34
|
"rich_text",
|
|
31
35
|
"extension-editorjs"
|
|
32
|
-
]),
|
|
36
|
+
]), fn = /* @__PURE__ */ new Set([
|
|
33
37
|
"relation-m2o",
|
|
34
38
|
"relation-m2m",
|
|
35
39
|
"select-multiple-m2m",
|
|
@@ -40,108 +44,108 @@ const It = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
40
44
|
"file",
|
|
41
45
|
"files",
|
|
42
46
|
"image"
|
|
43
|
-
]),
|
|
44
|
-
function
|
|
47
|
+
]), yn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
|
|
48
|
+
function bn(d) {
|
|
45
49
|
const e = d.interface ?? "";
|
|
46
|
-
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));
|
|
47
51
|
}
|
|
48
|
-
function
|
|
49
|
-
const f =
|
|
50
|
-
return
|
|
51
|
-
queryKey: ["field-lineage", d, e,
|
|
52
|
+
function gn(d, e, m, p) {
|
|
53
|
+
const f = oe();
|
|
54
|
+
return le({
|
|
55
|
+
queryKey: ["field-lineage", d, e, m],
|
|
52
56
|
queryFn: () => f.request(
|
|
53
|
-
|
|
54
|
-
).then((
|
|
57
|
+
H(`/lineage/${d}/${encodeURIComponent(e)}/${m}`)
|
|
58
|
+
).then((i) => i.data),
|
|
55
59
|
enabled: p,
|
|
56
60
|
staleTime: 3e4
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
|
-
function
|
|
63
|
+
function Xn(d, e = "rows") {
|
|
60
64
|
var l, N, b;
|
|
61
65
|
if (d && (d.kind === "write" || d.kind === "read") && d.formula) {
|
|
62
|
-
const
|
|
66
|
+
const u = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
|
|
63
67
|
return `= ${d.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, a) => {
|
|
64
68
|
var x;
|
|
65
|
-
return
|
|
69
|
+
return u((x = d.inputs) == null ? void 0 : x[a]);
|
|
66
70
|
}).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
|
|
67
71
|
}
|
|
68
72
|
if (!d || d.kind !== "rollup") return null;
|
|
69
|
-
const
|
|
73
|
+
const m = (d.sources ?? []).reduce((u, o) => u + o.rows.length, 0), p = (d.sources ?? []).reduce((u, o) => {
|
|
70
74
|
var y;
|
|
71
|
-
return
|
|
72
|
-
}, 0), f = (b = (N = (l = (d.sources ?? []).find((
|
|
73
|
-
var
|
|
74
|
-
return (
|
|
75
|
-
})) == null ? void 0 : l.excluded) == null ? void 0 : N[0]) == null ? void 0 : b.reason,
|
|
76
|
-
return p &&
|
|
75
|
+
return u + (((y = o.excluded) == null ? void 0 : y.length) ?? 0);
|
|
76
|
+
}, 0), f = (b = (N = (l = (d.sources ?? []).find((u) => {
|
|
77
|
+
var o;
|
|
78
|
+
return (o = u.excluded) == null ? void 0 : o.length;
|
|
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(
|
|
77
81
|
`${p} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
|
|
78
|
-
),
|
|
82
|
+
), i.join(" · ");
|
|
79
83
|
}
|
|
80
|
-
function
|
|
84
|
+
function vn({
|
|
81
85
|
collection: d,
|
|
82
86
|
itemId: e,
|
|
83
|
-
field:
|
|
87
|
+
field: m
|
|
84
88
|
}) {
|
|
85
|
-
const [p, f] =
|
|
86
|
-
|
|
89
|
+
const [p, f] = we(!1), i = R(null), { data: l, isLoading: N } = gn(d, e, m, p);
|
|
90
|
+
ae(() => {
|
|
87
91
|
if (!p) return;
|
|
88
|
-
const
|
|
92
|
+
const o = (y) => {
|
|
89
93
|
var a;
|
|
90
|
-
(a =
|
|
94
|
+
(a = i.current) != null && a.contains(y.target) || f(!1);
|
|
91
95
|
};
|
|
92
|
-
return window.addEventListener("mousedown",
|
|
96
|
+
return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
|
|
93
97
|
}, [p]);
|
|
94
|
-
const b = (
|
|
95
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
96
|
-
/* @__PURE__ */
|
|
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(
|
|
97
101
|
"button",
|
|
98
102
|
{
|
|
99
103
|
type: "button",
|
|
100
|
-
onClick: () => f((
|
|
104
|
+
onClick: () => f((o) => !o),
|
|
101
105
|
title: "Where does this number come from?",
|
|
102
|
-
className:
|
|
106
|
+
className: D(
|
|
103
107
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
104
108
|
p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
105
109
|
),
|
|
106
110
|
"data-field-lineage": !0,
|
|
107
|
-
children: /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ r(Ft, { className: "h-3 w-3" })
|
|
108
112
|
}
|
|
109
113
|
),
|
|
110
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: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
N && /* @__PURE__ */
|
|
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…" }),
|
|
113
117
|
(l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ c("div", { className: "space-y-1 px-1 py-1", children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
Object.entries(l.inputs ?? {}).map(([
|
|
116
|
-
/* @__PURE__ */
|
|
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 }),
|
|
117
121
|
" = ",
|
|
118
122
|
b(y)
|
|
119
|
-
] },
|
|
123
|
+
] }, o)),
|
|
120
124
|
/* @__PURE__ */ c("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
|
|
121
125
|
"= ",
|
|
122
126
|
b(l.stored_value)
|
|
123
127
|
] })
|
|
124
128
|
] }),
|
|
125
|
-
(l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((
|
|
129
|
+
(l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((o, y) => {
|
|
126
130
|
var a;
|
|
127
131
|
return /* @__PURE__ */ c("div", { className: "mb-1.5", children: [
|
|
128
132
|
/* @__PURE__ */ c("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
|
|
129
|
-
(
|
|
130
|
-
|
|
133
|
+
(o.aggregate ?? "sum").toUpperCase(),
|
|
134
|
+
o.value_field ? ` of ${o.value_field}` : "",
|
|
131
135
|
" across ",
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
o.collection,
|
|
137
|
+
o.filtered ? " (filtered)" : ""
|
|
134
138
|
] }),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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(
|
|
138
142
|
"div",
|
|
139
143
|
{
|
|
140
144
|
className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
|
|
141
145
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__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(
|
|
145
149
|
"span",
|
|
146
150
|
{
|
|
147
151
|
className: "w-[88px] shrink-0 truncate text-right text-[10px] text-slate-400",
|
|
@@ -153,95 +157,95 @@ function on({
|
|
|
153
157
|
},
|
|
154
158
|
x.id
|
|
155
159
|
)) }),
|
|
156
|
-
|
|
157
|
-
|
|
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." }),
|
|
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: [
|
|
158
162
|
"subtotal ",
|
|
159
|
-
b(
|
|
163
|
+
b(o.subtotal)
|
|
160
164
|
] }),
|
|
161
|
-
(((a =
|
|
165
|
+
(((a = o.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ c("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
|
|
162
166
|
/* @__PURE__ */ c("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
163
|
-
|
|
167
|
+
o.excluded.length,
|
|
164
168
|
" excluded —",
|
|
165
169
|
" ",
|
|
166
|
-
|
|
170
|
+
o.excluded[0].reason.replace(/^does not match: /, "")
|
|
167
171
|
] }),
|
|
168
|
-
|
|
172
|
+
o.excluded.slice(0, 8).map((x) => /* @__PURE__ */ c(
|
|
169
173
|
"div",
|
|
170
174
|
{
|
|
171
175
|
className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
|
|
172
176
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__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) })
|
|
175
179
|
]
|
|
176
180
|
},
|
|
177
181
|
x.id
|
|
178
182
|
)),
|
|
179
|
-
|
|
183
|
+
o.excluded.length > 8 && /* @__PURE__ */ c("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
|
|
180
184
|
"+",
|
|
181
|
-
|
|
185
|
+
o.excluded.length - 8,
|
|
182
186
|
" more"
|
|
183
187
|
] })
|
|
184
188
|
] })
|
|
185
189
|
] }, y);
|
|
186
190
|
}),
|
|
187
|
-
(l == null ? void 0 : l.kind) === "rollup" &&
|
|
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: [
|
|
188
192
|
"stored ",
|
|
189
|
-
b(
|
|
193
|
+
b(u),
|
|
190
194
|
(() => {
|
|
191
|
-
const
|
|
192
|
-
return (l.sources ?? []).some((a) => a.truncated) ? null : Math.abs(
|
|
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" });
|
|
193
197
|
})()
|
|
194
198
|
] })
|
|
195
199
|
] })
|
|
196
200
|
] });
|
|
197
201
|
}
|
|
198
|
-
function
|
|
202
|
+
function wn({
|
|
199
203
|
collection: d,
|
|
200
204
|
itemId: e,
|
|
201
|
-
field:
|
|
205
|
+
field: m,
|
|
202
206
|
formatValue: p,
|
|
203
207
|
onRestore: f
|
|
204
208
|
}) {
|
|
205
|
-
const
|
|
206
|
-
queryKey: ["field-value-history", d, e,
|
|
207
|
-
queryFn: () =>
|
|
209
|
+
const i = oe(), [l, N] = we(!1), b = R(null), { data: u, isLoading: o } = le({
|
|
210
|
+
queryKey: ["field-value-history", d, e, m],
|
|
211
|
+
queryFn: () => i.request(H(`/field-history/${d}/${encodeURIComponent(e)}/${m}`)).then((a) => a.data ?? []),
|
|
208
212
|
enabled: l,
|
|
209
213
|
staleTime: 6e4
|
|
210
214
|
});
|
|
211
|
-
|
|
215
|
+
ae(() => {
|
|
212
216
|
if (!l) return;
|
|
213
217
|
const a = (x) => {
|
|
214
|
-
var
|
|
215
|
-
(
|
|
218
|
+
var W;
|
|
219
|
+
(W = b.current) != null && W.contains(x.target) || N(!1);
|
|
216
220
|
};
|
|
217
221
|
return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
|
|
218
222
|
}, [l]);
|
|
219
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));
|
|
220
224
|
return /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex", children: [
|
|
221
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ r(
|
|
222
226
|
"button",
|
|
223
227
|
{
|
|
224
228
|
type: "button",
|
|
225
229
|
onClick: () => N((a) => !a),
|
|
226
230
|
title: "Value history",
|
|
227
|
-
className:
|
|
231
|
+
className: D(
|
|
228
232
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
229
233
|
l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
230
234
|
),
|
|
231
235
|
"data-field-history": !0,
|
|
232
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ r(kt, { className: "h-3 w-3" })
|
|
233
237
|
}
|
|
234
238
|
),
|
|
235
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: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
|
|
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(
|
|
238
242
|
"div",
|
|
239
243
|
{
|
|
240
244
|
className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
|
|
241
245
|
children: [
|
|
242
246
|
/* @__PURE__ */ c("span", { className: "flex items-baseline justify-between gap-2", children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
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(
|
|
245
249
|
"button",
|
|
246
250
|
{
|
|
247
251
|
type: "button",
|
|
@@ -257,7 +261,7 @@ function sn({
|
|
|
257
261
|
a.action === "create" ? "initial value" : "changed",
|
|
258
262
|
a.timestamp ? ` · ${new Date(a.timestamp).toLocaleString()}` : "",
|
|
259
263
|
a.user_name ? ` · ${a.user_name}` : "",
|
|
260
|
-
a.origin && a.origin.kind !== "user" && /* @__PURE__ */
|
|
264
|
+
a.origin && a.origin.kind !== "user" && /* @__PURE__ */ r(
|
|
261
265
|
"span",
|
|
262
266
|
{
|
|
263
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",
|
|
@@ -277,274 +281,280 @@ function sn({
|
|
|
277
281
|
] })
|
|
278
282
|
] });
|
|
279
283
|
}
|
|
280
|
-
function
|
|
284
|
+
function kn({
|
|
281
285
|
collection: d,
|
|
282
286
|
itemId: e,
|
|
283
|
-
field:
|
|
287
|
+
field: m
|
|
284
288
|
}) {
|
|
285
|
-
const p =
|
|
289
|
+
const p = oe(), f = We(), { data: i } = le({
|
|
286
290
|
queryKey: ["field-watch-config"],
|
|
287
|
-
queryFn: () => p.request(
|
|
291
|
+
queryFn: () => p.request(H("/field-watches/config")).then((o) => o.data).catch(() => ({ enabled: !1 })),
|
|
288
292
|
staleTime: 5 * 6e4
|
|
289
|
-
}), l = ["field-watch-self", d, e], { data: N = [] } =
|
|
293
|
+
}), l = ["field-watch-self", d, e], { data: N = [] } = le({
|
|
290
294
|
queryKey: l,
|
|
291
|
-
queryFn: () => p.request(
|
|
292
|
-
enabled: !!(
|
|
295
|
+
queryFn: () => p.request(H("/field-watches/self", { collection: d, item_id: e })).then((o) => o.data ?? []).catch(() => []),
|
|
296
|
+
enabled: !!(i != null && i.enabled),
|
|
293
297
|
staleTime: 6e4
|
|
294
|
-
}), b = N.includes(
|
|
298
|
+
}), b = N.includes(m), u = ft({
|
|
295
299
|
mutationFn: () => b ? p.request(
|
|
296
|
-
|
|
297
|
-
`/field-watches/self?collection=${encodeURIComponent(d)}&field=${encodeURIComponent(
|
|
300
|
+
Tt(
|
|
301
|
+
`/field-watches/self?collection=${encodeURIComponent(d)}&field=${encodeURIComponent(m)}&item_id=${encodeURIComponent(e)}`
|
|
298
302
|
)
|
|
299
|
-
) : p.request(
|
|
303
|
+
) : p.request(ve("/field-watches/self", { collection: d, field: m, item_id: e })),
|
|
300
304
|
onSuccess: () => {
|
|
301
|
-
f.invalidateQueries({ queryKey: l }),
|
|
305
|
+
f.invalidateQueries({ queryKey: l }), U.success(
|
|
302
306
|
b ? "No longer watching this field" : "Watching — you will be notified when it changes"
|
|
303
307
|
);
|
|
304
308
|
},
|
|
305
|
-
onError: () =>
|
|
309
|
+
onError: () => U.error("Could not update the watch")
|
|
306
310
|
});
|
|
307
|
-
return
|
|
311
|
+
return i != null && i.enabled ? /* @__PURE__ */ r(
|
|
308
312
|
"button",
|
|
309
313
|
{
|
|
310
314
|
type: "button",
|
|
311
|
-
onClick: () =>
|
|
315
|
+
onClick: () => u.mutate(),
|
|
312
316
|
title: b ? "Stop watching this field on this record" : "Watch this field on this record",
|
|
313
|
-
"data-field-watch":
|
|
317
|
+
"data-field-watch": m,
|
|
314
318
|
className: `rounded p-0.5 transition-colors ${b ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
|
|
315
|
-
children: b ? /* @__PURE__ */
|
|
319
|
+
children: b ? /* @__PURE__ */ r(_t, { className: "h-3 w-3" }) : /* @__PURE__ */ r(Nt, { className: "h-3 w-3" })
|
|
316
320
|
}
|
|
317
321
|
) : null;
|
|
318
322
|
}
|
|
319
|
-
function
|
|
323
|
+
function _n(d) {
|
|
320
324
|
return d ? d.querySelector(
|
|
321
325
|
'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
|
|
322
326
|
) ?? d.querySelector("button") : null;
|
|
323
327
|
}
|
|
324
|
-
const
|
|
328
|
+
const Zn = Ct(function({
|
|
325
329
|
field: e,
|
|
326
|
-
draft:
|
|
330
|
+
draft: m,
|
|
327
331
|
onChange: p,
|
|
328
332
|
relations: f,
|
|
329
|
-
collection:
|
|
333
|
+
collection: i,
|
|
330
334
|
itemId: l,
|
|
331
335
|
error: N,
|
|
332
336
|
visible: b,
|
|
333
|
-
locked:
|
|
334
|
-
layoutAiEnabled:
|
|
337
|
+
locked: u,
|
|
338
|
+
layoutAiEnabled: o,
|
|
335
339
|
renderField: y,
|
|
336
340
|
onCountChange: a,
|
|
337
341
|
swapButton: x,
|
|
338
|
-
swapContent:
|
|
339
|
-
forceVisible:
|
|
340
|
-
autoFillTick:
|
|
342
|
+
swapContent: W,
|
|
343
|
+
forceVisible: Ve,
|
|
344
|
+
autoFillTick: ie
|
|
341
345
|
}) {
|
|
342
|
-
var
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const t =
|
|
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);
|
|
348
|
+
ae(() => {
|
|
349
|
+
const t = Ne.current ? _n(de.current) : null;
|
|
346
350
|
if (!t || t.hasAttribute("aria-label")) return;
|
|
347
|
-
t.id || (t.id = `${
|
|
348
|
-
const
|
|
349
|
-
t.getAttribute("aria-labelledby") !==
|
|
351
|
+
t.id || (t.id = `${Q}-control`);
|
|
352
|
+
const n = t.tagName === "BUTTON" ? `${Q} ${t.id}` : Q;
|
|
353
|
+
t.getAttribute("aria-labelledby") !== n && t.setAttribute("aria-labelledby", n);
|
|
350
354
|
});
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const t =
|
|
355
|
+
const Fe = u && !V, Ce = R(null);
|
|
356
|
+
ae(() => {
|
|
357
|
+
const t = Ce.current;
|
|
354
358
|
if (!t) return;
|
|
355
|
-
if (!
|
|
359
|
+
if (!Fe) {
|
|
356
360
|
t.removeAttribute("inert");
|
|
357
361
|
return;
|
|
358
362
|
}
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
}, [
|
|
362
|
-
const
|
|
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(
|
|
363
367
|
(t) => {
|
|
364
|
-
|
|
368
|
+
u || p(Y, t);
|
|
365
369
|
},
|
|
366
|
-
[
|
|
367
|
-
),
|
|
368
|
-
(t) => a == null ? void 0 : a(
|
|
369
|
-
[a,
|
|
370
|
-
),
|
|
371
|
-
onContextMenu:
|
|
372
|
-
onKeyDown:
|
|
373
|
-
menu:
|
|
374
|
-
|
|
375
|
-
|
|
370
|
+
[u, p, Y]
|
|
371
|
+
), ze = Me(
|
|
372
|
+
(t) => a == null ? void 0 : a(Y, t),
|
|
373
|
+
[a, Y]
|
|
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
|
+
wrapperRef: G,
|
|
376
382
|
field: e,
|
|
377
|
-
value:
|
|
383
|
+
value: m[e.field],
|
|
378
384
|
relations: f,
|
|
379
|
-
collection:
|
|
385
|
+
collection: i,
|
|
380
386
|
itemId: l,
|
|
381
|
-
openRelated: s == null ? void 0 : s.openRelated
|
|
382
|
-
|
|
383
|
-
|
|
387
|
+
openRelated: s == null ? void 0 : s.openRelated,
|
|
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() {
|
|
384
394
|
var t;
|
|
385
|
-
if (
|
|
386
|
-
|
|
395
|
+
if (J.perField) return tt();
|
|
396
|
+
z(!0);
|
|
387
397
|
try {
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
collection:
|
|
398
|
+
const n = await se.request(
|
|
399
|
+
ve("/ai/generate", {
|
|
400
|
+
collection: i,
|
|
391
401
|
item_id: l !== "new" ? l : void 0,
|
|
392
402
|
field: e.field
|
|
393
403
|
})
|
|
394
404
|
);
|
|
395
|
-
((t =
|
|
405
|
+
((t = n.data) == null ? void 0 : t.value) != null && p(e.field, n.data.value);
|
|
396
406
|
} catch {
|
|
397
407
|
} finally {
|
|
398
|
-
|
|
408
|
+
z(!1);
|
|
399
409
|
}
|
|
400
410
|
}
|
|
401
|
-
async function
|
|
402
|
-
var
|
|
411
|
+
async function tt() {
|
|
412
|
+
var n, h, k, j, T, F;
|
|
403
413
|
const t = {};
|
|
404
|
-
for (const v of ((
|
|
405
|
-
|
|
414
|
+
for (const v of ((n = qt(e._overrides)) == null ? void 0 : n.tokens) ?? []) v in m && (t[v] = m[v]);
|
|
415
|
+
z(!0);
|
|
406
416
|
try {
|
|
407
|
-
const v = await
|
|
408
|
-
|
|
409
|
-
collection:
|
|
417
|
+
const v = await se.request(
|
|
418
|
+
ve("/ai/field-fill", {
|
|
419
|
+
collection: i,
|
|
410
420
|
layout_id: (s == null ? void 0 : s.layoutId) ?? null,
|
|
411
421
|
field: e.field,
|
|
412
422
|
item_id: l && l !== "new" ? l : null,
|
|
413
423
|
values: t
|
|
414
424
|
})
|
|
415
425
|
), _ = (h = v.data) == null ? void 0 : h.value;
|
|
416
|
-
typeof _ == "string" && _ !== "" ? p(e.field, _) :
|
|
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)`);
|
|
417
427
|
} catch (v) {
|
|
418
428
|
const _ = v;
|
|
419
|
-
|
|
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");
|
|
420
430
|
} finally {
|
|
421
|
-
|
|
431
|
+
z(!1);
|
|
422
432
|
}
|
|
423
433
|
}
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
(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
|
|
427
437
|
);
|
|
428
|
-
if (!
|
|
429
|
-
if (
|
|
438
|
+
if (!n) return [];
|
|
439
|
+
if (n.junction_field) return [{ rule: t, rel: n }];
|
|
430
440
|
const h = f.find(
|
|
431
|
-
(k) => k.many_collection ===
|
|
441
|
+
(k) => k.many_collection === n.many_collection && k.id !== n.id
|
|
432
442
|
);
|
|
433
|
-
return h != null && h.many_field ? [{ rule: t, rel: { ...
|
|
434
|
-
}),
|
|
435
|
-
queries:
|
|
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 }) => ({
|
|
436
446
|
queryKey: ["m2m-items", t.many_collection, t.many_field, l],
|
|
437
|
-
queryFn: () =>
|
|
438
|
-
|
|
447
|
+
queryFn: () => se.request(
|
|
448
|
+
H(`/items/${t.many_collection}`, {
|
|
439
449
|
filter: JSON.stringify({ [t.many_field]: { _eq: l } }),
|
|
440
450
|
limit: 200,
|
|
441
451
|
fields: `id,${t.junction_field}`
|
|
442
452
|
})
|
|
443
|
-
).then((
|
|
453
|
+
).then((n) => n.data ?? []),
|
|
444
454
|
enabled: !!l && l !== "new",
|
|
445
455
|
staleTime: 3e4
|
|
446
456
|
}))
|
|
447
|
-
}),
|
|
448
|
-
|
|
457
|
+
}), rt = Object.fromEntries(
|
|
458
|
+
Ae.map(({ rule: t, rel: n }, h) => {
|
|
449
459
|
var T;
|
|
450
|
-
const k =
|
|
460
|
+
const k = n.one_field ?? `${n.many_collection}.${n.junction_field}`, j = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
|
|
451
461
|
return [
|
|
452
462
|
t.parent_field,
|
|
453
|
-
(((T =
|
|
463
|
+
(((T = nt[h]) == null ? void 0 : T.data) ?? []).filter((F) => !j.has(F.id)).map((F) => F[n.junction_field])
|
|
454
464
|
];
|
|
455
465
|
})
|
|
456
|
-
),
|
|
457
|
-
if (!
|
|
466
|
+
), X = Et()[e.field] ?? [];
|
|
467
|
+
if (!Ve && (!b || !e.layout_assigned && (e.hidden || Vt.has(e.field))))
|
|
458
468
|
return null;
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
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 = (() => {
|
|
462
472
|
const t = f.find(
|
|
463
|
-
(h) => h.one_collection ===
|
|
473
|
+
(h) => h.one_collection === i && h.one_field === e.field
|
|
464
474
|
);
|
|
465
475
|
if (!t) return null;
|
|
466
476
|
if (t.junction_field) return t;
|
|
467
|
-
const
|
|
477
|
+
const n = f.find(
|
|
468
478
|
(h) => h.many_collection === t.many_collection && h.id !== t.id
|
|
469
479
|
);
|
|
470
|
-
return
|
|
471
|
-
})(),
|
|
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(
|
|
472
482
|
(t) => t.many_collection === w.many_collection && t.many_field === w.junction_field && t.id !== w.id
|
|
473
|
-
) ?? 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([
|
|
474
484
|
"m2m-items",
|
|
475
485
|
w.many_collection,
|
|
476
486
|
w.many_field,
|
|
477
487
|
l
|
|
478
|
-
]) ?? []).map((t) => t[w.junction_field]) : [],
|
|
479
|
-
var
|
|
480
|
-
return ((C == null ? void 0 : C.collection) ===
|
|
481
|
-
},
|
|
482
|
-
rules:
|
|
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({
|
|
492
|
+
rules: E,
|
|
483
493
|
// A parent whose value THIS field's own pick derived must not narrow this
|
|
484
494
|
// field's options — otherwise picking a region locks the region picker
|
|
485
495
|
// into the zone the pick itself filled, and cross-zone changes read as
|
|
486
496
|
// "No results".
|
|
487
497
|
skipParent: (t) => {
|
|
488
|
-
var
|
|
489
|
-
return ((
|
|
498
|
+
var n;
|
|
499
|
+
return ((n = g == null ? void 0 : g.getDerivedOrigin) == null ? void 0 : n.call(g, t)) === e.field;
|
|
490
500
|
},
|
|
491
501
|
parentValue: (t) => {
|
|
492
|
-
if (
|
|
493
|
-
const
|
|
494
|
-
if (!
|
|
495
|
-
let h =
|
|
502
|
+
if (m[t] != null) return m[t];
|
|
503
|
+
const n = f.find((v) => v.one_collection === i && v.one_field === t);
|
|
504
|
+
if (!n) return null;
|
|
505
|
+
let h = n;
|
|
496
506
|
if (!h.junction_field) {
|
|
497
507
|
const v = f.find(
|
|
498
|
-
(_) => _.many_collection ===
|
|
508
|
+
(_) => _.many_collection === n.many_collection && _.id !== n.id
|
|
499
509
|
);
|
|
500
|
-
if (v != null && v.many_field) h = { ...
|
|
510
|
+
if (v != null && v.many_field) h = { ...n, junction_field: v.many_field };
|
|
501
511
|
else return null;
|
|
502
512
|
}
|
|
503
|
-
const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, j = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], T =
|
|
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)))];
|
|
504
514
|
return F.length === 0 ? null : F.length === 1 ? F[0] : F;
|
|
505
515
|
},
|
|
506
516
|
parentOptionFilter: (t) => {
|
|
507
517
|
var h;
|
|
508
|
-
const
|
|
509
|
-
return
|
|
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;
|
|
510
520
|
}
|
|
511
|
-
}),
|
|
512
|
-
function
|
|
513
|
-
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;
|
|
514
524
|
if (t && t.src === e) return t.value;
|
|
515
|
-
const
|
|
516
|
-
return
|
|
525
|
+
const n = { ...e, readonly: !0 };
|
|
526
|
+
return Se.current = { src: e, value: n }, n;
|
|
517
527
|
}
|
|
518
|
-
function
|
|
519
|
-
const t = JSON.stringify([
|
|
520
|
-
if (
|
|
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;
|
|
521
531
|
const h = {
|
|
522
|
-
labels:
|
|
523
|
-
keys:
|
|
532
|
+
labels: K,
|
|
533
|
+
keys: ye,
|
|
524
534
|
onClear: (k) => p(k, null)
|
|
525
535
|
};
|
|
526
|
-
return
|
|
536
|
+
return Re.current = { sig: t, onChange: p, value: h }, h;
|
|
527
537
|
}
|
|
528
|
-
function
|
|
529
|
-
for (const t of
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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 = "";
|
|
534
544
|
}, 300);
|
|
535
545
|
}, 900));
|
|
536
546
|
}
|
|
537
547
|
}
|
|
538
|
-
const
|
|
539
|
-
if (w &&
|
|
540
|
-
for (const
|
|
541
|
-
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([
|
|
542
552
|
"m2m-items",
|
|
543
553
|
w.many_collection,
|
|
544
554
|
w.many_field,
|
|
545
555
|
l
|
|
546
556
|
]) ?? [];
|
|
547
|
-
for (const
|
|
557
|
+
for (const n of t) g == null || g.stageUnlink(B, n.id);
|
|
548
558
|
} else
|
|
549
559
|
p(e.field, null);
|
|
550
560
|
};
|
|
@@ -553,234 +563,272 @@ const jn = ft(function({
|
|
|
553
563
|
/* @__PURE__ */ c(
|
|
554
564
|
"div",
|
|
555
565
|
{
|
|
556
|
-
ref:
|
|
566
|
+
ref: G,
|
|
557
567
|
"data-field": e.field,
|
|
558
|
-
"data-field-collection":
|
|
568
|
+
"data-field-collection": i,
|
|
559
569
|
"data-field-interface": e.interface ?? void 0,
|
|
560
|
-
"data-autofill-check":
|
|
561
|
-
className:
|
|
570
|
+
"data-autofill-check": pe ? "" : void 0,
|
|
571
|
+
className: D(
|
|
562
572
|
"group/fieldrow space-y-1.5",
|
|
563
|
-
|
|
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"
|
|
564
574
|
),
|
|
565
|
-
onContextMenu:
|
|
566
|
-
onKeyDown:
|
|
567
|
-
onFocusCapture:
|
|
575
|
+
onContextMenu: Qe,
|
|
576
|
+
onKeyDown: Ye,
|
|
577
|
+
onFocusCapture: A.onFocusCapture,
|
|
568
578
|
children: [
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
579
|
+
Je,
|
|
580
|
+
E.length > 0 && /* @__PURE__ */ r(
|
|
581
|
+
Qt,
|
|
572
582
|
{
|
|
573
|
-
cascadeRules:
|
|
574
|
-
cascadeFilter:
|
|
575
|
-
currentValue:
|
|
576
|
-
relatedCollection:
|
|
577
|
-
missingRequiredParents:
|
|
578
|
-
onClear:
|
|
583
|
+
cascadeRules: E,
|
|
584
|
+
cascadeFilter: M,
|
|
585
|
+
currentValue: st,
|
|
586
|
+
relatedCollection: dt,
|
|
587
|
+
missingRequiredParents: be,
|
|
588
|
+
onClear: ht
|
|
579
589
|
}
|
|
580
590
|
),
|
|
581
|
-
(S !== "" ||
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
!E && l && l !== "new" && /* @__PURE__ */ n(
|
|
592
|
-
sn,
|
|
593
|
-
{
|
|
594
|
-
collection: o,
|
|
595
|
-
itemId: l,
|
|
596
|
-
field: e.field,
|
|
597
|
-
onRestore: e.readonly ? void 0 : (t) => p(e.field, t)
|
|
598
|
-
}
|
|
599
|
-
),
|
|
600
|
-
!E && l && l !== "new" && /* @__PURE__ */ n(dn, { collection: o, itemId: l, field: e.field }),
|
|
601
|
-
l && l !== "new" && Ye && /* @__PURE__ */ n(on, { collection: o, itemId: l, field: e.field }),
|
|
602
|
-
Qe && /* @__PURE__ */ n(
|
|
603
|
-
Gt,
|
|
604
|
-
{
|
|
605
|
-
collection: o,
|
|
606
|
-
itemId: l,
|
|
607
|
-
field: e.field,
|
|
608
|
-
label: S || he(e.field),
|
|
609
|
-
onFill: (t) => p(e.field, t)
|
|
610
|
-
}
|
|
611
|
-
),
|
|
612
|
-
!E && Q.show && !(Q.perField && (m || e.readonly)) && /* @__PURE__ */ c(
|
|
613
|
-
"button",
|
|
614
|
-
{
|
|
615
|
-
type: "button",
|
|
616
|
-
onClick: We,
|
|
617
|
-
disabled: be,
|
|
618
|
-
"data-ai-fill": Q.perField ? e.field : void 0,
|
|
619
|
-
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",
|
|
620
|
-
title: "Generate with AI",
|
|
621
|
-
children: [
|
|
622
|
-
be ? /* @__PURE__ */ n(st, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3 w-3" }),
|
|
623
|
-
"AI"
|
|
624
|
-
]
|
|
625
|
-
}
|
|
626
|
-
),
|
|
627
|
-
se && /* @__PURE__ */ n(
|
|
628
|
-
"span",
|
|
629
|
-
{
|
|
630
|
-
"data-tip": "People often change what the AI read from the document here — check it",
|
|
631
|
-
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",
|
|
632
|
-
children: "Check this"
|
|
633
|
-
}
|
|
634
|
-
),
|
|
635
|
-
x,
|
|
636
|
-
$ && !m && !e.readonly && /* @__PURE__ */ c(
|
|
637
|
-
"button",
|
|
638
|
-
{
|
|
639
|
-
type: "button",
|
|
640
|
-
onClick: () => $.onApply(u[e.field] ?? null),
|
|
641
|
-
disabled: u[e.field] == null || u[e.field] === "" || $.count === 0,
|
|
642
|
-
"data-apply-to-lines": e.field,
|
|
643
|
-
"data-tip": $.count === 0 ? "No lines yet — add lines first" : u[e.field] == null || u[e.field] === "" ? "Pick a value first" : $.count != null ? `Copy this value onto all ${$.count} lines (staged until you save)` : "Copy this value onto every line (staged until you save)",
|
|
644
|
-
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",
|
|
645
|
-
children: [
|
|
646
|
-
$.label ?? "Apply to lines",
|
|
647
|
-
" ↓"
|
|
648
|
-
]
|
|
649
|
-
}
|
|
650
|
-
),
|
|
651
|
-
Y.length > 0 && /* @__PURE__ */ n(Z, { delayDuration: 100, children: /* @__PURE__ */ c(I, { children: [
|
|
652
|
-
/* @__PURE__ */ n(ee, { 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: [
|
|
653
|
-
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
654
|
-
"addendum"
|
|
655
|
-
] }) }),
|
|
656
|
-
/* @__PURE__ */ c(te, { side: "top", className: "max-w-[220px] text-[12px]", children: [
|
|
657
|
-
/* @__PURE__ */ c("p", { className: "font-medium mb-1", children: [
|
|
658
|
-
"In active addendum",
|
|
659
|
-
Y.length > 1 ? "s" : "",
|
|
660
|
-
":"
|
|
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, {})
|
|
661
601
|
] }),
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
" ",
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
collection:
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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(
|
|
628
|
+
"button",
|
|
629
|
+
{
|
|
630
|
+
type: "button",
|
|
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
|
+
]
|
|
640
|
+
}
|
|
641
|
+
),
|
|
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(
|
|
692
652
|
"button",
|
|
693
653
|
{
|
|
694
654
|
type: "button",
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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)
|
|
700
736
|
),
|
|
701
|
-
|
|
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
|
+
)
|
|
702
750
|
}
|
|
703
|
-
) })
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
St,
|
|
751
|
+
) })
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
A.editor && !u && /* @__PURE__ */ r(
|
|
756
|
+
Mt,
|
|
710
757
|
{
|
|
711
|
-
editor:
|
|
712
|
-
confirming:
|
|
713
|
-
onConfirm:
|
|
714
|
-
onCancel:
|
|
758
|
+
editor: A.editor,
|
|
759
|
+
confirming: A.confirming,
|
|
760
|
+
onConfirm: A.confirm,
|
|
761
|
+
onCancel: A.cancel
|
|
715
762
|
}
|
|
716
763
|
),
|
|
717
|
-
|
|
764
|
+
W ?? /* @__PURE__ */ r(
|
|
718
765
|
"div",
|
|
719
766
|
{
|
|
720
|
-
ref:
|
|
721
|
-
className:
|
|
722
|
-
"data-tip": (
|
|
723
|
-
onPointerEnter: (
|
|
724
|
-
children: /* @__PURE__ */
|
|
767
|
+
ref: de,
|
|
768
|
+
className: D(u && !V && "cursor-not-allowed"),
|
|
769
|
+
"data-tip": (u || e.readonly) && O ? O : void 0,
|
|
770
|
+
onPointerEnter: (u || e.readonly) && O ? s == null ? void 0 : s.onLockHover : void 0,
|
|
771
|
+
children: /* @__PURE__ */ r(
|
|
725
772
|
"div",
|
|
726
773
|
{
|
|
727
|
-
ref:
|
|
728
|
-
className:
|
|
774
|
+
ref: Ce,
|
|
775
|
+
className: D(
|
|
729
776
|
// A locked FILE field stays interactive: its chips keep the
|
|
730
777
|
// download link and preview click (the component itself hides
|
|
731
778
|
// upload/replace/remove when readonly) — blocking pointer events
|
|
732
779
|
// made attachments unopenable on every locked form (addendum
|
|
733
780
|
// view, terminal states).
|
|
734
|
-
|
|
781
|
+
u && !V && "pointer-events-none opacity-60",
|
|
735
782
|
// The ring lands with a 2px shake so the eye finds the field;
|
|
736
783
|
// the animation runs once when the class is added.
|
|
737
784
|
N && "nvr-shake ring-1 ring-red-400 rounded-md",
|
|
738
|
-
|
|
785
|
+
ie && "nvr-autofill-glow"
|
|
739
786
|
),
|
|
740
|
-
children:
|
|
741
|
-
|
|
787
|
+
children: P ? /* @__PURE__ */ r(on, { field: e, values: m }) : ot ? /* @__PURE__ */ r(
|
|
788
|
+
Pt,
|
|
742
789
|
{
|
|
743
|
-
collection:
|
|
790
|
+
collection: i,
|
|
744
791
|
field: e,
|
|
745
|
-
draft:
|
|
792
|
+
draft: m,
|
|
746
793
|
itemId: l
|
|
747
794
|
}
|
|
748
795
|
) : y ? y({
|
|
749
796
|
field: e,
|
|
750
|
-
value:
|
|
751
|
-
onChange:
|
|
752
|
-
disabled:
|
|
753
|
-
collection:
|
|
797
|
+
value: he,
|
|
798
|
+
onChange: Le,
|
|
799
|
+
disabled: u,
|
|
800
|
+
collection: i,
|
|
754
801
|
itemId: l,
|
|
755
802
|
relations: f,
|
|
756
|
-
cascadeFilter:
|
|
757
|
-
unsatisfiedParentLabel:
|
|
758
|
-
requiredParentLabel:
|
|
759
|
-
}) : /* @__PURE__ */
|
|
760
|
-
|
|
803
|
+
cascadeFilter: M,
|
|
804
|
+
unsatisfiedParentLabel: ct,
|
|
805
|
+
requiredParentLabel: je
|
|
806
|
+
}) : /* @__PURE__ */ r(
|
|
807
|
+
Ut,
|
|
761
808
|
{
|
|
762
|
-
field:
|
|
763
|
-
value:
|
|
764
|
-
onChange:
|
|
809
|
+
field: u && V ? ut() : e,
|
|
810
|
+
value: he,
|
|
811
|
+
onChange: Le,
|
|
765
812
|
relations: f,
|
|
766
|
-
collection:
|
|
813
|
+
collection: i,
|
|
767
814
|
itemId: l,
|
|
768
|
-
cascadeFilter:
|
|
769
|
-
requiredParentLabel:
|
|
770
|
-
narrowedBy:
|
|
771
|
-
onCountChange: a ?
|
|
815
|
+
cascadeFilter: M,
|
|
816
|
+
requiredParentLabel: je,
|
|
817
|
+
narrowedBy: K.length > 0 ? mt() : void 0,
|
|
818
|
+
onCountChange: a ? ze : void 0
|
|
772
819
|
}
|
|
773
820
|
)
|
|
774
821
|
},
|
|
775
|
-
|
|
822
|
+
ie ?? 0
|
|
776
823
|
)
|
|
777
824
|
}
|
|
778
825
|
),
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
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,
|
|
782
830
|
{
|
|
783
|
-
change:
|
|
831
|
+
change: qe,
|
|
784
832
|
onDismiss: () => s == null ? void 0 : s.dismissRemoteChange(e.field),
|
|
785
833
|
onTakeTheirs: s != null && s.takeRemoteChange ? () => {
|
|
786
834
|
var t;
|
|
@@ -794,7 +842,7 @@ const jn = ft(function({
|
|
|
794
842
|
);
|
|
795
843
|
});
|
|
796
844
|
export {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
845
|
+
Zn as FieldRow,
|
|
846
|
+
Xn as lineageSummary,
|
|
847
|
+
gn as useFieldLineage
|
|
800
848
|
};
|