@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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o, jsxs as p, Fragment as Ye } from "react/jsx-runtime";
|
|
2
2
|
import { Search as dt, Download as it, ArrowUp as ut, ArrowDown as bt, ChevronsDownUp as mt, ChevronsUpDown as ct } from "lucide-react";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as K, useEffect as pt } from "react";
|
|
4
4
|
import { evaluateNumeric as ht } from "../lib/expression.js";
|
|
5
5
|
function ft(s) {
|
|
6
6
|
return `color-mix(in srgb, ${s} 55%, white)`;
|
|
@@ -55,12 +55,12 @@ function vt(s, t, b, c = "month") {
|
|
|
55
55
|
const u = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set();
|
|
56
56
|
let y = !1;
|
|
57
57
|
for (const h of s) {
|
|
58
|
-
const
|
|
59
|
-
let w = u.get(
|
|
58
|
+
const J = t.key_fields.map((O) => String(h[O] ?? "")).join("|");
|
|
59
|
+
let w = u.get(J);
|
|
60
60
|
if (!w) {
|
|
61
61
|
w = {};
|
|
62
62
|
for (const O of t.key_fields) w[O] = h[O];
|
|
63
|
-
u.set(
|
|
63
|
+
u.set(J, w);
|
|
64
64
|
}
|
|
65
65
|
const z = String(h[t.date_field] ?? ""), I = /^(\d{4})-(\d{2})/.exec(z);
|
|
66
66
|
if (!I) {
|
|
@@ -77,40 +77,40 @@ function vt(s, t, b, c = "month") {
|
|
|
77
77
|
g.add(I[1]), w[`y${I[1]}`] = (Number(w[`y${I[1]}`]) || 0) + V;
|
|
78
78
|
t.total !== !1 && (w.total = (Number(w.total) || 0) + V);
|
|
79
79
|
}
|
|
80
|
-
const v = [...g].filter((h) => Number(h) < b).sort(), L = [...g].filter((h) => Number(h) > b).sort(),
|
|
80
|
+
const v = [...g].filter((h) => Number(h) < b).sort(), L = [...g].filter((h) => Number(h) > b).sort(), le = c === "quarter" ? [1, 2, 3, 4].map((h) => ({
|
|
81
81
|
field: `q${h}`,
|
|
82
82
|
label: `Q${h}`,
|
|
83
83
|
format: "currency",
|
|
84
84
|
sum: !0
|
|
85
|
-
})) : Qe.map((h,
|
|
85
|
+
})) : Qe.map((h, J) => ({
|
|
86
86
|
field: h,
|
|
87
|
-
label: kt[
|
|
87
|
+
label: kt[J],
|
|
88
88
|
format: "currency",
|
|
89
89
|
sum: !0
|
|
90
|
-
})),
|
|
90
|
+
})), A = t.color ? { color: t.color, color_negative: t.color_negative } : {}, q = [
|
|
91
91
|
...v.map((h) => ({
|
|
92
92
|
field: `y${h}`,
|
|
93
93
|
label: h,
|
|
94
94
|
format: "currency",
|
|
95
95
|
sum: !0,
|
|
96
|
-
...
|
|
96
|
+
...A
|
|
97
97
|
})),
|
|
98
|
-
...
|
|
98
|
+
...le.map((h) => ({ ...h, ...A })),
|
|
99
99
|
...L.map((h) => ({
|
|
100
100
|
field: `y${h}`,
|
|
101
101
|
label: h,
|
|
102
102
|
format: "currency",
|
|
103
103
|
sum: !0,
|
|
104
|
-
...
|
|
104
|
+
...A
|
|
105
105
|
})),
|
|
106
|
-
...y ? [{ field: "undated", label: "Undated", format: "currency", sum: !0, ...
|
|
106
|
+
...y ? [{ field: "undated", label: "Undated", format: "currency", sum: !0, ...A }] : [],
|
|
107
107
|
...t.total !== !1 ? [
|
|
108
108
|
{
|
|
109
109
|
field: "total",
|
|
110
110
|
label: "Total",
|
|
111
111
|
format: "currency",
|
|
112
112
|
sum: !0,
|
|
113
|
-
...t.total_color ? { color: t.total_color, color_negative: t.color_negative } :
|
|
113
|
+
...t.total_color ? { color: t.total_color, color_negative: t.color_negative } : A
|
|
114
114
|
}
|
|
115
115
|
] : []
|
|
116
116
|
];
|
|
@@ -133,7 +133,7 @@ function gt(s, t) {
|
|
|
133
133
|
function j(s, t) {
|
|
134
134
|
return ht(s, t);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function he(s, t) {
|
|
137
137
|
if (s == null || s === "") return "—";
|
|
138
138
|
const b = Number(s);
|
|
139
139
|
if (!Number.isFinite(b)) return String(s);
|
|
@@ -155,7 +155,7 @@ function ae(s, t) {
|
|
|
155
155
|
return String(s);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ae(s) {
|
|
159
159
|
return s.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase());
|
|
160
160
|
}
|
|
161
161
|
function Et({
|
|
@@ -168,9 +168,9 @@ function Et({
|
|
|
168
168
|
emptyText: y
|
|
169
169
|
}) {
|
|
170
170
|
var Re, ze, Ie, He, We, Ke, Ae, Je, je, Ve;
|
|
171
|
-
const [v, L] =
|
|
171
|
+
const [v, L] = K(() => /* @__PURE__ */ new Set()), [le, A] = K("month"), [q, h] = K(null), [J, w] = K(""), [z, I] = K(!!((Re = t == null ? void 0 : t.hide_empty) != null && Re.default_on)), [V, O] = K(
|
|
172
172
|
() => new Set(((t == null ? void 0 : t.toggles) ?? []).filter((e) => e.default_on === !1).map((e) => e.label))
|
|
173
|
-
), [k, Xe] =
|
|
173
|
+
), [k, Xe] = K(null), [se, Ze] = K({
|
|
174
174
|
overflows: !1,
|
|
175
175
|
canScrollRight: !1,
|
|
176
176
|
cueInset: { right: 0, bottom: 0 }
|
|
@@ -192,7 +192,7 @@ function Et({
|
|
|
192
192
|
return /* @__PURE__ */ o("p", { className: "px-1 py-2 text-[12px] italic text-slate-400", children: y || (g ? `No ${g.toLowerCase()} yet` : "No data") });
|
|
193
193
|
let fe = null;
|
|
194
194
|
if (t != null && t.pivot) {
|
|
195
|
-
const e = c ?? t.pivot.year ?? (/* @__PURE__ */ new Date()).getFullYear(), r = vt(s, t.pivot, e,
|
|
195
|
+
const e = c ?? t.pivot.year ?? (/* @__PURE__ */ new Date()).getFullYear(), r = vt(s, t.pivot, e, le);
|
|
196
196
|
s = r.rows, fe = r.columns;
|
|
197
197
|
}
|
|
198
198
|
let $ = s;
|
|
@@ -246,7 +246,7 @@ function Et({
|
|
|
246
246
|
"Oct",
|
|
247
247
|
"Nov",
|
|
248
248
|
"Dec"
|
|
249
|
-
],
|
|
249
|
+
], oe = (t == null ? void 0 : t.highlight_group) === "$current_month" ? et[(/* @__PURE__ */ new Date()).getMonth()] : (t == null ? void 0 : t.highlight_group) ?? null, Le = (e) => !!oe && (e.group === oe || !e.group && e.label === oe), ne = (e) => Le(e) ? "bg-[#6366f10f] dark:bg-[#a5b4fc12]" : "", X = (e, r) => {
|
|
250
250
|
if (!e.color) return;
|
|
251
251
|
const a = e.color_negative && typeof r == "number" && r < 0, [d, l] = a ? Ce(e.color_negative) : Ce(e.color, e.color_dark);
|
|
252
252
|
return { "--qtc": d, "--qtcd": l };
|
|
@@ -266,9 +266,9 @@ function Et({
|
|
|
266
266
|
"div",
|
|
267
267
|
{
|
|
268
268
|
className: "flex min-w-[130px] items-center justify-end gap-1.5",
|
|
269
|
-
title: l === null ? void 0 : `${l.toLocaleString("en-US", { maximumFractionDigits: 1 })}% of ${
|
|
269
|
+
title: l === null ? void 0 : `${l.toLocaleString("en-US", { maximumFractionDigits: 1 })}% of ${he(d, r.format)}`,
|
|
270
270
|
children: [
|
|
271
|
-
/* @__PURE__ */ o("span", { children:
|
|
271
|
+
/* @__PURE__ */ o("span", { children: H(T(e, r), r.format) }),
|
|
272
272
|
/* @__PURE__ */ o("div", { className: "h-1 w-10 shrink-0 overflow-hidden rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ o(
|
|
273
273
|
"div",
|
|
274
274
|
{
|
|
@@ -287,11 +287,11 @@ function Et({
|
|
|
287
287
|
return a != null && a !== "" && Number(a) !== 0;
|
|
288
288
|
})
|
|
289
289
|
));
|
|
290
|
-
const
|
|
291
|
-
|
|
290
|
+
const de = t != null && t.search ? J.trim().toLowerCase() : "";
|
|
291
|
+
de && ($ = $.filter(
|
|
292
292
|
(e) => x.some((r) => {
|
|
293
293
|
const a = T(e, r);
|
|
294
|
-
return a == null || a === "" ? !1 : String(a).toLowerCase().includes(
|
|
294
|
+
return a == null || a === "" ? !1 : String(a).toLowerCase().includes(de) || he(a, r.format).toLowerCase().includes(de);
|
|
295
295
|
})
|
|
296
296
|
));
|
|
297
297
|
const ve = !!(t != null && t.sortable) && !(t != null && t.tree_group_by), ee = (e, r) => e.field ?? e.label ?? String(r);
|
|
@@ -310,7 +310,7 @@ function Et({
|
|
|
310
310
|
if (!(t != null && t.row_format_field) || !U(r)) return r.format;
|
|
311
311
|
const a = e[t.row_format_field];
|
|
312
312
|
return a === "currency" || a === "number" ? a : r.format;
|
|
313
|
-
},
|
|
313
|
+
}, H = (e, r) => t != null && t.zero_dash && Number(e) === 0 ? "—" : he(e, r), ie = (e, r) => {
|
|
314
314
|
var d;
|
|
315
315
|
if ((d = r.sparkline_fields) != null && d.length) {
|
|
316
316
|
const l = r.sparkline_fields.map((i) => Number(e[i]) || 0), n = Math.max(...l, 1), m = Math.min(...l, 0), F = Math.max(n - m, 1), M = l.map(
|
|
@@ -321,7 +321,7 @@ function Et({
|
|
|
321
321
|
{
|
|
322
322
|
viewBox: "0 0 60 18",
|
|
323
323
|
className: "inline-block h-[18px] w-[60px]",
|
|
324
|
-
"data-tip": l.map((i) =>
|
|
324
|
+
"data-tip": l.map((i) => he(i, r.format)).join(" · "),
|
|
325
325
|
children: /* @__PURE__ */ o(
|
|
326
326
|
"polyline",
|
|
327
327
|
{
|
|
@@ -338,7 +338,7 @@ function Et({
|
|
|
338
338
|
if (r.percent_of_total && r.field) {
|
|
339
339
|
const l = Number(T(e, r)), n = Oe.get(r.field) ?? 0, m = n > 0 && Number.isFinite(l) ? l / n * 100 : null;
|
|
340
340
|
return /* @__PURE__ */ p("span", { className: "inline-flex items-baseline gap-1", children: [
|
|
341
|
-
|
|
341
|
+
H(T(e, r), r.format),
|
|
342
342
|
m != null && /* @__PURE__ */ p("span", { className: "text-[9.5px] text-slate-400", children: [
|
|
343
343
|
m.toLocaleString("en-US", { maximumFractionDigits: 1 }),
|
|
344
344
|
"%"
|
|
@@ -348,24 +348,24 @@ function Et({
|
|
|
348
348
|
if (r.display === "progress") return tt(e, r);
|
|
349
349
|
if (r.stack)
|
|
350
350
|
return /* @__PURE__ */ p("span", { className: "inline-flex flex-col items-end leading-[15px]", style: ye(r), children: [
|
|
351
|
-
xe(r) && /* @__PURE__ */ o("span", { children: qe(
|
|
351
|
+
xe(r) && /* @__PURE__ */ o("span", { children: qe(H(T(e, r), Ne(e, r))) }),
|
|
352
352
|
Ee(r) && /* @__PURE__ */ o(
|
|
353
353
|
"span",
|
|
354
354
|
{
|
|
355
355
|
className: `text-[10.5px] ${r.stack_color ? "text-[color:var(--qts)] dark:text-[color:var(--qtsd)]" : "text-slate-400"}`,
|
|
356
|
-
children: qe(
|
|
356
|
+
children: qe(H(e[r.stack], Ne(e, r)))
|
|
357
357
|
}
|
|
358
358
|
)
|
|
359
359
|
] });
|
|
360
360
|
const a = T(e, r);
|
|
361
|
-
return r.empty_label !== void 0 && (a == null || a === "") ? r.empty_label ? /* @__PURE__ */ o("span", { className: "text-slate-500 dark:text-slate-400", children: r.empty_label }) : null : qe(
|
|
361
|
+
return r.empty_label !== void 0 && (a == null || a === "") ? r.empty_label ? /* @__PURE__ */ o("span", { className: "text-slate-500 dark:text-slate-400", children: r.empty_label }) : null : qe(H(a, Ne(e, r)));
|
|
362
362
|
}, Te = x.some((e) => e.group), ge = [];
|
|
363
363
|
{
|
|
364
364
|
let e = -1, r;
|
|
365
365
|
for (const a of x)
|
|
366
366
|
a.group && a.group !== r && e++, ge.push(a.group ? e : -1), r = a.group;
|
|
367
367
|
}
|
|
368
|
-
const we = (e) => Te && ge[e] >= 0 && ge[e] % 2 === 1 ? "bg-slate-50/70 dark:bg-muted/20" : "", _ = !!(t != null && t.sticky), te = "border-r border-slate-200 dark:border-border", at = (e, r) => _ && e === 0 ? `sticky left-0 z-[1] ${te} ${r}` : "", Ue = (e) => _ ? e === 0 ? `sticky left-0 top-0 z-[3] ${te} bg-slate-50 dark:bg-muted` : "sticky top-0 z-[2] bg-white dark:bg-card" : "", G = (e) => _ && (e === 0 || e === 1) ? "pl-3" : "",
|
|
368
|
+
const we = (e) => Te && ge[e] >= 0 && ge[e] % 2 === 1 ? "bg-slate-50/70 dark:bg-muted/20" : "", _ = !!(t != null && t.sticky), te = "border-r border-slate-200 dark:border-border", at = (e, r) => _ && e === 0 ? `sticky left-0 z-[1] ${te} ${r}` : "", Ue = (e) => _ ? e === 0 ? `sticky left-0 top-0 z-[3] ${te} bg-slate-50 dark:bg-muted` : "sticky top-0 z-[2] bg-white dark:bg-card" : "", G = (e) => _ && (e === 0 || e === 1) ? "pl-3" : "", ue = se.overflows ? "border-l border-slate-200 dark:border-border" : "", $e = (e) => _ ? `sticky right-0 z-[2] ${ue} ${e}` : "", re = (e, r, a = 0, d) => {
|
|
369
369
|
const l = a === !0 ? 1 : a === !1 ? 0 : a;
|
|
370
370
|
return /* @__PURE__ */ p(
|
|
371
371
|
"tr",
|
|
@@ -376,14 +376,14 @@ function Et({
|
|
|
376
376
|
x.map((n, m) => /* @__PURE__ */ o(
|
|
377
377
|
"td",
|
|
378
378
|
{
|
|
379
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${n.max_width ? "overflow-hidden text-ellipsis" : ""} ${G(m)} ${ke(n, "text-slate-700 dark:text-slate-200")} ${U(n) ? "text-right tabular-nums" : ""} ${n.group ? "min-w-[58px]" : ""} ${
|
|
379
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${n.max_width ? "overflow-hidden text-ellipsis" : ""} ${G(m)} ${ke(n, "text-slate-700 dark:text-slate-200")} ${U(n) ? "text-right tabular-nums" : ""} ${n.group ? "min-w-[58px]" : ""} ${ne(n) || we(m)} ${at(m, "bg-slate-50 group-hover/qtr:bg-slate-100 dark:bg-muted dark:group-hover/qtr:bg-muted")}`,
|
|
380
380
|
style: {
|
|
381
381
|
...l > 0 && m === 0 ? { paddingLeft: 2 + l * 16 } : {},
|
|
382
382
|
...n.max_width ? { maxWidth: n.max_width } : {},
|
|
383
383
|
...X(n, Number(T(e, n))) ?? {}
|
|
384
384
|
},
|
|
385
385
|
title: n.max_width ? String(T(e, n) ?? "") : void 0,
|
|
386
|
-
children: m === 0 && d !== void 0 ? d :
|
|
386
|
+
children: m === 0 && d !== void 0 ? d : ie(e, n)
|
|
387
387
|
},
|
|
388
388
|
n.field ?? n.label ?? m
|
|
389
389
|
)),
|
|
@@ -426,8 +426,8 @@ function Et({
|
|
|
426
426
|
const m = t.tree_collapsed ? !v.has(l) : v.has(l);
|
|
427
427
|
Q.push({ key: l, startsCollapsed: !!t.tree_collapsed });
|
|
428
428
|
const F = { [e]: l }, M = (i) => {
|
|
429
|
-
F[i] = n.reduce((N,
|
|
430
|
-
const P = Number(
|
|
429
|
+
F[i] = n.reduce((N, me) => {
|
|
430
|
+
const P = Number(me[i]);
|
|
431
431
|
return Number.isFinite(P) ? N + P : N;
|
|
432
432
|
}, 0);
|
|
433
433
|
};
|
|
@@ -448,12 +448,12 @@ function Et({
|
|
|
448
448
|
x.map((i, N) => /* @__PURE__ */ o(
|
|
449
449
|
"td",
|
|
450
450
|
{
|
|
451
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${G(N)} text-[11.5px] font-semibold ${ke(i, "text-slate-600 dark:text-slate-300")} ${U(i) ? "text-right tabular-nums" : ""} ${
|
|
451
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${G(N)} text-[11.5px] font-semibold ${ke(i, "text-slate-600 dark:text-slate-300")} ${U(i) ? "text-right tabular-nums" : ""} ${ne(i)} ${_ && N === 0 ? `sticky left-0 z-[1] ${te} bg-slate-100 dark:bg-muted` : ""}`,
|
|
452
452
|
style: X(
|
|
453
453
|
i,
|
|
454
454
|
Number(i.formula ? j(i.formula, F) : F[i.field ?? ""])
|
|
455
455
|
),
|
|
456
|
-
children: N === 0 ? `${m ? "▸" : "▾"} ${l}` : i.formula ?
|
|
456
|
+
children: N === 0 ? `${m ? "▸" : "▾"} ${l}` : i.formula ? H(j(i.formula, F), i.format) : i.field && i.field !== e && U(i) ? ie(F, i) : ""
|
|
457
457
|
},
|
|
458
458
|
i.field ?? i.label ?? N
|
|
459
459
|
)),
|
|
@@ -465,36 +465,36 @@ function Et({
|
|
|
465
465
|
const i = t.tree_sub_split;
|
|
466
466
|
if (!i)
|
|
467
467
|
return n.map((E, D) => {
|
|
468
|
-
var
|
|
468
|
+
var W;
|
|
469
469
|
let C;
|
|
470
|
-
if (t.tree_strip_section_prefix && ((
|
|
470
|
+
if (t.tree_strip_section_prefix && ((W = x[0]) != null && W.field)) {
|
|
471
471
|
const R = String(E[x[0].field] ?? "");
|
|
472
472
|
R.startsWith(`${l} - `) && (C = R.slice(l.length + 3));
|
|
473
473
|
}
|
|
474
474
|
return re(E, `${l}-${D}`, 1, C);
|
|
475
475
|
});
|
|
476
|
-
const N = i.separator ?? " - ",
|
|
476
|
+
const N = i.separator ?? " - ", me = [], P = /* @__PURE__ */ new Map();
|
|
477
477
|
for (const E of n) {
|
|
478
478
|
const D = String(E[i.field] ?? ""), C = D.lastIndexOf(N);
|
|
479
479
|
if (C <= 0) {
|
|
480
|
-
|
|
480
|
+
me.push(E);
|
|
481
481
|
continue;
|
|
482
482
|
}
|
|
483
|
-
const
|
|
484
|
-
R.push(E), P.set(
|
|
483
|
+
const W = D.slice(0, C), R = P.get(W) ?? [];
|
|
484
|
+
R.push(E), P.set(W, R);
|
|
485
485
|
}
|
|
486
486
|
return [
|
|
487
|
-
...
|
|
487
|
+
...me.map((E, D) => re(E, `${l}-flat-${D}`, 1)),
|
|
488
488
|
...[...P.entries()].sort(([E], [D]) => E.localeCompare(D)).map(([E, D]) => {
|
|
489
489
|
const C = `s:${l}|${E}`;
|
|
490
490
|
Q.push({
|
|
491
491
|
key: C,
|
|
492
492
|
startsCollapsed: t.tree_sub_collapsed ?? !0
|
|
493
493
|
});
|
|
494
|
-
const
|
|
495
|
-
R[f] = D.reduce((S,
|
|
496
|
-
const
|
|
497
|
-
return Number.isFinite(
|
|
494
|
+
const W = t.tree_sub_collapsed ?? !0 ? !v.has(C) : v.has(C), R = {}, Be = (f) => {
|
|
495
|
+
R[f] = D.reduce((S, ce) => {
|
|
496
|
+
const pe = Number(ce[f]);
|
|
497
|
+
return Number.isFinite(pe) ? S + pe : S;
|
|
498
498
|
}, 0);
|
|
499
499
|
};
|
|
500
500
|
for (const f of x)
|
|
@@ -516,7 +516,7 @@ function Et({
|
|
|
516
516
|
{
|
|
517
517
|
className: `whitespace-nowrap py-1.5 pr-3 ${G(S)} text-[11.5px] font-medium text-slate-600 dark:text-slate-300 ${U(f) ? "text-right tabular-nums" : ""} ${_ && S === 0 ? `sticky left-0 z-[1] ${te} bg-slate-100/80 dark:bg-muted` : ""}`,
|
|
518
518
|
style: S === 0 ? { paddingLeft: 18 } : void 0,
|
|
519
|
-
children: S === 0 ? `${
|
|
519
|
+
children: S === 0 ? `${W ? "▸" : "▾"} ${E}` : f.formula ? H(j(f.formula, R), f.format) : f.field && f.field !== e && U(f) ? ie(R, f) : ""
|
|
520
520
|
},
|
|
521
521
|
f.field ?? f.label ?? S
|
|
522
522
|
)),
|
|
@@ -524,9 +524,9 @@ function Et({
|
|
|
524
524
|
]
|
|
525
525
|
}
|
|
526
526
|
),
|
|
527
|
-
children: !
|
|
527
|
+
children: !W && D.map((f, S) => {
|
|
528
528
|
var Ge;
|
|
529
|
-
const
|
|
529
|
+
const ce = String(f[i.field] ?? ""), pe = ce.slice(ce.lastIndexOf(N) + N.length), nt = ((Ge = x[0]) == null ? void 0 : Ge.field) === i.field ? pe : void 0;
|
|
530
530
|
return re(f, `${C}-${S}`, 2, nt);
|
|
531
531
|
})
|
|
532
532
|
},
|
|
@@ -542,7 +542,7 @@ function Et({
|
|
|
542
542
|
_e = [...r.map((l, n) => re(l, `flat-${n}`)), ...d];
|
|
543
543
|
} else
|
|
544
544
|
_e = $.map((e, r) => re(e, String(r)));
|
|
545
|
-
const lt = (e) => e.startsCollapsed ? v.has(e.key) : !v.has(e.key),
|
|
545
|
+
const lt = (e) => e.startsCollapsed ? v.has(e.key) : !v.has(e.key), be = Q.length > 0 && Q.every(lt), st = (e) => L(
|
|
546
546
|
new Set(
|
|
547
547
|
Q.filter((r) => e ? r.startsCollapsed : !r.startsCollapsed).map((r) => r.key)
|
|
548
548
|
)
|
|
@@ -550,12 +550,12 @@ function Et({
|
|
|
550
550
|
"button",
|
|
551
551
|
{
|
|
552
552
|
type: "button",
|
|
553
|
-
"data-query-tree-toggle":
|
|
554
|
-
onClick: () => st(!
|
|
553
|
+
"data-query-tree-toggle": be ? "collapse" : "expand",
|
|
554
|
+
onClick: () => st(!be),
|
|
555
555
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-800 dark:border-border dark:text-slate-300 dark:hover:bg-muted dark:hover:text-slate-100",
|
|
556
556
|
children: [
|
|
557
|
-
|
|
558
|
-
|
|
557
|
+
be ? /* @__PURE__ */ o(mt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }) : /* @__PURE__ */ o(ct, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
558
|
+
be ? "Collapse all" : "Expand all"
|
|
559
559
|
]
|
|
560
560
|
}
|
|
561
561
|
) : null, ot = typeof (t == null ? void 0 : t.export_csv) == "object" && t.export_csv.filename ? t.export_csv.filename : "export.csv", Me = t != null && t.search || t != null && t.export_csv || Z.length > 0 ? /* @__PURE__ */ p("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -571,7 +571,7 @@ function Et({
|
|
|
571
571
|
"input",
|
|
572
572
|
{
|
|
573
573
|
type: "search",
|
|
574
|
-
value:
|
|
574
|
+
value: J,
|
|
575
575
|
onChange: (e) => w(e.target.value),
|
|
576
576
|
placeholder: "Search rows",
|
|
577
577
|
"aria-label": "Search rows",
|
|
@@ -591,7 +591,7 @@ function Et({
|
|
|
591
591
|
children: ((Ke = t == null ? void 0 : t.hide_empty) == null ? void 0 : Ke.label) ?? "Hide empty rows"
|
|
592
592
|
}
|
|
593
593
|
),
|
|
594
|
-
(
|
|
594
|
+
(de || z && Z.length > 0) && /* @__PURE__ */ p(
|
|
595
595
|
"span",
|
|
596
596
|
{
|
|
597
597
|
className: "text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
@@ -615,7 +615,7 @@ function Et({
|
|
|
615
615
|
x.filter((e) => xe(e) || !e.field),
|
|
616
616
|
$,
|
|
617
617
|
T,
|
|
618
|
-
(e) => e.label ??
|
|
618
|
+
(e) => e.label ?? ae(e.field ?? "")
|
|
619
619
|
)
|
|
620
620
|
),
|
|
621
621
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-800 dark:border-border dark:text-slate-300 dark:hover:bg-muted dark:hover:text-slate-100",
|
|
@@ -652,8 +652,8 @@ function Et({
|
|
|
652
652
|
"button",
|
|
653
653
|
{
|
|
654
654
|
type: "button",
|
|
655
|
-
onClick: () =>
|
|
656
|
-
className: `rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${
|
|
655
|
+
onClick: () => A(e),
|
|
656
|
+
className: `rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${le === e ? "bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,
|
|
657
657
|
children: e === "month" ? "Monthly" : "Quarterly"
|
|
658
658
|
},
|
|
659
659
|
e
|
|
@@ -681,7 +681,7 @@ function Et({
|
|
|
681
681
|
{
|
|
682
682
|
rowSpan: 2,
|
|
683
683
|
className: `whitespace-nowrap border-b border-slate-200 py-1.5 pr-3 align-bottom text-[10.5px] font-semibold uppercase tracking-wider text-slate-500 dark:border-border dark:text-slate-400 ${U(a) ? "text-right" : "text-left"} ${Ue(r)}`,
|
|
684
|
-
children: a.label ??
|
|
684
|
+
children: a.label ?? ae(a.field ?? "")
|
|
685
685
|
},
|
|
686
686
|
`u-${a.field ?? r}`
|
|
687
687
|
)
|
|
@@ -696,7 +696,7 @@ function Et({
|
|
|
696
696
|
"th",
|
|
697
697
|
{
|
|
698
698
|
colSpan: d,
|
|
699
|
-
className: `whitespace-nowrap border-b border-slate-100 py-1 pr-3 text-center text-[11px] font-semibold dark:border-border/60 ${a.group ===
|
|
699
|
+
className: `whitespace-nowrap border-b border-slate-100 py-1 pr-3 text-center text-[11px] font-semibold dark:border-border/60 ${a.group === oe ? "border-t-2 border-t-[#6366f1] bg-[#6366f10f] text-[#4f46e5] dark:border-t-[#a5b4fc] dark:bg-[#a5b4fc12] dark:text-[#a5b4fc]" : `text-slate-600 dark:text-slate-300 ${we(r)}`} ${_ ? "sticky top-0 z-[2] bg-white dark:bg-card" : ""}`.trim(),
|
|
700
700
|
children: a.group
|
|
701
701
|
},
|
|
702
702
|
`g-${a.group}-${r}`
|
|
@@ -711,7 +711,7 @@ function Et({
|
|
|
711
711
|
rowSpan: 2,
|
|
712
712
|
"aria-label": "Actions",
|
|
713
713
|
"data-qt-actions-head": "",
|
|
714
|
-
className: `border-b border-slate-200 dark:border-border ${_ ? `sticky right-0 top-0 z-[3] ${
|
|
714
|
+
className: `border-b border-slate-200 dark:border-border ${_ ? `sticky right-0 top-0 z-[3] ${ue} bg-white dark:bg-card` : ""}`
|
|
715
715
|
}
|
|
716
716
|
)
|
|
717
717
|
] }),
|
|
@@ -719,8 +719,8 @@ function Et({
|
|
|
719
719
|
(e, r) => e.group ? /* @__PURE__ */ o(
|
|
720
720
|
"th",
|
|
721
721
|
{
|
|
722
|
-
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${G(r)} text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400 ${U(e) ? "text-right" : "text-left"} ${
|
|
723
|
-
children: e.label ??
|
|
722
|
+
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${G(r)} text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400 ${U(e) ? "text-right" : "text-left"} ${ne(e) || we(r)} ${_ ? "sticky top-[26px] z-[2] bg-white dark:bg-card" : ""}`,
|
|
723
|
+
children: e.label ?? ae(e.field ?? "")
|
|
724
724
|
},
|
|
725
725
|
e.field ?? e.label ?? r
|
|
726
726
|
) : null
|
|
@@ -740,11 +740,11 @@ function Et({
|
|
|
740
740
|
onClick: () => rt(ee(e, r)),
|
|
741
741
|
className: `inline-flex items-center gap-0.5 font-semibold uppercase tracking-wider hover:text-slate-800 dark:hover:text-slate-100 ${U(e) ? "flex-row-reverse" : ""}`,
|
|
742
742
|
children: [
|
|
743
|
-
e.label ??
|
|
743
|
+
e.label ?? ae(e.field ?? ""),
|
|
744
744
|
(q == null ? void 0 : q.key) === ee(e, r) && (q.dir === 1 ? /* @__PURE__ */ o(ut, { className: "h-3 w-3", "aria-hidden": !0 }) : /* @__PURE__ */ o(bt, { className: "h-3 w-3", "aria-hidden": !0 }))
|
|
745
745
|
]
|
|
746
746
|
}
|
|
747
|
-
) : e.label ??
|
|
747
|
+
) : e.label ?? ae(e.field ?? ""),
|
|
748
748
|
e.stack && (t == null ? void 0 : t.stack_legend) && /* @__PURE__ */ p(
|
|
749
749
|
"span",
|
|
750
750
|
{
|
|
@@ -777,7 +777,7 @@ function Et({
|
|
|
777
777
|
{
|
|
778
778
|
"aria-label": "Actions",
|
|
779
779
|
"data-qt-actions-head": "",
|
|
780
|
-
className: _ ? `sticky right-0 top-0 z-[3] ${
|
|
780
|
+
className: _ ? `sticky right-0 top-0 z-[3] ${ue} bg-white dark:bg-card` : void 0
|
|
781
781
|
}
|
|
782
782
|
)
|
|
783
783
|
] }) }),
|
|
@@ -786,21 +786,21 @@ function Et({
|
|
|
786
786
|
x.map((e, r) => /* @__PURE__ */ o(
|
|
787
787
|
"td",
|
|
788
788
|
{
|
|
789
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${G(r)} ${ke(e, "")} ${U(e) ? "text-right tabular-nums" : ""} ${
|
|
789
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${G(r)} ${ke(e, "")} ${U(e) ? "text-right tabular-nums" : ""} ${ne(e)} ${_ ? `sticky bottom-0 border-t border-slate-300 dark:border-border ${r === 0 ? `left-0 z-[3] ${te} bg-slate-50 dark:bg-muted` : "z-[2] bg-white dark:bg-card"}` : ""}`,
|
|
790
790
|
style: X(
|
|
791
791
|
e,
|
|
792
792
|
Number(
|
|
793
793
|
e.formula ? j(e.formula, B) : B[e.field ?? ""]
|
|
794
794
|
)
|
|
795
795
|
),
|
|
796
|
-
children: r === 0 && !e.sum && !e.formula ? "Total" : e.sum || e.formula ? e.formula ?
|
|
796
|
+
children: r === 0 && !e.sum && !e.formula ? "Total" : e.sum || e.formula ? e.formula ? H(j(e.formula, B), e.format) : ie(B, e) : ""
|
|
797
797
|
},
|
|
798
798
|
e.field ?? e.label ?? r
|
|
799
799
|
)),
|
|
800
800
|
u && /* @__PURE__ */ o(
|
|
801
801
|
"td",
|
|
802
802
|
{
|
|
803
|
-
className: `py-1.5 pr-3 text-right ${_ ? `sticky bottom-0 right-0 z-[3] border-t border-slate-300 ${
|
|
803
|
+
className: `py-1.5 pr-3 text-right ${_ ? `sticky bottom-0 right-0 z-[3] border-t border-slate-300 ${ue} bg-white dark:border-border dark:bg-card` : ""}`,
|
|
804
804
|
children: /* @__PURE__ */ o("span", { className: "inline-flex flex-nowrap gap-1.5", children: u.map((e) => /* @__PURE__ */ o(
|
|
805
805
|
"button",
|
|
806
806
|
{
|
|
@@ -818,7 +818,7 @@ function Et({
|
|
|
818
818
|
] })
|
|
819
819
|
}
|
|
820
820
|
),
|
|
821
|
-
|
|
821
|
+
se.canScrollRight && // More columns to the right: fade the edge so readers know the
|
|
822
822
|
// table scrolls sideways (the native scrollbar is often invisible).
|
|
823
823
|
/* @__PURE__ */ o(
|
|
824
824
|
"div",
|
|
@@ -826,7 +826,7 @@ function Et({
|
|
|
826
826
|
"aria-hidden": !0,
|
|
827
827
|
"data-qt-scroll-cue": "",
|
|
828
828
|
className: "pointer-events-none absolute top-0 w-10 bg-gradient-to-r from-transparent to-white dark:to-card",
|
|
829
|
-
style: { right:
|
|
829
|
+
style: { right: se.cueInset.right, bottom: se.cueInset.bottom }
|
|
830
830
|
}
|
|
831
831
|
)
|
|
832
832
|
] })
|