@nivaro/react 0.3.48 → 0.3.50
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/InlineGridField.js +166 -105
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/shared/components/CellCopyLayer.js +81 -44
- package/dist/shared/components/CollectionBrowserView.js +306 -297
- package/dist/shared/components/DataTable.js +3 -3
- package/dist/shared/components/FulfilmentPill.js +98 -78
- package/dist/shared/components/ItemEditForm.js +4682 -4570
- package/dist/shared/components/NotificationSourcesCard.js +151 -147
- package/dist/shared/components/ProfileView.js +72 -70
- package/dist/shared/components/QueryTable.js +462 -333
- package/dist/shared/components/imports/ImportConsole.js +4 -4
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
- package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
- package/dist/shared/components/item-edit/CloneDialog.js +192 -142
- package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
- package/dist/shared/components/item-edit/FieldRow.js +236 -226
- package/dist/shared/components/item-edit/HeaderTools.js +118 -113
- package/dist/shared/components/item-edit/InlineGridField.js +92 -90
- package/dist/shared/components/item-edit/InlineTableField.js +3091 -2942
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
- package/dist/shared/components/item-edit/PlanGrid.js +162 -162
- package/dist/shared/components/item-edit/PolishFields.js +169 -162
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
- package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
- package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
- package/dist/shared/components/item-edit/helpers.js +181 -155
- package/dist/shared/components/item-edit/line-midair.js +201 -0
- package/dist/shared/components/item-edit/soft-rules.js +27 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
- package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
- package/dist/shared/components/notifications/DeliveryChips.js +9 -9
- package/dist/shared/components/panels/ItemLockBanner.js +414 -358
- package/dist/shared/components/panels/PipelinePanel.js +1171 -975
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
- package/dist/shared/components/profile/PersonProfile.js +23 -21
- package/dist/shared/components/profile/SignedInDevices.js +126 -0
- package/dist/shared/components/queue/QueueItemSheet.js +38 -37
- package/dist/shared/components/queue/QueueWorklist.js +870 -827
- package/dist/shared/components/queue/column-chooser.js +21 -0
- package/dist/shared/components/queue/live-state-aspect.js +6 -0
- package/dist/shared/components/support/SupportView.js +1 -1
- package/dist/shared/components/ui/number-draft-input.js +93 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
- package/dist/shared/lib/edit-lock-fields.js +7 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/reimport-visibility.js +10 -0
- package/package.json +1 -1
|
@@ -722,13 +722,13 @@ function er({
|
|
|
722
722
|
re && "flex h-full min-h-0 flex-col"
|
|
723
723
|
),
|
|
724
724
|
children: [
|
|
725
|
-
Xe && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
|
|
726
|
-
X !== void 0 && /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
725
|
+
Xe && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
|
|
726
|
+
X !== void 0 && /* @__PURE__ */ s("div", { className: "relative min-w-0 max-w-full", children: [
|
|
727
727
|
/* @__PURE__ */ e(Ge, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
728
728
|
/* @__PURE__ */ e(
|
|
729
729
|
j,
|
|
730
730
|
{
|
|
731
|
-
className: "h-8 w-56 border-slate-200 bg-slate-50 pl-8 text-[13px]",
|
|
731
|
+
className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
|
|
732
732
|
placeholder: Z,
|
|
733
733
|
value: v ?? "",
|
|
734
734
|
onChange: (t) => X(t.target.value)
|
|
@@ -1,70 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { cn as
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as d, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as z, useQuery as B } from "@tanstack/react-query";
|
|
3
|
+
import { useState as k, useRef as D, useLayoutEffect as H, useEffect as O } from "react";
|
|
4
|
+
import { createPortal as U } from "react-dom";
|
|
5
|
+
import { useNivaroClient as K } from "../context.js";
|
|
6
|
+
import { get as W } from "../lib/commands.js";
|
|
7
|
+
import { cn as L, formatRelative as Y, formatDateTime as A } from "../lib/utils.js";
|
|
8
|
+
import { provideCopyText as G } from "./CellCopyLayer.js";
|
|
9
|
+
function ae(n, s) {
|
|
10
|
+
const t = Number(n ?? 0) || 0, r = Number(s ?? 0) || 0;
|
|
10
11
|
return {
|
|
11
12
|
shipped: t,
|
|
12
|
-
requested:
|
|
13
|
-
status: t > 0 ?
|
|
13
|
+
requested: r,
|
|
14
|
+
status: t > 0 ? r > 0 && t >= r ? "complete" : "partial" : "none"
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
+
const se = [
|
|
17
18
|
{ value: "none", label: "Not shipped" },
|
|
18
19
|
{ value: "partial", label: "Partially shipped" },
|
|
19
20
|
{ value: "complete", label: "Shipped" }
|
|
20
21
|
];
|
|
21
|
-
function J({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
function J(n, s, t) {
|
|
23
|
+
const r = [n, "", `${s ? `${s} · ` : ""}Latest events`];
|
|
24
|
+
t.length === 0 && r.push("No events recorded yet.");
|
|
25
|
+
for (const l of t)
|
|
26
|
+
r.push("", `${l.context ?? l.label} · ${A(l.created_at)}`), l.text && r.push(l.text);
|
|
27
|
+
return r.join(`
|
|
28
|
+
`);
|
|
29
|
+
}
|
|
30
|
+
function le({
|
|
31
|
+
collection: n,
|
|
32
|
+
itemId: s,
|
|
24
33
|
figures: t,
|
|
25
|
-
label:
|
|
26
|
-
className:
|
|
34
|
+
label: r,
|
|
35
|
+
className: l
|
|
27
36
|
}) {
|
|
28
|
-
const
|
|
29
|
-
|
|
37
|
+
const I = K(), [$, i] = k(!1), h = D(null), [E, v] = k(null), [C, j] = k(null), f = $ && !!t && t.status !== "none";
|
|
38
|
+
H(() => {
|
|
30
39
|
if (!f) {
|
|
31
|
-
|
|
40
|
+
v(null);
|
|
32
41
|
return;
|
|
33
42
|
}
|
|
34
43
|
const e = () => {
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
44
|
+
const o = h.current;
|
|
45
|
+
if (!o) return;
|
|
46
|
+
const a = o.getBoundingClientRect(), N = o.closest('[role="dialog"]') ?? document.body;
|
|
47
|
+
j(N);
|
|
48
|
+
const M = window.innerHeight - a.bottom < 220 && a.top > window.innerHeight - a.bottom, P = Math.max(8, Math.min(a.left, window.innerWidth - 328)), R = M ? a.top - 4 : a.bottom + 4, _ = {
|
|
40
49
|
zIndex: 120,
|
|
41
|
-
...
|
|
50
|
+
...M ? { transform: "translateY(-100%)" } : {}
|
|
42
51
|
};
|
|
43
|
-
if (
|
|
44
|
-
|
|
52
|
+
if (N === document.body)
|
|
53
|
+
v({ position: "fixed", left: P, top: R, ..._ });
|
|
45
54
|
else {
|
|
46
|
-
const
|
|
47
|
-
|
|
55
|
+
const Q = N.getBoundingClientRect();
|
|
56
|
+
v({ position: "absolute", left: P - Q.left, top: R - Q.top, ..._ });
|
|
48
57
|
}
|
|
49
58
|
};
|
|
50
59
|
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
51
60
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
52
61
|
};
|
|
53
62
|
}, [f]);
|
|
54
|
-
const
|
|
55
|
-
queryKey: ["fulfilment-events",
|
|
56
|
-
queryFn: () =>
|
|
57
|
-
(e) => e.sort((
|
|
63
|
+
const T = z(), y = {
|
|
64
|
+
queryKey: ["fulfilment-events", n, s],
|
|
65
|
+
queryFn: () => I.request(W("/comments/related", { collection: n, item: s })).then((e) => (e.data ?? []).filter((o) => o.source === "external")).then(
|
|
66
|
+
(e) => e.sort((o, a) => new Date(a.created_at).getTime() - new Date(o.created_at).getTime()).slice(0, 3)
|
|
58
67
|
).catch(() => []),
|
|
59
|
-
enabled: p && !!t && t.status !== "none",
|
|
60
68
|
staleTime: 6e4
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const
|
|
69
|
+
}, { data: w } = B({ ...y, enabled: f }), m = (t == null ? void 0 : t.status) ?? "none", p = m === "complete" ? "Shipped" : m === "partial" ? "Partial" : "Not shipped", q = t ? t.requested > 0 ? `${u(t.shipped)} / ${u(t.requested)} · ${p}` : p : "", F = D({ queryClient: T, eventsQuery: y, pillText: q, label: r });
|
|
70
|
+
F.current = { queryClient: T, eventsQuery: y, pillText: q, label: r };
|
|
71
|
+
const x = m !== "none";
|
|
72
|
+
if (O(() => {
|
|
73
|
+
const e = h.current;
|
|
74
|
+
if (!(!e || !x))
|
|
75
|
+
return G(e, async () => {
|
|
76
|
+
const o = F.current, a = await o.queryClient.fetchQuery(o.eventsQuery);
|
|
77
|
+
return J(o.pillText, o.label, a);
|
|
78
|
+
});
|
|
79
|
+
}, [x]), !t) return /* @__PURE__ */ d("span", { className: "text-slate-300", children: "—" });
|
|
80
|
+
const { shipped: S, requested: b } = t, g = m === "complete" ? {
|
|
64
81
|
dot: "bg-emerald-500",
|
|
65
82
|
text: "text-emerald-700 dark:text-emerald-300",
|
|
66
83
|
box: "border-emerald-200 bg-emerald-50/70 dark:border-emerald-900/40 dark:bg-emerald-900/10"
|
|
67
|
-
} :
|
|
84
|
+
} : m === "partial" ? {
|
|
68
85
|
dot: "bg-amber-500",
|
|
69
86
|
text: "text-amber-700 dark:text-amber-300",
|
|
70
87
|
box: "border-amber-200 bg-amber-50/70 dark:border-amber-900/40 dark:bg-amber-900/10"
|
|
@@ -72,80 +89,83 @@ function J({
|
|
|
72
89
|
dot: "bg-slate-300 dark:bg-slate-600",
|
|
73
90
|
text: "text-slate-500 dark:text-slate-400",
|
|
74
91
|
box: "border-slate-200 bg-slate-50 dark:border-border dark:bg-muted"
|
|
75
|
-
}
|
|
76
|
-
return /* @__PURE__ */
|
|
92
|
+
};
|
|
93
|
+
return /* @__PURE__ */ c(
|
|
77
94
|
"button",
|
|
78
95
|
{
|
|
79
|
-
ref:
|
|
96
|
+
ref: h,
|
|
80
97
|
type: "button",
|
|
81
|
-
className:
|
|
82
|
-
onMouseEnter: () =>
|
|
83
|
-
onMouseLeave: () =>
|
|
84
|
-
onFocus: () =>
|
|
85
|
-
onBlur: () =>
|
|
98
|
+
className: L("relative inline-flex cursor-default", l),
|
|
99
|
+
onMouseEnter: () => i(!0),
|
|
100
|
+
onMouseLeave: () => i(!1),
|
|
101
|
+
onFocus: () => i(!0),
|
|
102
|
+
onBlur: () => i(!1),
|
|
86
103
|
onClick: (e) => {
|
|
87
|
-
e.stopPropagation(),
|
|
104
|
+
e.stopPropagation(), i((o) => !o);
|
|
88
105
|
},
|
|
89
|
-
"aria-label": `${
|
|
90
|
-
"data-fulfilment":
|
|
91
|
-
"data-fulfilment-open":
|
|
106
|
+
"aria-label": `${p}${b > 0 ? ` — ${u(S)} of ${u(b)}` : ""}`,
|
|
107
|
+
"data-fulfilment": m,
|
|
108
|
+
"data-fulfilment-open": $ ? "true" : void 0,
|
|
109
|
+
"data-copy-source": x ? "" : void 0,
|
|
110
|
+
"data-copy-label": x ? "Copy with latest events" : void 0,
|
|
92
111
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ c(
|
|
94
113
|
"span",
|
|
95
114
|
{
|
|
96
|
-
className:
|
|
115
|
+
className: L(
|
|
97
116
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium tabular-nums",
|
|
98
|
-
|
|
99
|
-
|
|
117
|
+
g.box,
|
|
118
|
+
g.text
|
|
100
119
|
),
|
|
101
120
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
/* @__PURE__ */ d("span", { "aria-hidden": !0, className: L("h-1.5 w-1.5 shrink-0 rounded-full", g.dot) }),
|
|
122
|
+
b > 0 ? `${u(S)} / ${u(b)}` : p,
|
|
123
|
+
b > 0 && /* @__PURE__ */ c("span", { className: "opacity-70", children: [
|
|
105
124
|
"· ",
|
|
106
|
-
|
|
125
|
+
p
|
|
107
126
|
] })
|
|
108
127
|
]
|
|
109
128
|
}
|
|
110
129
|
),
|
|
111
|
-
f &&
|
|
112
|
-
/* @__PURE__ */
|
|
130
|
+
f && E && C && U(
|
|
131
|
+
/* @__PURE__ */ c(
|
|
113
132
|
"span",
|
|
114
133
|
{
|
|
115
134
|
role: "tooltip",
|
|
116
|
-
style:
|
|
135
|
+
style: E,
|
|
117
136
|
className: "block w-[320px] rounded-md border border-slate-200 bg-white p-2 text-left text-[11px] shadow-lg dark:border-border dark:bg-popover",
|
|
118
137
|
"data-fulfilment-events": !0,
|
|
119
138
|
"data-no-copy": !0,
|
|
120
|
-
onMouseEnter: () =>
|
|
121
|
-
onMouseLeave: () =>
|
|
139
|
+
onMouseEnter: () => i(!0),
|
|
140
|
+
onMouseLeave: () => i(!1),
|
|
122
141
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
142
|
+
/* @__PURE__ */ c("span", { className: "block text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
143
|
+
r ? `${r} · ` : "",
|
|
125
144
|
"latest events"
|
|
126
145
|
] }),
|
|
127
|
-
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
146
|
+
w ? w.length === 0 ? /* @__PURE__ */ d("span", { className: "mt-1 block text-slate-400", children: "No events recorded yet." }) : /* @__PURE__ */ d("ul", { className: "mt-1 space-y-1", children: w.map((e) => /* @__PURE__ */ c("li", { className: "leading-snug", children: [
|
|
147
|
+
/* @__PURE__ */ d("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: e.context ?? e.label }),
|
|
148
|
+
/* @__PURE__ */ c("span", { className: "text-slate-400", children: [
|
|
130
149
|
" · ",
|
|
131
|
-
|
|
150
|
+
Y(e.created_at)
|
|
132
151
|
] }),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
] }, e.id)) }) : /* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ d("span", { className: "line-clamp-2 block whitespace-normal text-slate-500 dark:text-slate-400", children: e.text })
|
|
153
|
+
] }, e.id)) }) : /* @__PURE__ */ d("span", { className: "mt-1 block text-slate-400", children: "Loading…" })
|
|
135
154
|
]
|
|
136
155
|
}
|
|
137
156
|
),
|
|
138
|
-
|
|
157
|
+
C
|
|
139
158
|
)
|
|
140
159
|
]
|
|
141
160
|
}
|
|
142
161
|
);
|
|
143
162
|
}
|
|
144
|
-
function u(
|
|
145
|
-
return Number.isInteger(
|
|
163
|
+
function u(n) {
|
|
164
|
+
return Number.isInteger(n) ? n.toLocaleString() : n.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
146
165
|
}
|
|
147
166
|
export {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
167
|
+
se as FULFILMENT_FILTER_OPTIONS,
|
|
168
|
+
le as FulfilmentPill,
|
|
169
|
+
J as fulfilmentCopyText,
|
|
170
|
+
ae as fulfilmentFigures
|
|
151
171
|
};
|