@nivaro/react 0.3.56 → 0.3.58
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 +9 -2
- package/dist/shared/components/CollectionBrowserView.js +2827 -2750
- package/dist/shared/components/DataTable.js +247 -236
- package/dist/shared/components/ItemEditForm.js +1693 -1668
- package/dist/shared/components/ProfileView.js +716 -715
- package/dist/shared/components/RecordReadView.js +367 -364
- package/dist/shared/components/ReportView.js +64 -39
- package/dist/shared/components/alerts/AlertManagerView.js +284 -271
- 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/FieldRow.js +175 -173
- package/dist/shared/components/item-edit/InlineTableField.js +407 -402
- package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
- package/dist/shared/components/item-edit/PlanGrid.js +826 -803
- package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
- package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
- package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
- package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
- 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 +5 -5
- 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 +2 -3
- package/dist/shared/components/panels/PipelinePanel.js +1027 -978
- package/dist/shared/components/panels/RevisionsPanel.js +4 -1
- 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 +86 -78
- package/dist/shared/components/profile/AiMemoryCard.js +12 -10
- package/dist/shared/components/queue/OwnerAvatars.js +80 -41
- package/dist/shared/components/queue/QueueItemSheet.js +111 -111
- package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
- package/dist/shared/components/queue/QueueWorklist.js +975 -964
- package/dist/shared/components/queue/group-sums.js +27 -0
- package/dist/shared/components/queue/live-state-aspect.js +7 -3
- package/dist/shared/components/queue/path-label.js +14 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
- package/dist/shared/lib/back-closes.js +25 -0
- package/dist/shared/lib/cbv-page-warm.js +36 -0
- package/dist/shared/lib/form-usage-beacon.js +7 -7
- package/dist/shared/lib/list-page-memory.js +41 -0
- package/dist/shared/lib/live.js +44 -44
- package/dist/shared/lib/own-writes.js +76 -28
- package/dist/shared/lib/record-ref.js +78 -53
- package/dist/shared/lib/request-gate.js +110 -109
- package/dist/shared/lib/validation-rules.js +34 -19
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ChevronRight as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as ae } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronRight as se, AlertCircle as oe } from "lucide-react";
|
|
4
|
+
import { useState as D, useMemo as K } from "react";
|
|
5
|
+
import { useNivaroClient as ie, useItemEditAuth as de } from "../../context.js";
|
|
6
|
+
import { useBackCloses as ue } from "../../lib/back-closes.js";
|
|
7
|
+
import { post as W, patch as ce } from "../../lib/commands.js";
|
|
8
|
+
import { formatDateTime as Z, cn as H, formatDate as me } from "../../lib/utils.js";
|
|
9
|
+
import { TooltipProvider as pe, Tooltip as be, TooltipTrigger as fe, TooltipContent as xe } from "../ui/tooltip.js";
|
|
10
|
+
function Q(r) {
|
|
10
11
|
return r === !0 || r === 1 || r === "1" || r === "true";
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function F(r, t) {
|
|
13
14
|
if (r == null || r === "") return "—";
|
|
14
15
|
if (t === "currency" || t === "number") {
|
|
15
16
|
const a = Number(r);
|
|
@@ -17,11 +18,11 @@ function A(r, t) {
|
|
|
17
18
|
}
|
|
18
19
|
if (t === "date" || t === "datetime") {
|
|
19
20
|
const a = new Date(r);
|
|
20
|
-
return Number.isNaN(a.getTime()) ? String(r) : t === "date" ?
|
|
21
|
+
return Number.isNaN(a.getTime()) ? String(r) : t === "date" ? me(typeof r == "string" ? r : a) : Z(a);
|
|
21
22
|
}
|
|
22
23
|
return String(r);
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
+
const R = {
|
|
25
26
|
green: "#16a34a",
|
|
26
27
|
red: "#dc2626",
|
|
27
28
|
amber: "#d97706",
|
|
@@ -29,71 +30,71 @@ const I = {
|
|
|
29
30
|
purple: "#9333ea",
|
|
30
31
|
slate: "#64748b"
|
|
31
32
|
};
|
|
32
|
-
function
|
|
33
|
+
function he(r) {
|
|
33
34
|
return {
|
|
34
35
|
backgroundColor: r ? `${r}22` : "#f1f5f9",
|
|
35
36
|
color: r ?? "#475569",
|
|
36
37
|
border: `1px solid ${r ? `${r}44` : "#e2e8f0"}`
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
const a = t ?
|
|
40
|
+
function I({ label: r, color: t }) {
|
|
41
|
+
const a = t ? R[t] ?? null : null;
|
|
41
42
|
return /* @__PURE__ */ n(
|
|
42
43
|
"span",
|
|
43
44
|
{
|
|
44
45
|
className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium",
|
|
45
|
-
style:
|
|
46
|
+
style: he(a),
|
|
46
47
|
children: r
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function we(r, t) {
|
|
51
52
|
if (r == null || r === "")
|
|
52
53
|
return t.empty_label ? { label: t.empty_label, color: t.empty_color ?? "blue" } : { label: "—", color: null };
|
|
53
54
|
const a = t.options.find((u) => u.value === String(r));
|
|
54
55
|
return a ? { label: a.status_label || a.label, color: a.color } : { label: String(r), color: null };
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function ye(r, t) {
|
|
57
58
|
const a = /* @__PURE__ */ new Map();
|
|
58
59
|
for (const x of r.rows) {
|
|
59
60
|
const s = String(x.group ?? ""), h = a.get(s);
|
|
60
61
|
h ? h.push(x) : a.set(s, [x]);
|
|
61
62
|
}
|
|
62
63
|
const u = Array.from(a.entries()).map(([x, s]) => {
|
|
63
|
-
const
|
|
64
|
-
let
|
|
65
|
-
return t && s.every((
|
|
64
|
+
const w = new Set(s.map((j) => String(j.status ?? ""))).size > 1, O = w ? null : s[0].status;
|
|
65
|
+
let $ = null;
|
|
66
|
+
return t && s.every((C) => t in C.values) && ($ = s.reduce((C, E) => C + (Number(E.values[t]) || 0), 0)), { key: x, rows: s, count: s.length, sum: $, uniformStatus: O, mixedStatus: w };
|
|
66
67
|
});
|
|
67
68
|
return u.sort((x, s) => x.key.localeCompare(s.key, void 0, { numeric: !0 })), u;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function X(r, t, a) {
|
|
70
71
|
let u = null;
|
|
71
72
|
for (const x of r) {
|
|
72
73
|
const s = x.values[t];
|
|
73
74
|
if (s == null || s === "") continue;
|
|
74
|
-
const h = typeof s == "number" ? s : Date.parse(String(s)),
|
|
75
|
-
Number.isFinite(
|
|
75
|
+
const h = typeof s == "number" ? s : Date.parse(String(s)), w = Number.isNaN(h) ? Number(s) : h;
|
|
76
|
+
Number.isFinite(w) && (u == null || (a ? w > u : w < u)) && (u = w);
|
|
76
77
|
}
|
|
77
78
|
return u;
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function J(r, t) {
|
|
80
81
|
const a = r.rows[0], u = (x) => {
|
|
81
|
-
const s = t.find((
|
|
82
|
+
const s = t.find((w) => w.role === x);
|
|
82
83
|
if (!s || !a) return null;
|
|
83
84
|
const h = a.values[s.field];
|
|
84
|
-
return h == null || h === "" ? null : `${s.prefix ?? ""}${
|
|
85
|
+
return h == null || h === "" ? null : `${s.prefix ?? ""}${F(h, s.format)}`;
|
|
85
86
|
};
|
|
86
87
|
return { title: u("title") ?? (r.key || "—"), subtitle: u("subtitle") };
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function Y(r, t) {
|
|
89
90
|
const a = (t == null ? void 0 : t.trim()) || "row";
|
|
90
91
|
return `${r} ${a}${r === 1 ? "" : "s"}`;
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
+
function ke(r, t, a) {
|
|
93
94
|
const u = a != null && a.trim() ? `${a.trim()} ` : "";
|
|
94
95
|
return `${r.label} ${u}${t.title}${t.subtitle ? ` · ${t.subtitle}` : ""}?`;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function Ae({
|
|
97
98
|
data: r,
|
|
98
99
|
config: t,
|
|
99
100
|
loading: a,
|
|
@@ -102,28 +103,30 @@ function Ce({
|
|
|
102
103
|
hostRecordId: s,
|
|
103
104
|
emptyLabel: h
|
|
104
105
|
}) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
const w = ie(), { userId: O } = de(), [$, j] = D(() => /* @__PURE__ */ new Set()), [C, E] = D(null), [L, ee] = D({}), [c, _] = D(null), [P, U] = D("");
|
|
107
|
+
ue(() => _(null), c != null);
|
|
108
|
+
const V = K(() => {
|
|
109
|
+
const e = r ? ye(r, t.aggregate_sum) : [], i = t.group_sort;
|
|
110
|
+
if (!(i != null && i.field)) return e;
|
|
111
|
+
const f = i.direction === "desc";
|
|
112
|
+
return [...e].sort((k, m) => {
|
|
113
|
+
const p = X(k.rows, i.field, f), y = X(m.rows, i.field, f);
|
|
114
|
+
return p == null && y == null ? 0 : p == null ? 1 : y == null ? -1 : f ? y - p : p - y;
|
|
112
115
|
});
|
|
113
|
-
}, [r, t.aggregate_sum, t.group_sort]),
|
|
114
|
-
queryKey: ["review-list-enrich", t.enrich_endpoint ?? "",
|
|
115
|
-
queryFn: () =>
|
|
116
|
-
W(t.enrich_endpoint, { ids:
|
|
116
|
+
}, [r, t.aggregate_sum, t.group_sort]), G = K(() => ((r == null ? void 0 : r.rows) ?? []).map((e) => String(e.id)), [r]), { data: q } = ae({
|
|
117
|
+
queryKey: ["review-list-enrich", t.enrich_endpoint ?? "", G.join(",")],
|
|
118
|
+
queryFn: () => w.request(
|
|
119
|
+
W(t.enrich_endpoint, { ids: G })
|
|
117
120
|
).then((e) => {
|
|
118
|
-
var
|
|
119
|
-
return ((
|
|
121
|
+
var i;
|
|
122
|
+
return ((i = e == null ? void 0 : e.data) == null ? void 0 : i.rows) ?? {};
|
|
120
123
|
}).catch(() => ({})),
|
|
121
|
-
enabled: !!t.enrich_endpoint &&
|
|
124
|
+
enabled: !!t.enrich_endpoint && G.length > 0,
|
|
122
125
|
staleTime: 3e4
|
|
123
|
-
}),
|
|
124
|
-
var
|
|
125
|
-
return (((
|
|
126
|
-
}),
|
|
126
|
+
}), T = (e) => q == null ? void 0 : q[String(e)], z = !!q && Object.values(q).some((e) => {
|
|
127
|
+
var i;
|
|
128
|
+
return (((i = e.chips) == null ? void 0 : i.length) ?? 0) > 0;
|
|
129
|
+
}), te = V.length === 1;
|
|
127
130
|
if (a)
|
|
128
131
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [0, 1].map((e) => /* @__PURE__ */ n(
|
|
129
132
|
"div",
|
|
@@ -136,95 +139,98 @@ function Ce({
|
|
|
136
139
|
return /* @__PURE__ */ n("p", { className: "text-[12px] text-red-500", children: u });
|
|
137
140
|
if (!r || r.rows.length === 0)
|
|
138
141
|
return /* @__PURE__ */ n("p", { className: "text-[12px] italic text-slate-400", children: h ? `No ${h.toLowerCase()} yet` : "Nothing here yet" });
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
return
|
|
142
|
+
const re = (e) => {
|
|
143
|
+
j((i) => {
|
|
144
|
+
const f = new Set(i);
|
|
145
|
+
return f.has(e) ? f.delete(e) : f.add(e), f;
|
|
143
146
|
});
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
|
|
147
|
+
}, le = (e, i) => {
|
|
148
|
+
U(""), _({ group: e, option: i });
|
|
149
|
+
}, ne = async (e, i, f) => {
|
|
150
|
+
E(e.key);
|
|
148
151
|
let k = null;
|
|
149
152
|
if (t.status.action_endpoint)
|
|
150
153
|
try {
|
|
151
|
-
await
|
|
154
|
+
await w.request(
|
|
152
155
|
W(t.status.action_endpoint, {
|
|
153
|
-
ids: e.rows.map((
|
|
154
|
-
status:
|
|
156
|
+
ids: e.rows.map((m) => m.id),
|
|
157
|
+
status: i.value,
|
|
155
158
|
// The status each row showed: the endpoint may refuse (409) rows
|
|
156
159
|
// someone changed since this list loaded instead of overwriting
|
|
157
160
|
// them. The refetch below shows what they are now.
|
|
158
161
|
expected: Object.fromEntries(
|
|
159
|
-
e.rows.map((
|
|
162
|
+
e.rows.map((m) => [String(m.id), m.status == null ? null : String(m.status)])
|
|
160
163
|
),
|
|
161
|
-
...
|
|
164
|
+
...f ? { note: f } : {},
|
|
162
165
|
...s != null && s !== "" ? { workflow_id: Number(s) } : {}
|
|
163
166
|
})
|
|
164
167
|
);
|
|
165
|
-
} catch (
|
|
166
|
-
const
|
|
167
|
-
k = (
|
|
168
|
+
} catch (m) {
|
|
169
|
+
const p = m == null ? void 0 : m.response;
|
|
170
|
+
k = (p == null ? void 0 : p.error) ?? "Failed to update";
|
|
168
171
|
}
|
|
169
172
|
else {
|
|
170
|
-
const
|
|
171
|
-
e.rows.map(async (
|
|
172
|
-
const
|
|
173
|
-
t.status.stamp_user_field &&
|
|
173
|
+
const m = t.status.stamp_date_field ? (/* @__PURE__ */ new Date()).toISOString() : void 0, y = (await Promise.all(
|
|
174
|
+
e.rows.map(async (N) => {
|
|
175
|
+
const g = { [t.status.field]: i.value };
|
|
176
|
+
t.status.stamp_user_field && O && (g[t.status.stamp_user_field] = O), t.status.stamp_date_field && (g[t.status.stamp_date_field] = m), f && (g._change_reason = f);
|
|
174
177
|
try {
|
|
175
|
-
return await
|
|
176
|
-
} catch (
|
|
177
|
-
const
|
|
178
|
-
return { ok: !1, error: (
|
|
178
|
+
return await w.request(ce(`/items/${t.collection}/${N.id}`, g)), { ok: !0 };
|
|
179
|
+
} catch (S) {
|
|
180
|
+
const v = S == null ? void 0 : S.response;
|
|
181
|
+
return { ok: !1, error: (v == null ? void 0 : v.error) ?? "Failed to update" };
|
|
179
182
|
}
|
|
180
183
|
})
|
|
181
|
-
)).filter((
|
|
182
|
-
|
|
184
|
+
)).filter((N) => !N.ok);
|
|
185
|
+
y.length > 0 && (k = `${y.length} of ${e.rows.length} row(s) failed to update`);
|
|
183
186
|
}
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
return k ?
|
|
187
|
+
E(null), ee((m) => {
|
|
188
|
+
const p = { ...m };
|
|
189
|
+
return k ? p[e.key] = k : delete p[e.key], p;
|
|
187
190
|
}), x();
|
|
188
|
-
},
|
|
189
|
-
return /* @__PURE__ */ n(
|
|
191
|
+
}, B = r.columns.line_columns, M = r.columns.group_meta;
|
|
192
|
+
return /* @__PURE__ */ n(pe, { delayDuration: 200, children: /* @__PURE__ */ b("div", { className: "space-y-2", children: [
|
|
190
193
|
r.truncated && /* @__PURE__ */ n("p", { className: "text-[11px] text-amber-600 dark:text-amber-400", children: "Showing first 2000 rows — some rows may be missing." }),
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
var
|
|
194
|
-
return ((
|
|
194
|
+
V.map((e) => {
|
|
195
|
+
const i = te ? !$.has(e.key) : $.has(e.key), f = e.rows.every((l) => {
|
|
196
|
+
var d;
|
|
197
|
+
return ((d = T(l.id)) == null ? void 0 : d.can_act) !== !1;
|
|
195
198
|
}), k = e.rows.map((l) => {
|
|
196
|
-
var
|
|
197
|
-
return (
|
|
198
|
-
}).find((l) => !!l) ?? "Only the workflow contact chain (or the PO requestor for invalid holds) can decide this",
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
var d;
|
|
200
|
+
return (d = T(l.id)) == null ? void 0 : d.reason;
|
|
201
|
+
}).find((l) => !!l) ?? "Only the workflow contact chain (or the PO requestor for invalid holds) can decide this", m = e.rows.map((l) => {
|
|
202
|
+
var d, o;
|
|
203
|
+
return (o = (d = T(l.id)) == null ? void 0 : d.note) == null ? void 0 : o.trim();
|
|
204
|
+
}).find((l) => !!l) ?? null, p = J(e, M), y = e.mixedStatus ? { label: "Mixed", color: null } : we(e.uniformStatus, t.status), N = e.rows[0], g = N.stamp_user, S = N.stamp_date, v = e.rows.reduce((l, d) => {
|
|
205
|
+
var o;
|
|
206
|
+
for (const A of ((o = T(d.id)) == null ? void 0 : o.chips) ?? []) {
|
|
207
|
+
if (A.tone === "danger") return "danger";
|
|
208
|
+
A.tone === "warn" && l == null && (l = "warn");
|
|
203
209
|
}
|
|
204
210
|
return l;
|
|
205
211
|
}, null);
|
|
206
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ b(
|
|
207
213
|
"div",
|
|
208
214
|
{
|
|
209
215
|
"data-review-group": e.key,
|
|
210
216
|
"data-review-tone": v ?? void 0,
|
|
211
|
-
className:
|
|
217
|
+
className: H(
|
|
212
218
|
"rounded-md border",
|
|
213
219
|
v === "danger" ? "border-l-2 border-l-red-500 border-red-200 bg-red-50/40 dark:border-red-500/40 dark:bg-red-500/5" : v === "warn" ? "border-l-2 border-l-amber-500 border-amber-200 bg-amber-50/40 dark:border-amber-500/40 dark:bg-amber-500/5" : "border-slate-200 dark:border-border"
|
|
214
220
|
),
|
|
215
221
|
children: [
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ b("div", { className: "flex w-full flex-wrap items-center gap-2 px-3 py-2", children: [
|
|
223
|
+
/* @__PURE__ */ b(
|
|
218
224
|
"button",
|
|
219
225
|
{
|
|
220
226
|
type: "button",
|
|
221
|
-
onClick: () =>
|
|
227
|
+
onClick: () => re(e.key),
|
|
222
228
|
className: "flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",
|
|
223
229
|
children: [
|
|
224
230
|
/* @__PURE__ */ n(
|
|
225
|
-
|
|
231
|
+
se,
|
|
226
232
|
{
|
|
227
|
-
className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform ${
|
|
233
|
+
className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform ${i ? "rotate-90" : ""}`
|
|
228
234
|
}
|
|
229
235
|
),
|
|
230
236
|
/* @__PURE__ */ n(
|
|
@@ -232,43 +238,43 @@ function Ce({
|
|
|
232
238
|
{
|
|
233
239
|
className: "text-[12px] font-medium text-slate-700 dark:text-slate-200",
|
|
234
240
|
"data-review-group-title": !0,
|
|
235
|
-
children:
|
|
241
|
+
children: p.title
|
|
236
242
|
}
|
|
237
243
|
),
|
|
238
|
-
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
241
|
-
e.sum != null ? ` · ${
|
|
244
|
+
p.subtitle && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: p.subtitle }),
|
|
245
|
+
/* @__PURE__ */ b("span", { className: "text-[11px] text-slate-400", children: [
|
|
246
|
+
Y(e.count, t.row_noun),
|
|
247
|
+
e.sum != null ? ` · ${F(e.sum, t.aggregate_sum_format ?? "number")}` : ""
|
|
242
248
|
] }),
|
|
243
|
-
|
|
249
|
+
M.map((l) => {
|
|
244
250
|
if (l.role) return null;
|
|
245
|
-
const
|
|
246
|
-
return l.format === "flag" ?
|
|
251
|
+
const d = N.values[l.field];
|
|
252
|
+
return l.format === "flag" ? Q(d) ? /* @__PURE__ */ n(I, { label: l.label, color: l.color ?? "amber" }, l.field) : null : d == null || d === "" ? null : /* @__PURE__ */ b(
|
|
247
253
|
"span",
|
|
248
254
|
{
|
|
249
255
|
className: "rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-800 dark:text-slate-400",
|
|
250
256
|
children: [
|
|
251
257
|
l.label,
|
|
252
258
|
": ",
|
|
253
|
-
|
|
259
|
+
F(d, l.format)
|
|
254
260
|
]
|
|
255
261
|
},
|
|
256
262
|
l.field
|
|
257
263
|
);
|
|
258
264
|
}),
|
|
259
|
-
/* @__PURE__ */ n(
|
|
260
|
-
g && /* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */ n(
|
|
262
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ n(I, { label: y.label, color: y.color }),
|
|
266
|
+
g && /* @__PURE__ */ b(be, { children: [
|
|
267
|
+
/* @__PURE__ */ n(fe, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "cursor-default text-[11px] text-slate-400 underline decoration-dotted", children: g.label }) }),
|
|
268
|
+
/* @__PURE__ */ b(xe, { side: "top", className: "text-[12px]", children: [
|
|
263
269
|
/* @__PURE__ */ n("p", { className: "font-medium", children: g.label }),
|
|
264
|
-
|
|
270
|
+
S && /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Z(S) })
|
|
265
271
|
] })
|
|
266
272
|
] })
|
|
267
273
|
]
|
|
268
274
|
}
|
|
269
275
|
),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
!
|
|
276
|
+
/* @__PURE__ */ b("span", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
277
|
+
!f && /* @__PURE__ */ n(
|
|
272
278
|
"span",
|
|
273
279
|
{
|
|
274
280
|
className: "text-[11px] text-slate-400",
|
|
@@ -277,59 +283,71 @@ function Ce({
|
|
|
277
283
|
children: "View only"
|
|
278
284
|
}
|
|
279
285
|
),
|
|
280
|
-
|
|
281
|
-
const
|
|
286
|
+
f && t.status.options.map((l) => {
|
|
287
|
+
const d = !e.mixedStatus && String(e.uniformStatus) === l.value, o = R[l.color] ?? R.slate, A = C === e.key;
|
|
282
288
|
return /* @__PURE__ */ n(
|
|
283
289
|
"button",
|
|
284
290
|
{
|
|
285
291
|
type: "button",
|
|
286
|
-
disabled:
|
|
287
|
-
onClick: () =>
|
|
292
|
+
disabled: A || d,
|
|
293
|
+
onClick: () => le(e, l),
|
|
288
294
|
className: "rounded-md border px-2.5 py-1 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
289
295
|
style: {
|
|
290
|
-
backgroundColor:
|
|
291
|
-
borderColor: `${
|
|
292
|
-
color:
|
|
296
|
+
backgroundColor: d ? `${o}22` : "transparent",
|
|
297
|
+
borderColor: `${o}55`,
|
|
298
|
+
color: o
|
|
293
299
|
},
|
|
294
|
-
children:
|
|
300
|
+
children: A ? "…" : l.label
|
|
295
301
|
},
|
|
296
302
|
l.value
|
|
297
303
|
);
|
|
298
304
|
})
|
|
299
305
|
] })
|
|
300
306
|
] }),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
307
|
+
m && /* @__PURE__ */ b(
|
|
308
|
+
"p",
|
|
309
|
+
{
|
|
310
|
+
"data-review-decision-note": !0,
|
|
311
|
+
className: "border-t border-slate-100 px-3 py-1.5 text-[11.5px] text-red-700 dark:border-border dark:text-red-300",
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ n("span", { className: "font-medium", children: "Reason:" }),
|
|
314
|
+
" ",
|
|
315
|
+
/* @__PURE__ */ n("span", { className: "whitespace-pre-line", children: m })
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
L[e.key] && /* @__PURE__ */ b("p", { className: "flex items-center gap-1 px-3 pb-2 text-[11px] text-red-600", children: [
|
|
320
|
+
/* @__PURE__ */ n(oe, { className: "h-3 w-3 shrink-0" }),
|
|
321
|
+
L[e.key]
|
|
304
322
|
] }),
|
|
305
|
-
|
|
306
|
-
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */
|
|
307
|
-
|
|
308
|
-
|
|
323
|
+
i && /* @__PURE__ */ n("div", { className: "overflow-x-auto border-t border-slate-100 dark:border-border/50", children: /* @__PURE__ */ b("table", { className: "w-full border-collapse text-[12px]", children: [
|
|
324
|
+
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ b("tr", { className: "border-b border-slate-200 bg-slate-50/60 text-left text-[11px] font-medium text-slate-400 dark:border-border dark:bg-white/[0.02]", children: [
|
|
325
|
+
B.map((l) => /* @__PURE__ */ n("th", { className: "px-2.5 py-1.5 font-medium", children: l.label }, l.field)),
|
|
326
|
+
z && /* @__PURE__ */ n("th", { className: "px-2.5 py-1.5 font-medium", children: "Match" })
|
|
309
327
|
] }) }),
|
|
310
328
|
/* @__PURE__ */ n("tbody", { children: e.rows.map((l) => {
|
|
311
|
-
var
|
|
312
|
-
return /* @__PURE__ */
|
|
329
|
+
var d;
|
|
330
|
+
return /* @__PURE__ */ b(
|
|
313
331
|
"tr",
|
|
314
332
|
{
|
|
315
333
|
className: "border-b border-slate-100 last:border-b-0 dark:border-border/50",
|
|
316
334
|
children: [
|
|
317
|
-
|
|
335
|
+
B.map((o) => /* @__PURE__ */ n(
|
|
318
336
|
"td",
|
|
319
337
|
{
|
|
320
338
|
className: "px-2.5 py-1.5 text-slate-600 dark:text-slate-300",
|
|
321
|
-
children:
|
|
339
|
+
children: o.format === "flag" ? Q(l.values[o.field]) ? /* @__PURE__ */ n(I, { label: o.label, color: o.color ?? "amber" }) : "—" : F(l.values[o.field], o.format)
|
|
322
340
|
},
|
|
323
|
-
|
|
341
|
+
o.field
|
|
324
342
|
)),
|
|
325
|
-
|
|
343
|
+
z && /* @__PURE__ */ n("td", { className: "px-2.5 py-1.5", children: /* @__PURE__ */ n("span", { className: "flex flex-wrap gap-1", children: (((d = T(l.id)) == null ? void 0 : d.chips) ?? []).map((o) => /* @__PURE__ */ n(
|
|
326
344
|
"span",
|
|
327
345
|
{
|
|
328
|
-
title:
|
|
329
|
-
className:
|
|
330
|
-
children:
|
|
346
|
+
title: o.title,
|
|
347
|
+
className: o.tone === "ok" ? "rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : o.tone === "danger" ? "rounded-full bg-red-50 px-2 py-0.5 text-[10.5px] font-medium text-red-700 dark:bg-red-500/10 dark:text-red-400" : o.tone === "warn" ? "rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400" : "rounded-full bg-slate-100 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-slate-800 dark:text-slate-300",
|
|
348
|
+
children: o.label
|
|
331
349
|
},
|
|
332
|
-
|
|
350
|
+
o.label
|
|
333
351
|
)) }) })
|
|
334
352
|
]
|
|
335
353
|
},
|
|
@@ -342,21 +360,21 @@ function Ce({
|
|
|
342
360
|
e.key
|
|
343
361
|
);
|
|
344
362
|
}),
|
|
345
|
-
|
|
363
|
+
c && /* @__PURE__ */ n(
|
|
346
364
|
"div",
|
|
347
365
|
{
|
|
348
366
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/40 p-4",
|
|
349
|
-
onClick: () =>
|
|
367
|
+
onClick: () => _(null),
|
|
350
368
|
onKeyDown: (e) => {
|
|
351
|
-
e.key === "Escape" && (e.stopPropagation(),
|
|
369
|
+
e.key === "Escape" && (e.stopPropagation(), _(null));
|
|
352
370
|
},
|
|
353
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ b(
|
|
354
372
|
"div",
|
|
355
373
|
{
|
|
356
374
|
role: "dialog",
|
|
357
375
|
"aria-modal": "true",
|
|
358
376
|
"aria-labelledby": "review-confirm-title",
|
|
359
|
-
"data-review-confirm":
|
|
377
|
+
"data-review-confirm": c.option.value,
|
|
360
378
|
className: "w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-xl dark:border-border dark:bg-card",
|
|
361
379
|
onClick: (e) => e.stopPropagation(),
|
|
362
380
|
children: [
|
|
@@ -365,45 +383,45 @@ function Ce({
|
|
|
365
383
|
{
|
|
366
384
|
id: "review-confirm-title",
|
|
367
385
|
className: "text-[13px] font-medium text-slate-700 dark:text-slate-200",
|
|
368
|
-
children:
|
|
369
|
-
|
|
370
|
-
|
|
386
|
+
children: ke(
|
|
387
|
+
c.option,
|
|
388
|
+
J(c.group, M),
|
|
371
389
|
t.group_noun
|
|
372
390
|
)
|
|
373
391
|
}
|
|
374
392
|
),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
|
|
377
|
-
|
|
393
|
+
/* @__PURE__ */ b("p", { className: "mt-1 rounded-md border border-slate-200 bg-slate-50 px-2.5 py-1.5 text-[12px] tabular-nums text-slate-600 dark:border-border dark:bg-white/[0.03] dark:text-slate-300", children: [
|
|
394
|
+
Y(c.group.count, t.row_noun),
|
|
395
|
+
c.group.sum != null ? ` · ${F(c.group.sum, t.aggregate_sum_format ?? "number")}` : ""
|
|
378
396
|
] }),
|
|
379
397
|
/* @__PURE__ */ n(
|
|
380
398
|
"p",
|
|
381
399
|
{
|
|
382
400
|
className: "mt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
|
|
383
401
|
"data-review-confirm-notice": !0,
|
|
384
|
-
children:
|
|
402
|
+
children: c.option.confirm_notice ? `${c.option.confirm_notice}${c.option.require_note ? " A reason is required." : ""}` : c.option.require_note ? "A reason is required for this decision. It is recorded with the record." : "Nothing changes until you confirm. A note is optional and is recorded with the decision."
|
|
385
403
|
}
|
|
386
404
|
),
|
|
387
405
|
/* @__PURE__ */ n(
|
|
388
406
|
"textarea",
|
|
389
407
|
{
|
|
390
|
-
value:
|
|
391
|
-
onChange: (e) =>
|
|
408
|
+
value: P,
|
|
409
|
+
onChange: (e) => U(e.target.value),
|
|
392
410
|
rows: 3,
|
|
393
411
|
autoFocus: !0,
|
|
394
|
-
"aria-label":
|
|
412
|
+
"aria-label": c.option.require_note ? "Reason" : "Note (optional)",
|
|
395
413
|
"data-review-confirm-note": !0,
|
|
396
414
|
className: "mt-2 w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] text-slate-700 outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-200",
|
|
397
|
-
placeholder:
|
|
415
|
+
placeholder: c.option.require_note ? "Why is this being rejected?" : "Note (optional)"
|
|
398
416
|
}
|
|
399
417
|
),
|
|
400
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ b("div", { className: "mt-3 flex items-center justify-end gap-1.5", children: [
|
|
401
419
|
/* @__PURE__ */ n(
|
|
402
420
|
"button",
|
|
403
421
|
{
|
|
404
422
|
type: "button",
|
|
405
423
|
"data-review-confirm-cancel": !0,
|
|
406
|
-
onClick: () =>
|
|
424
|
+
onClick: () => _(null),
|
|
407
425
|
className: "rounded px-2.5 py-1 text-[11px] text-slate-500 hover:bg-slate-100 dark:hover:bg-muted",
|
|
408
426
|
children: "Cancel"
|
|
409
427
|
}
|
|
@@ -413,16 +431,16 @@ function Ce({
|
|
|
413
431
|
{
|
|
414
432
|
type: "button",
|
|
415
433
|
"data-review-confirm-submit": !0,
|
|
416
|
-
disabled: !!
|
|
434
|
+
disabled: !!c.option.require_note && !P.trim(),
|
|
417
435
|
onClick: () => {
|
|
418
|
-
const e =
|
|
419
|
-
|
|
436
|
+
const e = c;
|
|
437
|
+
_(null), ne(e.group, e.option, P.trim() || null);
|
|
420
438
|
},
|
|
421
|
-
className:
|
|
439
|
+
className: H(
|
|
422
440
|
"rounded px-3 py-1 text-[11px] font-medium hover:brightness-110 disabled:opacity-50",
|
|
423
|
-
|
|
441
|
+
c.option.require_note ? "bg-red-600 text-white" : "bg-nvr-cyan text-white"
|
|
424
442
|
),
|
|
425
|
-
children:
|
|
443
|
+
children: c.option.label
|
|
426
444
|
}
|
|
427
445
|
)
|
|
428
446
|
] })
|
|
@@ -434,10 +452,10 @@ function Ce({
|
|
|
434
452
|
] }) });
|
|
435
453
|
}
|
|
436
454
|
export {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
455
|
+
Ae as ReviewListWidget,
|
|
456
|
+
R as STATUS_COLOR_HEX,
|
|
457
|
+
ke as confirmTitle,
|
|
458
|
+
Y as countLabel,
|
|
459
|
+
F as formatValue,
|
|
460
|
+
J as groupName
|
|
443
461
|
};
|