@nivaro/react 0.3.139 → 0.3.140
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 +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,156 +1,158 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as S, useRef as G, useEffect as _, useCallback as z } from "react";
|
|
3
3
|
import { get as M, del as W, post as H, patch as Q } from "../lib/commands.js";
|
|
4
4
|
import { useOptionalNivaroClient as T, useGridFlush as X } from "../shared/context.js";
|
|
5
|
-
|
|
5
|
+
import { numberKindOf as Y } from "../shared/lib/number-kind.js";
|
|
6
|
+
import { formatNumberAs as Z } from "../shared/lib/number-format.js";
|
|
7
|
+
function tt({
|
|
6
8
|
value: o,
|
|
7
9
|
onValue: d,
|
|
8
10
|
placeholder: l
|
|
9
11
|
}) {
|
|
10
|
-
const [m,
|
|
12
|
+
const [m, g] = S(null), i = o == null ? "" : String(o);
|
|
11
13
|
return /* @__PURE__ */ r(
|
|
12
14
|
"input",
|
|
13
15
|
{
|
|
14
16
|
type: "number",
|
|
15
17
|
value: m ?? i,
|
|
16
|
-
onChange: (
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
18
|
+
onChange: (u) => {
|
|
19
|
+
var R;
|
|
20
|
+
const h = u.target.value;
|
|
21
|
+
if (h === "" && ((R = u.target.validity) != null && R.badInput)) {
|
|
22
|
+
g("");
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
|
-
if (
|
|
24
|
-
const w = Number(
|
|
25
|
+
if (g(h), h.trim() === "") return d(null);
|
|
26
|
+
const w = Number(h);
|
|
25
27
|
Number.isFinite(w) && d(w);
|
|
26
28
|
},
|
|
27
|
-
onBlur: () =>
|
|
29
|
+
onBlur: () => g(null),
|
|
28
30
|
placeholder: l,
|
|
29
31
|
"data-nf-grid-cell": !0
|
|
30
32
|
}
|
|
31
33
|
);
|
|
32
34
|
}
|
|
33
|
-
async function
|
|
34
|
-
const m = /* @__PURE__ */ new Map(),
|
|
35
|
-
for (let i = 0; i <
|
|
35
|
+
async function K(o, d, l) {
|
|
36
|
+
const m = /* @__PURE__ */ new Map(), g = [...new Set(l)].filter((i) => i && i !== "new");
|
|
37
|
+
for (let i = 0; i < g.length; i += 500)
|
|
36
38
|
try {
|
|
37
|
-
const
|
|
39
|
+
const u = await o.request(
|
|
38
40
|
M("/revisions/latest", {
|
|
39
41
|
collection: d,
|
|
40
|
-
items:
|
|
42
|
+
items: g.slice(i, i + 500).join(",")
|
|
41
43
|
})
|
|
42
44
|
);
|
|
43
|
-
for (const [
|
|
44
|
-
m.set(
|
|
45
|
+
for (const [h, w] of Object.entries((u == null ? void 0 : u.data) ?? {}))
|
|
46
|
+
m.set(h, typeof w == "number" && Number.isFinite(w) ? w : null);
|
|
45
47
|
} catch {
|
|
46
48
|
}
|
|
47
49
|
return m;
|
|
48
50
|
}
|
|
49
|
-
function
|
|
51
|
+
function et(o) {
|
|
50
52
|
var l;
|
|
51
53
|
const d = o == null ? void 0 : o.response;
|
|
52
54
|
return (((l = d == null ? void 0 : d.data) == null ? void 0 : l.code) ?? (d == null ? void 0 : d.code)) === "MIDAIR_COLLISION";
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function L(o) {
|
|
55
57
|
return o.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
|
|
56
58
|
}
|
|
57
|
-
function
|
|
59
|
+
function ot({
|
|
58
60
|
field: o,
|
|
59
61
|
itemId: d
|
|
60
62
|
}) {
|
|
61
|
-
const l = T(), m = X(),
|
|
62
|
-
_(() => (
|
|
63
|
-
|
|
63
|
+
const l = T(), m = X(), g = o.relation, i = (g == null ? void 0 : g.relatedCollection) ?? "", u = (g == null ? void 0 : g.manyField) ?? "", [h, w] = S([]), [R, O] = S([]), [C, x] = S(/* @__PURE__ */ new Map()), [y, $] = S([]), [N, j] = S(/* @__PURE__ */ new Set()), v = G(!0);
|
|
64
|
+
_(() => (v.current = !0, () => {
|
|
65
|
+
v.current = !1;
|
|
64
66
|
}), []);
|
|
65
|
-
const
|
|
66
|
-
if (!(!l || !d || !i || !
|
|
67
|
+
const V = C.size > 0 || y.length > 0 || N.size > 0, I = G(/* @__PURE__ */ new Map()), k = z(async () => {
|
|
68
|
+
if (!(!l || !d || !i || !u))
|
|
67
69
|
try {
|
|
68
70
|
const n = (await l.request(
|
|
69
71
|
M(`/items/${i}`, {
|
|
70
|
-
filter: JSON.stringify({ [
|
|
72
|
+
filter: JSON.stringify({ [u]: { _eq: d } }),
|
|
71
73
|
limit: 200,
|
|
72
74
|
fields: "*"
|
|
73
75
|
})
|
|
74
76
|
)).data ?? [];
|
|
75
|
-
|
|
77
|
+
I.current = await K(
|
|
76
78
|
l,
|
|
77
79
|
i,
|
|
78
80
|
n.map((e) => String(e.id))
|
|
79
|
-
),
|
|
81
|
+
), v.current && O(n);
|
|
80
82
|
} catch {
|
|
81
|
-
|
|
83
|
+
v.current && O([]);
|
|
82
84
|
}
|
|
83
|
-
}, [l, d, i,
|
|
85
|
+
}, [l, d, i, u]);
|
|
84
86
|
_(() => {
|
|
85
87
|
!l || !i || l.request(M(`/field-config/${i}`)).then((t) => {
|
|
86
|
-
if (!
|
|
88
|
+
if (!v.current) return;
|
|
87
89
|
const n = (t.data ?? []).filter(
|
|
88
|
-
(e) => !e.field.startsWith("_") && e.field !== "id" && e.field !==
|
|
90
|
+
(e) => !e.field.startsWith("_") && e.field !== "id" && e.field !== u
|
|
89
91
|
);
|
|
90
92
|
w(n);
|
|
91
93
|
}).catch(() => {
|
|
92
94
|
});
|
|
93
|
-
}, [l, i,
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
const
|
|
95
|
+
}, [l, i, u]), _(() => {
|
|
96
|
+
k();
|
|
97
|
+
}, [k]);
|
|
98
|
+
const U = z(async () => {
|
|
97
99
|
if (!l) return;
|
|
98
|
-
for (const e of
|
|
100
|
+
for (const e of N)
|
|
99
101
|
await l.request(W(`/items/${i}/${e}`));
|
|
100
|
-
for (const e of
|
|
101
|
-
await l.request(H(`/items/${i}`, { ...e, [
|
|
102
|
-
const t = [...
|
|
102
|
+
for (const e of y)
|
|
103
|
+
await l.request(H(`/items/${i}`, { ...e, [u]: d }));
|
|
104
|
+
const t = [...C].filter(([e]) => !N.has(e)), n = t.map(([e]) => e).filter((e) => !((I.current.get(e) ?? 0) > 0));
|
|
103
105
|
if (n.length > 0) {
|
|
104
|
-
const e = await
|
|
105
|
-
for (const [
|
|
106
|
+
const e = await K(l, i, n);
|
|
107
|
+
for (const [f, a] of e) I.current.set(f, a);
|
|
106
108
|
}
|
|
107
|
-
for (const [e,
|
|
108
|
-
const a =
|
|
109
|
+
for (const [e, f] of t) {
|
|
110
|
+
const a = I.current.get(e);
|
|
109
111
|
try {
|
|
110
112
|
await l.request(
|
|
111
113
|
Q(
|
|
112
114
|
`/items/${i}/${e}`,
|
|
113
|
-
typeof a == "number" && a > 0 ? { ...
|
|
115
|
+
typeof a == "number" && a > 0 ? { ...f, _base_revision: a } : f
|
|
114
116
|
)
|
|
115
117
|
);
|
|
116
|
-
} catch (
|
|
117
|
-
throw
|
|
118
|
+
} catch (s) {
|
|
119
|
+
throw et(s) && await k(), s;
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
}, [l, i,
|
|
122
|
-
_(() => (m == null || m.register(
|
|
123
|
-
function
|
|
124
|
-
var a,
|
|
125
|
-
return e ? ((a =
|
|
122
|
+
v.current && (x(/* @__PURE__ */ new Map()), $([]), j(/* @__PURE__ */ new Set()), await k());
|
|
123
|
+
}, [l, i, u, d, N, y, C, k]), q = `inline-grid:${i}:${u}`;
|
|
124
|
+
_(() => (m == null || m.register(q, U), () => m == null ? void 0 : m.unregister(q)), [m, q, U]);
|
|
125
|
+
function B(t, n, e, f) {
|
|
126
|
+
var a, s;
|
|
127
|
+
return e ? ((a = y[f]) == null ? void 0 : a[n]) ?? "" : ((s = C.get(String(t.id))) == null ? void 0 : s[n]) ?? t[n] ?? "";
|
|
126
128
|
}
|
|
127
|
-
function
|
|
128
|
-
if (
|
|
129
|
-
|
|
129
|
+
function J(t, n, e, f, a) {
|
|
130
|
+
if (f) {
|
|
131
|
+
$((b) => b.map((c, P) => P === a ? { ...c, [n]: e } : c));
|
|
130
132
|
return;
|
|
131
133
|
}
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
return
|
|
134
|
+
const s = String(t.id);
|
|
135
|
+
x((b) => {
|
|
136
|
+
const c = new Map(b);
|
|
137
|
+
return c.set(s, { ...c.get(s) ?? {}, [n]: e }), c;
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
|
-
function
|
|
139
|
-
const a =
|
|
140
|
+
function A(t, n, e, f) {
|
|
141
|
+
const a = B(n, t.field, e, f), s = (c) => J(n, t.field, c, e, f), b = ["integer", "bigInteger", "float", "decimal", "numeric"].includes(t.type);
|
|
140
142
|
return t.type === "boolean" ? /* @__PURE__ */ r(
|
|
141
143
|
"input",
|
|
142
144
|
{
|
|
143
145
|
type: "checkbox",
|
|
144
146
|
checked: !!a,
|
|
145
|
-
onChange: (
|
|
147
|
+
onChange: (c) => s(c.target.checked),
|
|
146
148
|
"data-nf-grid-cell-checkbox": !0
|
|
147
149
|
}
|
|
148
|
-
) :
|
|
150
|
+
) : b ? /* @__PURE__ */ r(tt, { value: a, onValue: s, placeholder: t.note ?? void 0 }) : t.type === "datetime" || t.interface === "datetime" ? /* @__PURE__ */ r(
|
|
149
151
|
"input",
|
|
150
152
|
{
|
|
151
153
|
type: "datetime-local",
|
|
152
154
|
value: a ? String(a).slice(0, 16) : "",
|
|
153
|
-
onChange: (
|
|
155
|
+
onChange: (c) => s(c.target.value ? new Date(c.target.value).toISOString() : null),
|
|
154
156
|
"data-nf-grid-cell": !0
|
|
155
157
|
}
|
|
156
158
|
) : /* @__PURE__ */ r(
|
|
@@ -158,7 +160,7 @@ function it({
|
|
|
158
160
|
{
|
|
159
161
|
type: "text",
|
|
160
162
|
value: a == null ? "" : String(a),
|
|
161
|
-
onChange: (
|
|
163
|
+
onChange: (c) => s(c.target.value || null),
|
|
162
164
|
placeholder: t.note ?? void 0,
|
|
163
165
|
"data-nf-grid-cell": !0
|
|
164
166
|
}
|
|
@@ -166,37 +168,37 @@ function it({
|
|
|
166
168
|
}
|
|
167
169
|
if (!d)
|
|
168
170
|
return /* @__PURE__ */ r("div", { "data-nf-inline-grid": !0, "data-nf-inline-grid-empty": !0, children: /* @__PURE__ */ r("p", { "data-nf-empty": !0, children: "Save the record first to manage related rows." }) });
|
|
169
|
-
const E =
|
|
170
|
-
...E.map((t) => ({ ...t, ...
|
|
171
|
-
...
|
|
172
|
-
],
|
|
171
|
+
const E = R.filter((t) => !N.has(String(t.id))), D = [
|
|
172
|
+
...E.map((t) => ({ ...t, ...C.get(String(t.id)) ?? {} })),
|
|
173
|
+
...y
|
|
174
|
+
], F = h.filter(
|
|
173
175
|
(t) => ["integer", "bigInteger", "float", "decimal", "numeric"].includes(t.type)
|
|
174
176
|
);
|
|
175
177
|
return /* @__PURE__ */ p("div", { "data-nf-inline-grid": !0, children: [
|
|
176
178
|
/* @__PURE__ */ p("span", { "data-nf-inline-grid-label": !0, children: [
|
|
177
|
-
o.label ??
|
|
179
|
+
o.label ?? L(o.field),
|
|
178
180
|
o.note ? /* @__PURE__ */ p("span", { "data-nf-inline-grid-note": !0, title: o.note, children: [
|
|
179
181
|
" ",
|
|
180
182
|
"?"
|
|
181
183
|
] }) : null
|
|
182
184
|
] }),
|
|
183
|
-
|
|
185
|
+
V && /* @__PURE__ */ r("div", { "data-nf-inline-grid-pending": !0, children: "Unsaved changes — will save with the record" }),
|
|
184
186
|
/* @__PURE__ */ p("div", { "data-nf-inline-grid-wrap": !0, children: [
|
|
185
187
|
/* @__PURE__ */ r("div", { "data-nf-inline-grid-scroll": !0, children: /* @__PURE__ */ p("table", { "data-nf-inline-grid-table": !0, children: [
|
|
186
188
|
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
187
|
-
|
|
189
|
+
h.map((t) => /* @__PURE__ */ r("th", { "data-nf-grid-th": !0, children: t.label ?? L(t.field) }, t.field)),
|
|
188
190
|
/* @__PURE__ */ r("th", { "data-nf-grid-th-action": !0 })
|
|
189
191
|
] }) }),
|
|
190
192
|
/* @__PURE__ */ p("tbody", { children: [
|
|
191
193
|
E.map((t) => /* @__PURE__ */ p("tr", { "data-nf-grid-row": !0, children: [
|
|
192
|
-
|
|
194
|
+
h.map((n) => /* @__PURE__ */ r("td", { "data-nf-grid-td": !0, children: A(n, t, !1, -1) }, n.field)),
|
|
193
195
|
/* @__PURE__ */ r("td", { "data-nf-grid-td-action": !0, children: /* @__PURE__ */ r(
|
|
194
196
|
"button",
|
|
195
197
|
{
|
|
196
198
|
type: "button",
|
|
197
199
|
"data-nf-grid-delete": !0,
|
|
198
200
|
"aria-label": "Delete row",
|
|
199
|
-
onClick: () =>
|
|
201
|
+
onClick: () => j((n) => {
|
|
200
202
|
const e = new Set(n);
|
|
201
203
|
return e.add(String(t.id)), e;
|
|
202
204
|
}),
|
|
@@ -204,20 +206,20 @@ function it({
|
|
|
204
206
|
}
|
|
205
207
|
) })
|
|
206
208
|
] }, String(t.id))),
|
|
207
|
-
|
|
209
|
+
y.map((t, n) => /* @__PURE__ */ p(
|
|
208
210
|
"tr",
|
|
209
211
|
{
|
|
210
212
|
"data-nf-grid-row": !0,
|
|
211
213
|
"data-nf-grid-row-new": !0,
|
|
212
214
|
children: [
|
|
213
|
-
|
|
215
|
+
h.map((e) => /* @__PURE__ */ r("td", { "data-nf-grid-td": !0, children: A(e, t, !0, n) }, e.field)),
|
|
214
216
|
/* @__PURE__ */ r("td", { "data-nf-grid-td-action": !0, children: /* @__PURE__ */ r(
|
|
215
217
|
"button",
|
|
216
218
|
{
|
|
217
219
|
type: "button",
|
|
218
220
|
"data-nf-grid-delete": !0,
|
|
219
221
|
"aria-label": "Remove new row",
|
|
220
|
-
onClick: () =>
|
|
222
|
+
onClick: () => $((e) => e.filter((f, a) => a !== n)),
|
|
221
223
|
children: "×"
|
|
222
224
|
}
|
|
223
225
|
) })
|
|
@@ -225,16 +227,17 @@ function it({
|
|
|
225
227
|
},
|
|
226
228
|
t._rowId ?? `new-${n}`
|
|
227
229
|
)),
|
|
228
|
-
|
|
230
|
+
D.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: h.length + 1, "data-nf-grid-empty-row": !0, children: "No rows yet" }) })
|
|
229
231
|
] }),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (!
|
|
233
|
-
const e =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
F.length > 0 && D.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ p("tr", { "data-nf-grid-totals": !0, children: [
|
|
233
|
+
h.map((t) => {
|
|
234
|
+
if (!F.some((s) => s.field === t.field)) return /* @__PURE__ */ r("td", { "data-nf-grid-total-cell": !0 }, t.field);
|
|
235
|
+
const e = D.reduce((s, b) => s + (Number(b[t.field]) || 0), 0), f = Y(t), a = Z(
|
|
236
|
+
e,
|
|
237
|
+
f === "money" ? "money" : Number.isInteger(e) ? "count" : "decimal",
|
|
238
|
+
t
|
|
239
|
+
);
|
|
240
|
+
return /* @__PURE__ */ r("td", { "data-nf-grid-total-cell": !0, "data-nf-grid-total-num": !0, children: a }, t.field);
|
|
238
241
|
}),
|
|
239
242
|
/* @__PURE__ */ r("td", { "data-nf-grid-total-cell": !0 })
|
|
240
243
|
] }) })
|
|
@@ -244,7 +247,7 @@ function it({
|
|
|
244
247
|
{
|
|
245
248
|
type: "button",
|
|
246
249
|
"data-nf-grid-add": !0,
|
|
247
|
-
onClick: () =>
|
|
250
|
+
onClick: () => $((t) => [...t, { _rowId: crypto.randomUUID() }]),
|
|
248
251
|
children: "+ Add row"
|
|
249
252
|
}
|
|
250
253
|
) })
|
|
@@ -252,7 +255,7 @@ function it({
|
|
|
252
255
|
] });
|
|
253
256
|
}
|
|
254
257
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
tt as GridNumberInput,
|
|
259
|
+
ot as InlineGridField,
|
|
260
|
+
K as latestRevisions
|
|
258
261
|
};
|
|
@@ -10,7 +10,7 @@ import { noteReplayIdle as Me, createReplayIdleState as Ne, REPLAY_IDLE_RESTART_
|
|
|
10
10
|
import { noteReplayEvent as Ue, createReplayCheckoutState as We } from "../shared/lib/replay-checkout.js";
|
|
11
11
|
import { instrumentConsole as He, instrumentRequests as Ke, redactSecrets as $e } from "../shared/lib/replay-context.js";
|
|
12
12
|
import { instrumentSocket as Be } from "../shared/lib/replay-socket.js";
|
|
13
|
-
const ze = "nivaro-react@0.3.
|
|
13
|
+
const ze = "nivaro-react@0.3.140", V = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, X = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
14
14
|
function Je(o) {
|
|
15
15
|
return typeof o.url != "string" || typeof fetch != "function" ? null : (f, u) => {
|
|
16
16
|
const l = typeof o.getToken == "function" ? o.getToken() : void 0, d = { "Content-Type": "application/json" };
|
package/dist/index.d.ts
CHANGED
|
@@ -316,6 +316,20 @@ export declare interface ActivityLabels {
|
|
|
316
316
|
timeZone?: string | null;
|
|
317
317
|
/** `junction:id` → what a link row links, as the reader may see it. */
|
|
318
318
|
junctions?: Record<string, ActivityJunctionLabel>;
|
|
319
|
+
/** `collection.field` → how a number field's values read ("$12,345.67", "12,345").
|
|
320
|
+
* Absent = shown as stored. Kinds follow lib/number-kind.ts (the server decides). */
|
|
321
|
+
numbers?: Record<string, ActivityNumberFormat>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** How a changed number reads: money with its currency, grouped decimals or counts. */
|
|
325
|
+
declare interface ActivityNumberFormat {
|
|
326
|
+
kind: 'money' | 'decimal' | 'count';
|
|
327
|
+
/** ISO code for money (default USD). */
|
|
328
|
+
currency?: string;
|
|
329
|
+
/** Fraction digits the field keeps (default 2). */
|
|
330
|
+
decimals?: number;
|
|
331
|
+
/** A unit other than '$' appended after the number ("days", "%"). */
|
|
332
|
+
unit?: string;
|
|
319
333
|
}
|
|
320
334
|
|
|
321
335
|
/** One child-row change as the server summarised it for this reader — labels, never ids. */
|
|
@@ -1670,6 +1684,8 @@ declare type ChartSpec = {
|
|
|
1670
1684
|
label: string;
|
|
1671
1685
|
value: number;
|
|
1672
1686
|
}>;
|
|
1687
|
+
/** 'currency' = the values are money: the axis and tooltip read $12.3k / $12,345. */
|
|
1688
|
+
unit?: 'currency';
|
|
1673
1689
|
};
|
|
1674
1690
|
|
|
1675
1691
|
export declare function ChatAnalyticsView(): JSX.Element;
|
|
@@ -4047,6 +4063,22 @@ export declare function ExternalRequestsChip({ collection, itemId }: {
|
|
|
4047
4063
|
/** Field paths an expression reads, without evaluating it. */
|
|
4048
4064
|
export declare function extractExpressionTokens(src: string): string[];
|
|
4049
4065
|
|
|
4066
|
+
/** What the server says about an extra column's numbers (extra_field_meta). */
|
|
4067
|
+
declare interface ExtraNumberMeta {
|
|
4068
|
+
path: string;
|
|
4069
|
+
choices?: Array<{
|
|
4070
|
+
value: string;
|
|
4071
|
+
text: string;
|
|
4072
|
+
}>;
|
|
4073
|
+
/** One number per row (a number field, a per-row aggregate, an addendum's cost). */
|
|
4074
|
+
number?: boolean;
|
|
4075
|
+
/** How it reads (lib/number-kind.ts, decided by the server from the field). Older
|
|
4076
|
+
* servers do not send it: the column's name and the value decide. */
|
|
4077
|
+
number_kind?: 'money' | 'decimal' | 'count' | 'plain';
|
|
4078
|
+
currency?: string;
|
|
4079
|
+
decimals?: number;
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4050
4082
|
/** A folded section the host adds under the list (the admin's unregistered/system tables). */
|
|
4051
4083
|
declare interface ExtraSectionSpec {
|
|
4052
4084
|
key: string;
|
|
@@ -7405,7 +7437,7 @@ export declare function LiveCount({ value, format, className }: LiveCountProps):
|
|
|
7405
7437
|
|
|
7406
7438
|
declare interface LiveCountProps {
|
|
7407
7439
|
value: number | string | null | undefined;
|
|
7408
|
-
/** Render the text (e.g. `99+`, a unit); default is the
|
|
7440
|
+
/** Render the text (e.g. `99+`, a unit); default is the number grouped (formatNumber). */
|
|
7409
7441
|
format?: (value: number | string) => ReactNode;
|
|
7410
7442
|
className?: string;
|
|
7411
7443
|
}
|
|
@@ -10147,7 +10179,7 @@ declare interface QueueItemRow {
|
|
|
10147
10179
|
url: string;
|
|
10148
10180
|
}
|
|
10149
10181
|
|
|
10150
|
-
export declare function QueueItemSheet({ item, onOpenChange, onClaim, onRelease, workNextActive, onNext, refetchItems, stateLabels, collectionLabel, claimsEnabled, columnFormats, fieldLabel, width, itemLayout, onOpenRecord }: {
|
|
10182
|
+
export declare function QueueItemSheet({ item, onOpenChange, onClaim, onRelease, workNextActive, onNext, refetchItems, stateLabels, collectionLabel, claimsEnabled, columnFormats, extraMeta, fieldLabel, width, itemLayout, onOpenRecord }: {
|
|
10151
10183
|
item: SheetItem | null;
|
|
10152
10184
|
onOpenChange: (open: boolean) => void;
|
|
10153
10185
|
onClaim: (item: SheetItem) => void;
|
|
@@ -10163,6 +10195,8 @@ export declare function QueueItemSheet({ item, onOpenChange, onClaim, onRelease,
|
|
|
10163
10195
|
claimsEnabled?: boolean;
|
|
10164
10196
|
/** Extra-field path → display format config (display-only). */
|
|
10165
10197
|
columnFormats?: Record<string, ColumnFormatConfig>;
|
|
10198
|
+
/** The queue's extra_field_meta: choices and how number columns read. */
|
|
10199
|
+
extraMeta?: ExtraNumberMeta[];
|
|
10166
10200
|
/** Extra-field path → the label its list column header shows (the queue's column
|
|
10167
10201
|
* alias); without it the path is spelled out (army 7 N7: "PROJECT TYPE → NAME"). */
|
|
10168
10202
|
fieldLabel?: (field: string) => string;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { cn as i } from "../lib/utils.js";
|
|
3
|
-
function
|
|
2
|
+
import { cn as i, formatNumber as c } from "../lib/utils.js";
|
|
3
|
+
function h(e) {
|
|
4
4
|
var l;
|
|
5
|
-
const
|
|
6
|
-
return (((l =
|
|
5
|
+
const r = e, a = r != null && r.response && "data" in r.response ? r.response.data : r == null ? void 0 : r.response;
|
|
6
|
+
return (((l = r == null ? void 0 : r.response) == null ? void 0 : l.status) ?? (r == null ? void 0 : r.status)) !== 409 || (a == null ? void 0 : a.code) !== "AUDIENCE_CONFIRM_REQUIRED" || !a.audience ? null : a.audience;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
if (e.includes_everyone) return `Saving this tells everyone (${e.count} people).`;
|
|
10
|
-
const
|
|
8
|
+
function b(e) {
|
|
9
|
+
if (e.includes_everyone) return `Saving this tells everyone (${c(e.count)} people).`;
|
|
10
|
+
const r = `${e.count} ${e.count === 1 ? "person" : "people"}`;
|
|
11
11
|
if (e.includes_roles.length > 0) {
|
|
12
|
-
const
|
|
13
|
-
return `Saving this tells ${
|
|
12
|
+
const a = e.includes_roles.map((n) => n.name).join(", ");
|
|
13
|
+
return `Saving this tells ${r}, including the whole ${a} role${e.includes_roles.length > 1 ? "s" : ""}.`;
|
|
14
14
|
}
|
|
15
|
-
return `Saving this tells ${
|
|
15
|
+
return `Saving this tells ${r} — more than ${e.threshold}.`;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function p({
|
|
18
18
|
preview: e,
|
|
19
|
-
onConfirm:
|
|
20
|
-
onCancel:
|
|
19
|
+
onConfirm: r,
|
|
20
|
+
onCancel: a,
|
|
21
21
|
busy: n = !1,
|
|
22
22
|
confirmLabel: l = "Confirm and save",
|
|
23
23
|
className: m
|
|
@@ -33,7 +33,7 @@ function h({
|
|
|
33
33
|
m
|
|
34
34
|
),
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */ d("p", { className: "font-semibold", children:
|
|
36
|
+
/* @__PURE__ */ d("p", { className: "font-semibold", children: b(e) }),
|
|
37
37
|
e.includes_roles.length > 0 && /* @__PURE__ */ d("div", { className: "mt-2 flex flex-wrap gap-1.5", children: e.includes_roles.map((t) => /* @__PURE__ */ s(
|
|
38
38
|
"span",
|
|
39
39
|
{
|
|
@@ -71,7 +71,7 @@ function h({
|
|
|
71
71
|
{
|
|
72
72
|
type: "button",
|
|
73
73
|
disabled: n,
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: r,
|
|
75
75
|
className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white disabled:opacity-50",
|
|
76
76
|
children: n ? "Saving…" : l
|
|
77
77
|
}
|
|
@@ -81,7 +81,7 @@ function h({
|
|
|
81
81
|
{
|
|
82
82
|
type: "button",
|
|
83
83
|
disabled: n,
|
|
84
|
-
onClick:
|
|
84
|
+
onClick: a,
|
|
85
85
|
className: "h-8 rounded-md border border-amber-300 bg-white px-3 text-[12.5px] font-medium text-amber-800 hover:bg-amber-100 disabled:opacity-50 dark:border-amber-400/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-400/15",
|
|
86
86
|
children: "Cancel"
|
|
87
87
|
}
|
|
@@ -92,7 +92,7 @@ function h({
|
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
p as AudienceConfirmPanel,
|
|
96
|
+
h as audienceConfirmFromError,
|
|
97
|
+
b as audienceSummary
|
|
98
98
|
};
|