@nivaro/react 0.3.138 → 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.
Files changed (88) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +36 -2
  5. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  6. package/dist/shared/components/BroadcastView.js +213 -211
  7. package/dist/shared/components/CollectionBrowserView.js +2677 -2658
  8. package/dist/shared/components/ConfigHistory.js +45 -45
  9. package/dist/shared/components/ConformanceView.js +110 -110
  10. package/dist/shared/components/DataTable.js +51 -51
  11. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  12. package/dist/shared/components/ItemEditForm.js +3038 -3027
  13. package/dist/shared/components/LiveCount.js +27 -23
  14. package/dist/shared/components/LiveTraceView.js +62 -61
  15. package/dist/shared/components/PageRenderer.js +422 -410
  16. package/dist/shared/components/ProfileView.js +199 -199
  17. package/dist/shared/components/QualityRulesView.js +70 -70
  18. package/dist/shared/components/QueryTable.js +131 -130
  19. package/dist/shared/components/RecordGraph.js +98 -98
  20. package/dist/shared/components/RecordReadView.js +287 -288
  21. package/dist/shared/components/ReportView.js +1279 -1259
  22. package/dist/shared/components/SlaRulesView.js +73 -74
  23. package/dist/shared/components/WidgetSlot.js +73 -73
  24. package/dist/shared/components/ai/AiChart.js +36 -32
  25. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  26. package/dist/shared/components/ai/TaskDo.js +87 -87
  27. package/dist/shared/components/ai/answer-formats.js +37 -30
  28. package/dist/shared/components/ai/call-log/format.js +17 -16
  29. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  30. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  32. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  33. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  34. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  35. package/dist/shared/components/cbv/column-totals.js +53 -51
  36. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  37. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  38. package/dist/shared/components/command-center/announce.js +7 -6
  39. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  40. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  41. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  42. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  43. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  44. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  45. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  46. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  47. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  48. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  49. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  50. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  51. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  52. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  53. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  54. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  55. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  56. package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
  57. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  58. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  59. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  60. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  61. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  62. package/dist/shared/components/ops-report/format.js +37 -36
  63. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  64. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  65. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  66. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  67. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  68. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  69. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  70. package/dist/shared/components/profile/DelegationCard.js +13 -12
  71. package/dist/shared/components/profile/PersonActivity.js +48 -48
  72. package/dist/shared/components/profile/PersonExtras.js +107 -107
  73. package/dist/shared/components/profile/PersonWeek.js +9 -9
  74. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  75. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  76. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  77. package/dist/shared/components/queue/QueueWorklist.js +671 -670
  78. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  79. package/dist/shared/components/support/RequestList.js +121 -121
  80. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  81. package/dist/shared/lib/activity-sentence.js +316 -278
  82. package/dist/shared/lib/format-value.js +5 -4
  83. package/dist/shared/lib/number-format.js +87 -0
  84. package/dist/shared/lib/number-kind.js +133 -0
  85. package/dist/shared/lib/utils.js +24 -20
  86. package/dist/shared/lib/watch-list.js +1 -1
  87. package/dist/shared/lib/widget-value-format.js +26 -12
  88. 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 v, useRef as L, useEffect as _, useCallback as z } from "react";
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
- function Y({
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, f] = v(null), i = o == null ? "" : String(o);
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: (c) => {
17
- var $;
18
- const g = c.target.value;
19
- if (g === "" && (($ = c.target.validity) != null && $.badInput)) {
20
- f("");
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 (f(g), g.trim() === "") return d(null);
24
- const w = Number(g);
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: () => f(null),
29
+ onBlur: () => g(null),
28
30
  placeholder: l,
29
31
  "data-nf-grid-cell": !0
30
32
  }
31
33
  );
32
34
  }
33
- async function A(o, d, l) {
34
- const m = /* @__PURE__ */ new Map(), f = [...new Set(l)].filter((i) => i && i !== "new");
35
- for (let i = 0; i < f.length; i += 500)
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 c = await o.request(
39
+ const u = await o.request(
38
40
  M("/revisions/latest", {
39
41
  collection: d,
40
- items: f.slice(i, i + 500).join(",")
42
+ items: g.slice(i, i + 500).join(",")
41
43
  })
42
44
  );
43
- for (const [g, w] of Object.entries((c == null ? void 0 : c.data) ?? {}))
44
- m.set(g, typeof w == "number" && Number.isFinite(w) ? w : null);
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 Z(o) {
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 V(o) {
56
+ function L(o) {
55
57
  return o.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
56
58
  }
57
- function it({
59
+ function ot({
58
60
  field: o,
59
61
  itemId: d
60
62
  }) {
61
- const l = T(), m = X(), f = o.relation, i = (f == null ? void 0 : f.relatedCollection) ?? "", c = (f == null ? void 0 : f.manyField) ?? "", [g, w] = v([]), [$, x] = v([]), [S, O] = v(/* @__PURE__ */ new Map()), [b, k] = v([]), [C, F] = v(/* @__PURE__ */ new Set()), y = L(!0);
62
- _(() => (y.current = !0, () => {
63
- y.current = !1;
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 B = S.size > 0 || b.length > 0 || C.size > 0, D = L(/* @__PURE__ */ new Map()), N = z(async () => {
66
- if (!(!l || !d || !i || !c))
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({ [c]: { _eq: d } }),
72
+ filter: JSON.stringify({ [u]: { _eq: d } }),
71
73
  limit: 200,
72
74
  fields: "*"
73
75
  })
74
76
  )).data ?? [];
75
- D.current = await A(
77
+ I.current = await K(
76
78
  l,
77
79
  i,
78
80
  n.map((e) => String(e.id))
79
- ), y.current && x(n);
81
+ ), v.current && O(n);
80
82
  } catch {
81
- y.current && x([]);
83
+ v.current && O([]);
82
84
  }
83
- }, [l, d, i, c]);
85
+ }, [l, d, i, u]);
84
86
  _(() => {
85
87
  !l || !i || l.request(M(`/field-config/${i}`)).then((t) => {
86
- if (!y.current) return;
88
+ if (!v.current) return;
87
89
  const n = (t.data ?? []).filter(
88
- (e) => !e.field.startsWith("_") && e.field !== "id" && e.field !== c
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, c]), _(() => {
94
- N();
95
- }, [N]);
96
- const j = z(async () => {
95
+ }, [l, i, u]), _(() => {
96
+ k();
97
+ }, [k]);
98
+ const U = z(async () => {
97
99
  if (!l) return;
98
- for (const e of C)
100
+ for (const e of N)
99
101
  await l.request(W(`/items/${i}/${e}`));
100
- for (const e of b)
101
- await l.request(H(`/items/${i}`, { ...e, [c]: d }));
102
- const t = [...S].filter(([e]) => !C.has(e)), n = t.map(([e]) => e).filter((e) => !((D.current.get(e) ?? 0) > 0));
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 A(l, i, n);
105
- for (const [s, a] of e) D.current.set(s, a);
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, s] of t) {
108
- const a = D.current.get(e);
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 ? { ...s, _base_revision: a } : s
115
+ typeof a == "number" && a > 0 ? { ...f, _base_revision: a } : f
114
116
  )
115
117
  );
116
- } catch (h) {
117
- throw Z(h) && await N(), h;
118
+ } catch (s) {
119
+ throw et(s) && await k(), s;
118
120
  }
119
121
  }
120
- y.current && (O(/* @__PURE__ */ new Map()), k([]), F(/* @__PURE__ */ new Set()), await N());
121
- }, [l, i, c, d, C, b, S, N]), I = `inline-grid:${i}:${c}`;
122
- _(() => (m == null || m.register(I, j), () => m == null ? void 0 : m.unregister(I)), [m, I, j]);
123
- function J(t, n, e, s) {
124
- var a, h;
125
- return e ? ((a = b[s]) == null ? void 0 : a[n]) ?? "" : ((h = S.get(String(t.id))) == null ? void 0 : h[n]) ?? t[n] ?? "";
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 K(t, n, e, s, a) {
128
- if (s) {
129
- k((R) => R.map((u, P) => P === a ? { ...u, [n]: e } : u));
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 h = String(t.id);
133
- O((R) => {
134
- const u = new Map(R);
135
- return u.set(h, { ...u.get(h) ?? {}, [n]: e }), u;
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 U(t, n, e, s) {
139
- const a = J(n, t.field, e, s), h = (u) => K(n, t.field, u, e, s), R = ["integer", "bigInteger", "float", "decimal", "numeric"].includes(t.type);
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: (u) => h(u.target.checked),
147
+ onChange: (c) => s(c.target.checked),
146
148
  "data-nf-grid-cell-checkbox": !0
147
149
  }
148
- ) : R ? /* @__PURE__ */ r(Y, { value: a, onValue: h, placeholder: t.note ?? void 0 }) : t.type === "datetime" || t.interface === "datetime" ? /* @__PURE__ */ r(
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: (u) => h(u.target.value ? new Date(u.target.value).toISOString() : null),
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: (u) => h(u.target.value || null),
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 = $.filter((t) => !C.has(String(t.id))), q = [
170
- ...E.map((t) => ({ ...t, ...S.get(String(t.id)) ?? {} })),
171
- ...b
172
- ], G = g.filter(
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 ?? V(o.field),
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
- B && /* @__PURE__ */ r("div", { "data-nf-inline-grid-pending": !0, children: "Unsaved changes — will save with the record" }),
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
- g.map((t) => /* @__PURE__ */ r("th", { "data-nf-grid-th": !0, children: t.label ?? V(t.field) }, t.field)),
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
- g.map((n) => /* @__PURE__ */ r("td", { "data-nf-grid-td": !0, children: U(n, t, !1, -1) }, n.field)),
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: () => F((n) => {
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
- b.map((t, n) => /* @__PURE__ */ p(
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
- g.map((e) => /* @__PURE__ */ r("td", { "data-nf-grid-td": !0, children: U(e, t, !0, n) }, e.field)),
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: () => k((e) => e.filter((s, a) => a !== n)),
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
- q.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: g.length + 1, "data-nf-grid-empty-row": !0, children: "No rows yet" }) })
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
- G.length > 0 && q.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ p("tr", { "data-nf-grid-totals": !0, children: [
231
- g.map((t) => {
232
- if (!G.some((s) => s.field === t.field)) return /* @__PURE__ */ r("td", { "data-nf-grid-total-cell": !0 }, t.field);
233
- const e = q.reduce((s, a) => s + (Number(a[t.field]) || 0), 0);
234
- return /* @__PURE__ */ r("td", { "data-nf-grid-total-cell": !0, "data-nf-grid-total-num": !0, children: e.toLocaleString(void 0, {
235
- minimumFractionDigits: 2,
236
- maximumFractionDigits: 2
237
- }) }, t.field);
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: () => k((t) => [...t, { _rowId: crypto.randomUUID() }]),
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
- Y as GridNumberInput,
256
- it as InlineGridField,
257
- A as latestRevisions
258
+ tt as GridNumberInput,
259
+ ot as InlineGridField,
260
+ K as latestRevisions
258
261
  };