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