@nivaro/react 0.3.57 → 0.3.59
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/components/fields/RelationField.js +110 -80
- package/dist/full.css +1 -1
- package/dist/hooks/useRelationOptions.js +1 -0
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +37 -2
- package/dist/index.js +523 -520
- package/dist/shared/components/CollectionBrowserView.js +2693 -2619
- package/dist/shared/components/DataTable.js +538 -495
- package/dist/shared/components/ItemEditForm.js +4559 -4386
- package/dist/shared/components/PageRenderer.js +537 -508
- package/dist/shared/components/ProfileView.js +716 -715
- package/dist/shared/components/QueryTable.js +74 -74
- package/dist/shared/components/RecordReadView.js +367 -364
- package/dist/shared/components/ReportView.js +64 -39
- package/dist/shared/components/WidgetSlot.js +543 -520
- package/dist/shared/components/alerts/AlertManagerView.js +324 -317
- package/dist/shared/components/alerts/types.js +37 -14
- package/dist/shared/components/cbv/row-focus.js +19 -0
- package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
- package/dist/shared/components/integrations/console/SignalCard.js +59 -59
- package/dist/shared/components/integrations/console/tone.js +52 -30
- package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
- package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
- package/dist/shared/components/item-edit/FieldRow.js +175 -173
- package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
- package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
- package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
- package/dist/shared/components/item-edit/PlanGrid.js +973 -894
- package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
- package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
- package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
- package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
- package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
- package/dist/shared/components/item-edit/line-midair.js +82 -75
- package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
- package/dist/shared/components/item-edit/related-missing.js +45 -0
- package/dist/shared/components/item-edit/save-outcome.js +9 -7
- package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
- package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
- package/dist/shared/components/panels/ItemLockBanner.js +213 -211
- package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
- package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
- package/dist/shared/components/panels/RevisionsPanel.js +316 -299
- package/dist/shared/components/panels/TaskPanel.js +265 -249
- package/dist/shared/components/panels/landing-state.js +27 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
- package/dist/shared/components/profile/AiMemoryCard.js +12 -10
- package/dist/shared/components/queue/OwnerAvatars.js +80 -41
- package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
- package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
- package/dist/shared/components/queue/group-sums.js +27 -0
- package/dist/shared/components/queue/live-state-aspect.js +9 -5
- package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
- package/dist/shared/lib/back-closes.js +25 -0
- package/dist/shared/lib/display-prefs.js +60 -52
- package/dist/shared/lib/draft-store.js +71 -48
- package/dist/shared/lib/expression.js +53 -53
- package/dist/shared/lib/form-usage-beacon.js +7 -7
- package/dist/shared/lib/list-page-memory.js +63 -0
- package/dist/shared/lib/live.js +44 -44
- package/dist/shared/lib/money-input.js +45 -0
- package/dist/shared/lib/own-writes.js +76 -28
- package/dist/shared/lib/request-gate.js +110 -109
- package/dist/shared/lib/sanitize-html.js +10 -6
- package/dist/shared/lib/staged-row-labels.js +18 -0
- package/dist/shared/lib/validation-rules.js +34 -19
- package/package.json +1 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Info as
|
|
4
|
-
import { memo as
|
|
2
|
+
import { useQueryClient as Qe, useQueries as gt, useQuery as le, useMutation as vt } from "@tanstack/react-query";
|
|
3
|
+
import { Info as wt, Loader2 as kt, Sparkles as _t, Lock as Nt, SlidersHorizontal as Ft, History as Ct, BellRing as Lt, Bell as Rt, Sigma as St } from "lucide-react";
|
|
4
|
+
import { memo as $t, useState as ve, useRef as $, useId as qt, useEffect as oe, useCallback as He } from "react";
|
|
5
5
|
import { toast as ae } from "sonner";
|
|
6
|
-
import { useParentDraft as
|
|
7
|
-
import { showsAiButton as
|
|
8
|
-
import { get as K, del as
|
|
9
|
-
import { toastError as
|
|
6
|
+
import { useParentDraft as At, useNivaroClient as ie } from "../../context.js";
|
|
7
|
+
import { showsAiButton as Tt, AUTOFILL_CHECK_KEY as Et, readAiFill as Pt } from "../../lib/ai-fill.js";
|
|
8
|
+
import { get as K, del as jt, post as ge } from "../../lib/commands.js";
|
|
9
|
+
import { toastError as Bt } from "../../lib/error-toast.js";
|
|
10
10
|
import { titleCase as I, cn as j } from "../../lib/utils.js";
|
|
11
|
+
import { requiredByRules as Dt } from "../../lib/validation-rules.js";
|
|
11
12
|
import { GlossaryLabel as We } from "../ai/GlossaryText.js";
|
|
12
|
-
import { useFieldSource as
|
|
13
|
-
import { Label as
|
|
13
|
+
import { useFieldSource as Mt, FieldSourceInfo as Ot } from "../ConfigReadBack.js";
|
|
14
|
+
import { Label as Kt } from "../ui/label.js";
|
|
14
15
|
import { TooltipProvider as ee, Tooltip as te, TooltipTrigger as ne, TooltipContent as re } from "../ui/tooltip.js";
|
|
15
|
-
import { useAddendumFields as
|
|
16
|
-
import { AutoIdPreviewField as
|
|
16
|
+
import { useAddendumFields as Ut } from "./AddendumFieldContext.js";
|
|
17
|
+
import { AutoIdPreviewField as Ht } from "./AutoIdPreviewField.js";
|
|
17
18
|
import { FOCUSABLE as Ve } from "./entry/entry-keys.js";
|
|
18
|
-
import { useFieldAffordances as
|
|
19
|
-
import { FieldCommentButton as
|
|
20
|
-
import { FieldRenderer as
|
|
21
|
-
import { FormHelpVideoButton as
|
|
22
|
-
import { getCascadeFilters as
|
|
23
|
-
import { isDerivedForRecord as
|
|
24
|
-
import { useM2MStaging as
|
|
25
|
-
import { personalDefaultSlotFor as
|
|
26
|
-
import { PersonalDefaultHint as
|
|
27
|
-
import { isDisplayFormulaRow as ze, usePlacementTextContext as
|
|
28
|
-
import { keepIfEqual as
|
|
29
|
-
import { softRuleWarning as
|
|
30
|
-
import { usePersonalDefaultsApi as
|
|
31
|
-
import { resolveOptionFilterTokens as
|
|
32
|
-
const
|
|
19
|
+
import { useFieldAffordances as Wt, useFieldContextMenu as Vt, usePresenceSoftLock as zt, LockReasonBadge as Gt, PresenceSoftLockStrip as Qt, RemoteChangeGhost as Yt } from "./FieldAffordances.js";
|
|
20
|
+
import { FieldCommentButton as Jt } from "./FieldComments.js";
|
|
21
|
+
import { FieldRenderer as Xt } from "./FieldRenderer.js";
|
|
22
|
+
import { FormHelpVideoButton as Zt } from "./FormHelpVideoButton.js";
|
|
23
|
+
import { getCascadeFilters as It, SYSTEM_FIELDS as en, parseJson as tn, buildCascadeFilter as nn, CascadeEffectController as rn } from "./helpers.js";
|
|
24
|
+
import { isDerivedForRecord as ln } from "./live-rollups.js";
|
|
25
|
+
import { useM2MStaging as on } from "./M2MStagingContext.js";
|
|
26
|
+
import { personalDefaultSlotFor as an, PersonalDefaultSlot as sn } from "./PersonalDefaultControl.js";
|
|
27
|
+
import { PersonalDefaultHint as cn } from "./PersonalDefaultPill.js";
|
|
28
|
+
import { isDisplayFormulaRow as ze, usePlacementTextContext as dn, placementFieldText as un, fieldCounterConfig as mn, fieldIsRecommended as pn, RecommendedMarker as hn, RepeatLastButton as xn, DisplayFormulaValue as fn, FieldCounter as yn } from "./placement-behaviour.js";
|
|
29
|
+
import { keepIfEqual as bn, jsonEqual as gn } from "./render-stability.js";
|
|
30
|
+
import { softRuleWarning as vn } from "./soft-rules.js";
|
|
31
|
+
import { usePersonalDefaultsApi as wn } from "./usePersonalDefaults.js";
|
|
32
|
+
import { resolveOptionFilterTokens as kn } from "../../lib/option-filter-tokens.js";
|
|
33
|
+
const Ge = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), _n = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), Nn = /* @__PURE__ */ new Set([
|
|
33
34
|
"input",
|
|
34
35
|
"textarea",
|
|
35
36
|
"wysiwyg",
|
|
@@ -37,7 +38,7 @@ const wn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
37
38
|
"input-rich-text-html",
|
|
38
39
|
"rich_text",
|
|
39
40
|
"extension-editorjs"
|
|
40
|
-
]),
|
|
41
|
+
]), Fn = /* @__PURE__ */ new Set([
|
|
41
42
|
"relation-m2o",
|
|
42
43
|
"relation-m2m",
|
|
43
44
|
"select-multiple-m2m",
|
|
@@ -48,62 +49,62 @@ const wn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
48
49
|
"file",
|
|
49
50
|
"files",
|
|
50
51
|
"image"
|
|
51
|
-
]),
|
|
52
|
-
function
|
|
53
|
-
const e =
|
|
54
|
-
return
|
|
52
|
+
]), Cn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
|
|
53
|
+
function Ln(s) {
|
|
54
|
+
const e = s.interface ?? "";
|
|
55
|
+
return Fn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") || Ge.has(s.type ?? "") ? !1 : !!(_n.has(s.type ?? "") || Nn.has(e) || !e && s.type && !Ge.has(s.type));
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
57
|
+
function Rn(s, e, i) {
|
|
58
|
+
return s.filter((p) => (i == null ? void 0 : i(p)) !== e);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function Sn(s, e, i, p) {
|
|
60
61
|
const f = ie();
|
|
61
62
|
return le({
|
|
62
|
-
queryKey: ["field-lineage",
|
|
63
|
+
queryKey: ["field-lineage", s, e, i],
|
|
63
64
|
queryFn: () => f.request(
|
|
64
|
-
K(`/lineage/${
|
|
65
|
-
).then((
|
|
65
|
+
K(`/lineage/${s}/${encodeURIComponent(e)}/${i}`)
|
|
66
|
+
).then((c) => c.data),
|
|
66
67
|
enabled: p,
|
|
67
68
|
staleTime: 3e4
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function mr(s, e = "rows") {
|
|
71
72
|
var l, w, g;
|
|
72
|
-
if (
|
|
73
|
-
const m = (b) => typeof b == "number" ? b.toLocaleString(void 0, { maximumFractionDigits: 2 }) : b == null || b === "" ? "
|
|
74
|
-
return `= ${
|
|
73
|
+
if (s && (s.kind === "write" || s.kind === "read") && s.formula) {
|
|
74
|
+
const m = (b) => typeof b == "number" ? b.toLocaleString(void 0, { maximumFractionDigits: 2 }) : b == null || b === "" ? "0" : String(b);
|
|
75
|
+
return `= ${s.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (b, o) => {
|
|
75
76
|
var x;
|
|
76
|
-
return m((x =
|
|
77
|
+
return m((x = s.inputs) == null ? void 0 : x[o]);
|
|
77
78
|
}).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
|
|
78
79
|
}
|
|
79
|
-
if (!
|
|
80
|
-
const i = (
|
|
80
|
+
if (!s || s.kind !== "rollup") return null;
|
|
81
|
+
const i = (s.sources ?? []).reduce((m, a) => m + a.rows.length, 0), p = (s.sources ?? []).reduce((m, a) => {
|
|
81
82
|
var b;
|
|
82
83
|
return m + (((b = a.excluded) == null ? void 0 : b.length) ?? 0);
|
|
83
|
-
}, 0), f = (g = (w = (l = (
|
|
84
|
+
}, 0), f = (g = (w = (l = (s.sources ?? []).find((m) => {
|
|
84
85
|
var a;
|
|
85
86
|
return (a = m.excluded) == null ? void 0 : a.length;
|
|
86
|
-
})) == null ? void 0 : l.excluded) == null ? void 0 : w[0]) == null ? void 0 : g.reason,
|
|
87
|
-
return p &&
|
|
87
|
+
})) == null ? void 0 : l.excluded) == null ? void 0 : w[0]) == null ? void 0 : g.reason, c = [`= ${i} ${i === 1 ? e.replace(/s$/, "") : e}`];
|
|
88
|
+
return p && c.push(
|
|
88
89
|
`${p} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
|
|
89
|
-
),
|
|
90
|
+
), c.join(" · ");
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
-
collection:
|
|
92
|
+
function $n({
|
|
93
|
+
collection: s,
|
|
93
94
|
itemId: e,
|
|
94
95
|
field: i
|
|
95
96
|
}) {
|
|
96
|
-
const [p, f] = ve(!1),
|
|
97
|
+
const [p, f] = ve(!1), c = $(null), { data: l, isLoading: w } = Sn(s, e, i, p);
|
|
97
98
|
oe(() => {
|
|
98
99
|
if (!p) return;
|
|
99
100
|
const a = (b) => {
|
|
100
101
|
var o;
|
|
101
|
-
(o =
|
|
102
|
+
(o = c.current) != null && o.contains(b.target) || f(!1);
|
|
102
103
|
};
|
|
103
104
|
return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
|
|
104
105
|
}, [p]);
|
|
105
106
|
const g = (a) => a == null ? "—" : Number(a).toLocaleString(void 0, { maximumFractionDigits: 2 }), m = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
|
|
106
|
-
return /* @__PURE__ */ u("div", { ref:
|
|
107
|
+
return /* @__PURE__ */ u("div", { ref: c, className: "relative inline-flex", children: [
|
|
107
108
|
/* @__PURE__ */ n(
|
|
108
109
|
"button",
|
|
109
110
|
{
|
|
@@ -115,7 +116,7 @@ function Sn({
|
|
|
115
116
|
p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
116
117
|
),
|
|
117
118
|
"data-field-lineage": !0,
|
|
118
|
-
children: /* @__PURE__ */ n(
|
|
119
|
+
children: /* @__PURE__ */ n(St, { className: "h-3 w-3" })
|
|
119
120
|
}
|
|
120
121
|
),
|
|
121
122
|
p && /* @__PURE__ */ u("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
@@ -206,16 +207,16 @@ function Sn({
|
|
|
206
207
|
] })
|
|
207
208
|
] });
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
-
collection:
|
|
210
|
+
function qn({
|
|
211
|
+
collection: s,
|
|
211
212
|
itemId: e,
|
|
212
213
|
field: i,
|
|
213
214
|
formatValue: p,
|
|
214
215
|
onRestore: f
|
|
215
216
|
}) {
|
|
216
|
-
const
|
|
217
|
-
queryKey: ["field-value-history",
|
|
218
|
-
queryFn: () =>
|
|
217
|
+
const c = ie(), [l, w] = ve(!1), g = $(null), { data: m, isLoading: a } = le({
|
|
218
|
+
queryKey: ["field-value-history", s, e, i],
|
|
219
|
+
queryFn: () => c.request(K(`/field-history/${s}/${encodeURIComponent(e)}/${i}`)).then((o) => o.data ?? []),
|
|
219
220
|
enabled: l,
|
|
220
221
|
staleTime: 6e4
|
|
221
222
|
});
|
|
@@ -240,7 +241,7 @@ function $n({
|
|
|
240
241
|
l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
241
242
|
),
|
|
242
243
|
"data-field-history": !0,
|
|
243
|
-
children: /* @__PURE__ */ n(
|
|
244
|
+
children: /* @__PURE__ */ n(Ct, { className: "h-3 w-3" })
|
|
244
245
|
}
|
|
245
246
|
),
|
|
246
247
|
l && /* @__PURE__ */ u("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
@@ -288,26 +289,26 @@ function $n({
|
|
|
288
289
|
] })
|
|
289
290
|
] });
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
-
collection:
|
|
292
|
+
function An({
|
|
293
|
+
collection: s,
|
|
293
294
|
itemId: e,
|
|
294
295
|
field: i
|
|
295
296
|
}) {
|
|
296
|
-
const p = ie(), f =
|
|
297
|
+
const p = ie(), f = Qe(), { data: c } = le({
|
|
297
298
|
queryKey: ["field-watch-config"],
|
|
298
299
|
queryFn: () => p.request(K("/field-watches/config")).then((a) => a.data).catch(() => ({ enabled: !1 })),
|
|
299
300
|
staleTime: 5 * 6e4
|
|
300
|
-
}), l = ["field-watch-self",
|
|
301
|
+
}), l = ["field-watch-self", s, e], { data: w = [] } = le({
|
|
301
302
|
queryKey: l,
|
|
302
|
-
queryFn: () => p.request(K("/field-watches/self", { collection:
|
|
303
|
-
enabled: !!(
|
|
303
|
+
queryFn: () => p.request(K("/field-watches/self", { collection: s, item_id: e })).then((a) => a.data ?? []).catch(() => []),
|
|
304
|
+
enabled: !!(c != null && c.enabled),
|
|
304
305
|
staleTime: 6e4
|
|
305
|
-
}), g = w.includes(i), m =
|
|
306
|
+
}), g = w.includes(i), m = vt({
|
|
306
307
|
mutationFn: () => g ? p.request(
|
|
307
|
-
|
|
308
|
-
`/field-watches/self?collection=${encodeURIComponent(
|
|
308
|
+
jt(
|
|
309
|
+
`/field-watches/self?collection=${encodeURIComponent(s)}&field=${encodeURIComponent(i)}&item_id=${encodeURIComponent(e)}`
|
|
309
310
|
)
|
|
310
|
-
) : p.request(ge("/field-watches/self", { collection:
|
|
311
|
+
) : p.request(ge("/field-watches/self", { collection: s, field: i, item_id: e })),
|
|
311
312
|
onSuccess: () => {
|
|
312
313
|
f.invalidateQueries({ queryKey: l }), ae.success(
|
|
313
314
|
g ? "No longer watching this field" : "Watching — you will be notified when it changes"
|
|
@@ -315,7 +316,7 @@ function qn({
|
|
|
315
316
|
},
|
|
316
317
|
onError: () => ae.error("Could not update the watch")
|
|
317
318
|
});
|
|
318
|
-
return
|
|
319
|
+
return c != null && c.enabled ? /* @__PURE__ */ n(
|
|
319
320
|
"button",
|
|
320
321
|
{
|
|
321
322
|
type: "button",
|
|
@@ -323,21 +324,21 @@ function qn({
|
|
|
323
324
|
title: g ? "Stop watching this field on this record" : "Watch this field on this record",
|
|
324
325
|
"data-field-watch": i,
|
|
325
326
|
className: `rounded p-0.5 transition-colors ${g ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
|
|
326
|
-
children: g ? /* @__PURE__ */ n(
|
|
327
|
+
children: g ? /* @__PURE__ */ n(Lt, { className: "h-3 w-3" }) : /* @__PURE__ */ n(Rt, { className: "h-3 w-3" })
|
|
327
328
|
}
|
|
328
329
|
) : null;
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
-
return
|
|
331
|
+
function Tn(s) {
|
|
332
|
+
return s ? s.querySelector(
|
|
332
333
|
'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
|
|
333
|
-
) ??
|
|
334
|
+
) ?? s.querySelector("button") : null;
|
|
334
335
|
}
|
|
335
|
-
const
|
|
336
|
+
const pr = $t(function({
|
|
336
337
|
field: e,
|
|
337
338
|
draft: i,
|
|
338
339
|
onChange: p,
|
|
339
340
|
relations: f,
|
|
340
|
-
collection:
|
|
341
|
+
collection: c,
|
|
341
342
|
itemId: l,
|
|
342
343
|
error: w,
|
|
343
344
|
visible: g,
|
|
@@ -347,13 +348,13 @@ const ur = St(function({
|
|
|
347
348
|
onCountChange: o,
|
|
348
349
|
swapButton: x,
|
|
349
350
|
swapContent: U,
|
|
350
|
-
forceVisible:
|
|
351
|
+
forceVisible: Ye,
|
|
351
352
|
autoFillTick: se
|
|
352
353
|
}) {
|
|
353
354
|
var De, Me, Oe, Ke;
|
|
354
|
-
const H =
|
|
355
|
+
const H = Cn.has(e.interface ?? ""), N = At(), y = on(), we = Qe(), ce = ie(), [ke, W] = ve(!1), d = Wt(), _e = Mt(e.field), V = $(null), z = qt(), de = $(null), Ne = $(!1);
|
|
355
356
|
oe(() => {
|
|
356
|
-
const t = Ne.current ?
|
|
357
|
+
const t = Ne.current ? Tn(de.current) : null;
|
|
357
358
|
if (!t || t.hasAttribute("aria-label")) return;
|
|
358
359
|
t.id || (t.id = `${z}-control`);
|
|
359
360
|
const r = t.tagName === "BUTTON" ? `${z} ${t.id}` : z;
|
|
@@ -375,36 +376,36 @@ const ur = St(function({
|
|
|
375
376
|
m || p(G, t);
|
|
376
377
|
},
|
|
377
378
|
[m, p, G]
|
|
378
|
-
),
|
|
379
|
+
), Je = He(
|
|
379
380
|
(t) => o == null ? void 0 : o(G, t),
|
|
380
381
|
[o, G]
|
|
381
|
-
),
|
|
382
|
-
onContextMenu:
|
|
383
|
-
onKeyDown:
|
|
384
|
-
menu:
|
|
385
|
-
confirmSaveFrom:
|
|
382
|
+
), Xe = $(void 0), Re = $(void 0), Se = $(void 0), $e = !m && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !ze(e), {
|
|
383
|
+
onContextMenu: Ze,
|
|
384
|
+
onKeyDown: Ie,
|
|
385
|
+
menu: et,
|
|
386
|
+
confirmSaveFrom: tt,
|
|
386
387
|
openedBy: ue
|
|
387
|
-
} =
|
|
388
|
+
} = Vt({
|
|
388
389
|
wrapperRef: V,
|
|
389
390
|
field: e,
|
|
390
391
|
value: i[e.field],
|
|
391
392
|
relations: f,
|
|
392
|
-
collection:
|
|
393
|
+
collection: c,
|
|
393
394
|
itemId: l,
|
|
394
395
|
openRelated: d == null ? void 0 : d.openRelated,
|
|
395
396
|
editable: $e
|
|
396
|
-
}), E =
|
|
397
|
+
}), E = zt(V), nt = dn(), qe = d == null ? void 0 : d.remoteChanges[e.field], B = d == null ? void 0 : d.lockReasons[e.field], T = d == null ? void 0 : d.applyToLines[e.field], C = wn(), rt = (C == null ? void 0 : C.applied(e.field)) ?? !1, Ae = (C == null ? void 0 : C.hintFor(e.field)) ?? null, me = an(C, e.field, $e), pe = () => {
|
|
397
398
|
var t, r;
|
|
398
399
|
return ((t = de.current) == null ? void 0 : t.querySelector(Ve)) ?? ((r = V.current) == null ? void 0 : r.querySelector(Ve));
|
|
399
|
-
}, Q =
|
|
400
|
-
async function
|
|
400
|
+
}, Q = Tt(e._overrides, a, Ln(e)), he = !!(d != null && d.fromAutofill) && !!e._overrides && e._overrides[Et] === !0;
|
|
401
|
+
async function lt() {
|
|
401
402
|
var t;
|
|
402
|
-
if (Q.perField) return
|
|
403
|
+
if (Q.perField) return ot();
|
|
403
404
|
W(!0);
|
|
404
405
|
try {
|
|
405
406
|
const r = await ce.request(
|
|
406
407
|
ge("/ai/generate", {
|
|
407
|
-
collection:
|
|
408
|
+
collection: c,
|
|
408
409
|
item_id: l !== "new" ? l : void 0,
|
|
409
410
|
field: e.field
|
|
410
411
|
})
|
|
@@ -415,15 +416,15 @@ const ur = St(function({
|
|
|
415
416
|
W(!1);
|
|
416
417
|
}
|
|
417
418
|
}
|
|
418
|
-
async function
|
|
419
|
+
async function ot() {
|
|
419
420
|
var r, h, k, R;
|
|
420
421
|
const t = {};
|
|
421
|
-
for (const _ of ((r =
|
|
422
|
+
for (const _ of ((r = Pt(e._overrides)) == null ? void 0 : r.tokens) ?? []) _ in i && (t[_] = i[_]);
|
|
422
423
|
W(!0);
|
|
423
424
|
try {
|
|
424
425
|
const _ = await ce.request(
|
|
425
426
|
ge("/ai/field-fill", {
|
|
426
|
-
collection:
|
|
427
|
+
collection: c,
|
|
427
428
|
layout_id: (d == null ? void 0 : d.layoutId) ?? null,
|
|
428
429
|
field: e.field,
|
|
429
430
|
item_id: l && l !== "new" ? l : null,
|
|
@@ -432,14 +433,14 @@ const ur = St(function({
|
|
|
432
433
|
), F = (h = _.data) == null ? void 0 : h.value;
|
|
433
434
|
typeof F == "string" && F !== "" ? p(e.field, F) : ae.info("The AI had nothing to write here"), (R = (k = _.data) == null ? void 0 : k.missing) != null && R.length && ae.info(`Filled without ${_.data.missing.join(", ")} (empty or not visible to you)`);
|
|
434
435
|
} catch (_) {
|
|
435
|
-
|
|
436
|
+
Bt(_, "AI fill failed", { action: "Fill with AI" });
|
|
436
437
|
} finally {
|
|
437
438
|
W(!1);
|
|
438
439
|
}
|
|
439
440
|
}
|
|
440
|
-
const P =
|
|
441
|
+
const P = It(e.dependency_config), Te = P.flatMap((t) => {
|
|
441
442
|
const r = f.find(
|
|
442
|
-
(k) => k.one_collection ===
|
|
443
|
+
(k) => k.one_collection === c && k.one_field === t.parent_field
|
|
443
444
|
);
|
|
444
445
|
if (!r) return [];
|
|
445
446
|
if (r.junction_field) return [{ rule: t, rel: r }];
|
|
@@ -447,7 +448,7 @@ const ur = St(function({
|
|
|
447
448
|
(k) => k.many_collection === r.many_collection && k.id !== r.id
|
|
448
449
|
);
|
|
449
450
|
return h != null && h.many_field ? [{ rule: t, rel: { ...r, junction_field: h.many_field } }] : [];
|
|
450
|
-
}),
|
|
451
|
+
}), at = gt({
|
|
451
452
|
queries: Te.map(({ rel: t }) => ({
|
|
452
453
|
queryKey: ["m2m-items", t.many_collection, t.many_field, l],
|
|
453
454
|
queryFn: () => ce.request(
|
|
@@ -460,23 +461,23 @@ const ur = St(function({
|
|
|
460
461
|
enabled: !!l && l !== "new",
|
|
461
462
|
staleTime: 3e4
|
|
462
463
|
}))
|
|
463
|
-
}),
|
|
464
|
+
}), it = Object.fromEntries(
|
|
464
465
|
Te.map(({ rule: t, rel: r }, h) => {
|
|
465
466
|
var _;
|
|
466
467
|
const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, R = (y == null ? void 0 : y.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
|
|
467
468
|
return [
|
|
468
469
|
t.parent_field,
|
|
469
|
-
(((_ =
|
|
470
|
+
(((_ = at[h]) == null ? void 0 : _.data) ?? []).filter((F) => !R.has(F.id)).map((F) => F[r.junction_field])
|
|
470
471
|
];
|
|
471
472
|
})
|
|
472
|
-
), Y =
|
|
473
|
-
if (!
|
|
473
|
+
), Y = Ut()[e.field] ?? [];
|
|
474
|
+
if (!Ye && (!g || !e.layout_assigned && (e.hidden || en.has(e.field))))
|
|
474
475
|
return null;
|
|
475
|
-
const xe = i[e.field] ?? null, J =
|
|
476
|
+
const xe = i[e.field] ?? null, J = un(e, nt), L = J.label ?? I(e.field);
|
|
476
477
|
Ne.current = L !== "";
|
|
477
|
-
const q = ze(e), Ee = q ? null :
|
|
478
|
+
const q = ze(e), Ee = q ? null : mn(e), Pe = q || !(l === "new" || !l || (De = N == null ? void 0 : N.dirtyFields) != null && De.has(e.field)) ? null : vn(e, i), st = !q && !m && !e.readonly && ((Me = e._overrides) == null ? void 0 : Me.repeat_last) === !0, ct = ln(e, i), dt = (Ke = (Oe = tn(e.options)) == null ? void 0 : Oe.auto_id) == null ? void 0 : Ke.pattern, v = (() => {
|
|
478
479
|
const t = f.find(
|
|
479
|
-
(h) => h.one_collection ===
|
|
480
|
+
(h) => h.one_collection === c && h.one_field === e.field
|
|
480
481
|
);
|
|
481
482
|
if (!t) return null;
|
|
482
483
|
if (t.junction_field) return t;
|
|
@@ -484,17 +485,17 @@ const ur = St(function({
|
|
|
484
485
|
(h) => h.many_collection === t.many_collection && h.id !== t.id
|
|
485
486
|
);
|
|
486
487
|
return r ? { ...t, junction_field: r.many_field } : null;
|
|
487
|
-
})(), fe = v ? null : f.find((t) => t.many_collection ===
|
|
488
|
+
})(), fe = v ? null : f.find((t) => t.many_collection === c && t.many_field === e.field) ?? null, ye = v ? f.find(
|
|
488
489
|
(t) => t.many_collection === v.many_collection && t.many_field === v.junction_field && t.id !== v.id
|
|
489
|
-
) ?? null : null, D = v ? v.one_field ?? `${v.many_collection}.${v.junction_field}` : null, je = D ? (y == null ? void 0 : y.getStagedLinks(D)) ?? [] : [],
|
|
490
|
+
) ?? null : null, D = v ? v.one_field ?? `${v.many_collection}.${v.junction_field}` : null, je = D ? (y == null ? void 0 : y.getStagedLinks(D)) ?? [] : [], ut = v ? (we.getQueryData([
|
|
490
491
|
"m2m-items",
|
|
491
492
|
v.many_collection,
|
|
492
493
|
v.many_field,
|
|
493
494
|
l
|
|
494
|
-
]) ?? []).map((t) => t[v.junction_field]) : [],
|
|
495
|
+
]) ?? []).map((t) => t[v.junction_field]) : [], mt = v ? je[0] ?? ut[0] ?? null : xe, pt = (ye == null ? void 0 : ye.one_collection) ?? (fe == null ? void 0 : fe.one_collection) ?? void 0, X = (t) => {
|
|
495
496
|
var r;
|
|
496
|
-
return ((N == null ? void 0 : N.collection) ===
|
|
497
|
-
}, A =
|
|
497
|
+
return ((N == null ? void 0 : N.collection) === c ? (r = N == null ? void 0 : N.fieldLabels) == null ? void 0 : r[t] : void 0) ?? I(String(t));
|
|
498
|
+
}, A = nn({
|
|
498
499
|
rules: P,
|
|
499
500
|
// A parent whose value THIS field's own pick derived must not narrow this
|
|
500
501
|
// field's options — otherwise picking a region locks the region picker
|
|
@@ -506,7 +507,7 @@ const ur = St(function({
|
|
|
506
507
|
},
|
|
507
508
|
parentValue: (t) => {
|
|
508
509
|
if (i[t] != null) return i[t];
|
|
509
|
-
const r = f.find((S) => S.one_collection ===
|
|
510
|
+
const r = f.find((S) => S.one_collection === c && S.one_field === t);
|
|
510
511
|
if (!r) return null;
|
|
511
512
|
let h = r;
|
|
512
513
|
if (!h.junction_field) {
|
|
@@ -516,23 +517,23 @@ const ur = St(function({
|
|
|
516
517
|
if (S != null && S.many_field) h = { ...r, junction_field: S.many_field };
|
|
517
518
|
else return null;
|
|
518
519
|
}
|
|
519
|
-
const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, R = (y == null ? void 0 : y.getStagedLinks(k)) ?? [], _ =
|
|
520
|
+
const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, R = (y == null ? void 0 : y.getStagedLinks(k)) ?? [], _ = it[t] ?? [], F = [...new Set([...R, ..._].map((S) => String(S)))];
|
|
520
521
|
return F.length === 0 ? null : F.length === 1 ? F[0] : F;
|
|
521
522
|
},
|
|
522
523
|
parentOptionFilter: (t) => {
|
|
523
524
|
var h;
|
|
524
|
-
const r = (N == null ? void 0 : N.collection) ===
|
|
525
|
-
return r ?
|
|
525
|
+
const r = (N == null ? void 0 : N.collection) === c ? (h = N.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
|
|
526
|
+
return r ? kn(r, i, l) : void 0;
|
|
526
527
|
}
|
|
527
|
-
}), M = A.filter ?
|
|
528
|
-
function
|
|
528
|
+
}), M = A.filter ? bn(Xe, A.filter, gn) : A.filter, O = A.satisfiedParents.map(X), Z = A.satisfiedParents, ht = A.unsatisfiedParents.length ? X(A.unsatisfiedParents[0]) : null, be = A.missingRequiredParents, Be = be.length ? X(be[0]) : null;
|
|
529
|
+
function xt() {
|
|
529
530
|
const t = Se.current;
|
|
530
531
|
if (t && t.src === e) return t.value;
|
|
531
532
|
const r = { ...e, readonly: !0 };
|
|
532
533
|
return Se.current = { src: e, value: r }, r;
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
-
const t =
|
|
535
|
+
function ft() {
|
|
536
|
+
const t = Rn(
|
|
536
537
|
Z,
|
|
537
538
|
e.field,
|
|
538
539
|
y == null ? void 0 : y.getDerivedOrigin
|
|
@@ -548,7 +549,7 @@ const ur = St(function({
|
|
|
548
549
|
};
|
|
549
550
|
return Re.current = { sig: r, onChange: p, value: k }, k;
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
+
function yt() {
|
|
552
553
|
for (const t of Z) {
|
|
553
554
|
const r = document.querySelector(`[data-field="${t}"]`);
|
|
554
555
|
r && (r.scrollIntoView({ behavior: "smooth", block: "center" }), r.style.transition = "box-shadow 0.15s ease", r.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", r.style.borderRadius = "12px", setTimeout(() => {
|
|
@@ -558,7 +559,7 @@ const ur = St(function({
|
|
|
558
559
|
}, 900));
|
|
559
560
|
}
|
|
560
561
|
}
|
|
561
|
-
const
|
|
562
|
+
const bt = () => {
|
|
562
563
|
if (v && D) {
|
|
563
564
|
for (const r of je) y == null || y.unstageLink(D, r);
|
|
564
565
|
const t = we.getQueryData([
|
|
@@ -578,27 +579,27 @@ const ur = St(function({
|
|
|
578
579
|
{
|
|
579
580
|
ref: V,
|
|
580
581
|
"data-field": e.field,
|
|
581
|
-
"data-field-collection":
|
|
582
|
+
"data-field-collection": c,
|
|
582
583
|
"data-field-interface": e.interface ?? void 0,
|
|
583
584
|
"data-autofill-check": he ? "" : void 0,
|
|
584
585
|
className: j(
|
|
585
586
|
"group/fieldrow space-y-1.5",
|
|
586
587
|
he && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
|
|
587
588
|
),
|
|
588
|
-
onContextMenu:
|
|
589
|
-
onKeyDown:
|
|
589
|
+
onContextMenu: Ze,
|
|
590
|
+
onKeyDown: Ie,
|
|
590
591
|
onFocusCapture: E.onFocusCapture,
|
|
591
592
|
children: [
|
|
592
|
-
|
|
593
|
+
et,
|
|
593
594
|
P.length > 0 && /* @__PURE__ */ n(
|
|
594
|
-
|
|
595
|
+
rn,
|
|
595
596
|
{
|
|
596
597
|
cascadeRules: P,
|
|
597
598
|
cascadeFilter: M,
|
|
598
|
-
currentValue:
|
|
599
|
-
relatedCollection:
|
|
599
|
+
currentValue: mt,
|
|
600
|
+
relatedCollection: pt,
|
|
600
601
|
missingRequiredParents: be,
|
|
601
|
-
onClear:
|
|
602
|
+
onClear: bt
|
|
602
603
|
}
|
|
603
604
|
),
|
|
604
605
|
(L !== "" || Y.length > 0) && /* @__PURE__ */ u(
|
|
@@ -607,32 +608,32 @@ const ur = St(function({
|
|
|
607
608
|
className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]",
|
|
608
609
|
"data-pd-row": me ? "" : void 0,
|
|
609
610
|
children: [
|
|
610
|
-
L !== "" && /* @__PURE__ */ u(
|
|
611
|
-
/* @__PURE__ */ n(We, { text: L, collection:
|
|
612
|
-
e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
|
|
613
|
-
|
|
611
|
+
L !== "" && /* @__PURE__ */ u(Kt, { id: z, "data-field-label": !0, className: "text-sm font-medium", children: [
|
|
612
|
+
/* @__PURE__ */ n(We, { text: L, collection: c }),
|
|
613
|
+
(e.required || Dt(e.validation_rules, i)) && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
|
|
614
|
+
pn(e) && /* @__PURE__ */ n(hn, {})
|
|
614
615
|
] }),
|
|
615
616
|
J.note && /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ u(te, { children: [
|
|
616
|
-
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(
|
|
617
|
-
/* @__PURE__ */ n(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (d == null ? void 0 : d.glossaryHelp) === !1 ? J.note : /* @__PURE__ */ n(We, { text: J.note, collection:
|
|
617
|
+
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(wt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
|
|
618
|
+
/* @__PURE__ */ n(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (d == null ? void 0 : d.glossaryHelp) === !1 ? J.note : /* @__PURE__ */ n(We, { text: J.note, collection: c }) })
|
|
618
619
|
] }) }),
|
|
619
|
-
_e && /* @__PURE__ */ n(
|
|
620
|
+
_e && /* @__PURE__ */ n(Ot, { source: _e, label: L }),
|
|
620
621
|
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
621
|
-
|
|
622
|
+
qn,
|
|
622
623
|
{
|
|
623
|
-
collection:
|
|
624
|
+
collection: c,
|
|
624
625
|
itemId: l,
|
|
625
626
|
field: e.field,
|
|
626
627
|
onRestore: e.readonly ? void 0 : (t) => p(e.field, t)
|
|
627
628
|
}
|
|
628
629
|
),
|
|
629
|
-
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
630
|
-
!q && l && l !== "new" && /* @__PURE__ */ n(
|
|
631
|
-
l && l !== "new" &&
|
|
632
|
-
|
|
633
|
-
|
|
630
|
+
!q && l && l !== "new" && /* @__PURE__ */ n(An, { collection: c, itemId: l, field: e.field }),
|
|
631
|
+
!q && l && l !== "new" && /* @__PURE__ */ n(Jt, { field: e.field, label: L || I(e.field) }),
|
|
632
|
+
l && l !== "new" && ct && /* @__PURE__ */ n($n, { collection: c, itemId: l, field: e.field }),
|
|
633
|
+
st && /* @__PURE__ */ n(
|
|
634
|
+
xn,
|
|
634
635
|
{
|
|
635
|
-
collection:
|
|
636
|
+
collection: c,
|
|
636
637
|
itemId: l,
|
|
637
638
|
field: e.field,
|
|
638
639
|
label: L || I(e.field),
|
|
@@ -643,13 +644,13 @@ const ur = St(function({
|
|
|
643
644
|
"button",
|
|
644
645
|
{
|
|
645
646
|
type: "button",
|
|
646
|
-
onClick:
|
|
647
|
+
onClick: lt,
|
|
647
648
|
disabled: ke,
|
|
648
649
|
"data-ai-fill": Q.perField ? e.field : void 0,
|
|
649
650
|
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",
|
|
650
651
|
title: "Generate with AI",
|
|
651
652
|
children: [
|
|
652
|
-
ke ? /* @__PURE__ */ n(
|
|
653
|
+
ke ? /* @__PURE__ */ n(kt, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(_t, { className: "h-3 w-3" }),
|
|
653
654
|
"AI"
|
|
654
655
|
]
|
|
655
656
|
}
|
|
@@ -701,16 +702,16 @@ const ur = St(function({
|
|
|
701
702
|
] })
|
|
702
703
|
] }) }),
|
|
703
704
|
/* @__PURE__ */ n(
|
|
704
|
-
|
|
705
|
+
Zt,
|
|
705
706
|
{
|
|
706
|
-
collection:
|
|
707
|
+
collection: c,
|
|
707
708
|
kind: "field",
|
|
708
709
|
name: e.field,
|
|
709
710
|
label: L
|
|
710
711
|
}
|
|
711
712
|
),
|
|
712
|
-
(m || e.readonly) && B ? /* @__PURE__ */ n(
|
|
713
|
-
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(
|
|
713
|
+
(m || e.readonly) && B ? /* @__PURE__ */ n(Gt, { reason: B, onHover: d == null ? void 0 : d.onLockHover }) : m ? /* @__PURE__ */ n(ee, { delayDuration: 200, children: /* @__PURE__ */ u(te, { children: [
|
|
714
|
+
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(Nt, { className: "h-3 w-3" }) }) }),
|
|
714
715
|
/* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: "This field is locked" })
|
|
715
716
|
] }) }) : null,
|
|
716
717
|
P.length > 0 && (() => {
|
|
@@ -723,12 +724,12 @@ const ur = St(function({
|
|
|
723
724
|
{
|
|
724
725
|
type: "button",
|
|
725
726
|
"aria-label": `Show the fields that narrow ${L || "this list"}`,
|
|
726
|
-
onClick:
|
|
727
|
+
onClick: yt,
|
|
727
728
|
className: j(
|
|
728
729
|
"inline-flex items-center transition-colors",
|
|
729
730
|
t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
|
|
730
731
|
),
|
|
731
|
-
children: /* @__PURE__ */ n(
|
|
732
|
+
children: /* @__PURE__ */ n(Ft, { className: "h-3 w-3" })
|
|
732
733
|
}
|
|
733
734
|
) }),
|
|
734
735
|
/* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${O.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
|
|
@@ -739,7 +740,7 @@ const ur = St(function({
|
|
|
739
740
|
// Shift+F10 still open the field menu). The slot keeps one box whatever it shows,
|
|
740
741
|
// so nothing to its left moves.
|
|
741
742
|
/* @__PURE__ */ n("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ n(
|
|
742
|
-
|
|
743
|
+
sn,
|
|
743
744
|
{
|
|
744
745
|
field: e.field,
|
|
745
746
|
label: L,
|
|
@@ -747,7 +748,7 @@ const ur = St(function({
|
|
|
747
748
|
confirmOpen: ue === "make" || ue === "update" ? ue : null,
|
|
748
749
|
onConfirm: (t, r) => (
|
|
749
750
|
// After a save the button becomes "Your default": focus goes to the field.
|
|
750
|
-
|
|
751
|
+
tt(t, pe, r)
|
|
751
752
|
),
|
|
752
753
|
onUndo: () => {
|
|
753
754
|
C == null || C.undo(e.field), requestAnimationFrame(() => {
|
|
@@ -768,7 +769,7 @@ const ur = St(function({
|
|
|
768
769
|
}
|
|
769
770
|
),
|
|
770
771
|
E.editor && !m && /* @__PURE__ */ n(
|
|
771
|
-
|
|
772
|
+
Qt,
|
|
772
773
|
{
|
|
773
774
|
editor: E.editor,
|
|
774
775
|
confirming: E.confirming,
|
|
@@ -799,10 +800,10 @@ const ur = St(function({
|
|
|
799
800
|
w && "nvr-shake ring-1 ring-red-400 rounded-md",
|
|
800
801
|
se && "nvr-autofill-glow"
|
|
801
802
|
),
|
|
802
|
-
children: q ? /* @__PURE__ */ n(
|
|
803
|
-
|
|
803
|
+
children: q ? /* @__PURE__ */ n(fn, { field: e, values: i }) : dt ? /* @__PURE__ */ n(
|
|
804
|
+
Ht,
|
|
804
805
|
{
|
|
805
|
-
collection:
|
|
806
|
+
collection: c,
|
|
806
807
|
field: e,
|
|
807
808
|
draft: i,
|
|
808
809
|
itemId: l
|
|
@@ -812,25 +813,25 @@ const ur = St(function({
|
|
|
812
813
|
value: xe,
|
|
813
814
|
onChange: Le,
|
|
814
815
|
disabled: m,
|
|
815
|
-
collection:
|
|
816
|
+
collection: c,
|
|
816
817
|
itemId: l,
|
|
817
818
|
relations: f,
|
|
818
819
|
cascadeFilter: M,
|
|
819
|
-
unsatisfiedParentLabel:
|
|
820
|
+
unsatisfiedParentLabel: ht,
|
|
820
821
|
requiredParentLabel: Be
|
|
821
822
|
}) : /* @__PURE__ */ n(
|
|
822
|
-
|
|
823
|
+
Xt,
|
|
823
824
|
{
|
|
824
|
-
field: m && H ?
|
|
825
|
+
field: m && H ? xt() : e,
|
|
825
826
|
value: xe,
|
|
826
827
|
onChange: Le,
|
|
827
828
|
relations: f,
|
|
828
|
-
collection:
|
|
829
|
+
collection: c,
|
|
829
830
|
itemId: l,
|
|
830
831
|
cascadeFilter: M,
|
|
831
832
|
requiredParentLabel: Be,
|
|
832
|
-
narrowedBy: O.length > 0 ?
|
|
833
|
-
onCountChange: o ?
|
|
833
|
+
narrowedBy: O.length > 0 ? ft() : void 0,
|
|
834
|
+
onCountChange: o ? Je : void 0
|
|
834
835
|
}
|
|
835
836
|
)
|
|
836
837
|
},
|
|
@@ -838,7 +839,7 @@ const ur = St(function({
|
|
|
838
839
|
)
|
|
839
840
|
}
|
|
840
841
|
),
|
|
841
|
-
Ee && /* @__PURE__ */ n(
|
|
842
|
+
Ee && /* @__PURE__ */ n(yn, { value: i[e.field], config: Ee }),
|
|
842
843
|
w && // The message under the field: a red border alone never said WHY (Service End before
|
|
843
844
|
// Start, b01-N5). The form's summary at the top lists it too.
|
|
844
845
|
/* @__PURE__ */ n(
|
|
@@ -859,9 +860,9 @@ const ur = St(function({
|
|
|
859
860
|
children: Pe
|
|
860
861
|
}
|
|
861
862
|
),
|
|
862
|
-
Ae && !
|
|
863
|
+
Ae && !rt && /* @__PURE__ */ n(cn, { field: e.field, text: Ae }),
|
|
863
864
|
qe && /* @__PURE__ */ n(
|
|
864
|
-
|
|
865
|
+
Yt,
|
|
865
866
|
{
|
|
866
867
|
change: qe,
|
|
867
868
|
onDismiss: () => d == null ? void 0 : d.dismissRemoteChange(e.field),
|
|
@@ -877,8 +878,9 @@ const ur = St(function({
|
|
|
877
878
|
);
|
|
878
879
|
});
|
|
879
880
|
export {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
881
|
+
pr as FieldRow,
|
|
882
|
+
Rn as clearableParents,
|
|
883
|
+
Ln as isAiEligible,
|
|
884
|
+
mr as lineageSummary,
|
|
885
|
+
Sn as useFieldLineage
|
|
884
886
|
};
|