@nivaro/react 0.3.19 → 0.3.21
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/shared/components/CollectionBrowserView.js +2668 -2613
- package/dist/shared/components/ItemEditForm.js +2366 -2318
- package/dist/shared/components/QueryTable.js +268 -239
- package/dist/shared/components/bulk/PushBulkButtons.js +17 -17
- package/dist/shared/components/bulk/RowPushActions.js +45 -35
- package/dist/shared/components/item-edit/HeaderBand.js +73 -63
- package/dist/shared/components/item-edit/HeaderOverflowChip.js +19 -17
- package/dist/shared/components/item-edit/RecordHeaderActions.js +140 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1006
- package/dist/shared/lib/header-strip.js +125 -107
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronsDownUp as Be, ChevronsUpDown as Qe } from "lucide-react";
|
|
3
|
+
import { useState as Y, useEffect as Ve, useMemo as Pe } from "react";
|
|
4
|
+
import { evaluateNumeric as Ye } from "../lib/expression.js";
|
|
5
|
+
function Xe(i) {
|
|
5
6
|
return `color-mix(in srgb, ${i} 55%, white)`;
|
|
6
7
|
}
|
|
7
|
-
const
|
|
8
|
+
const fe = {
|
|
8
9
|
// Brand ink for TEXT: the raw brand (cyan on white ≈ 1.6:1) is a fill
|
|
9
10
|
// colour, not a text colour — mix toward black in light mode, raw in dark.
|
|
10
11
|
accent: ["color-mix(in srgb, rgb(var(--nvr-cyan-rgb)) 56%, black)", "rgb(var(--nvr-cyan-rgb))"],
|
|
@@ -18,12 +19,12 @@ const pe = {
|
|
|
18
19
|
warning: ["var(--nvr-role-warning, #b45309)", "var(--nvr-role-warning-dark, #d4936a)"],
|
|
19
20
|
info: ["var(--nvr-role-info, #4f46e5)", "var(--nvr-role-info-dark, #8fa6c9)"]
|
|
20
21
|
};
|
|
21
|
-
function
|
|
22
|
+
function xe(i, r) {
|
|
22
23
|
var M, k;
|
|
23
|
-
const x =
|
|
24
|
-
return x ? [x[0], r ? ((M =
|
|
24
|
+
const x = fe[i.trim().toLowerCase()];
|
|
25
|
+
return x ? [x[0], r ? ((M = fe[r]) == null ? void 0 : M[1]) ?? r : x[1]] : [i, r ? ((k = fe[r]) == null ? void 0 : k[1]) ?? r : Xe(i)];
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
+
const Ze = /^[-+−]?\$?0(?:\.0+)?%?$/, ke = (i) => i === "—" ? /* @__PURE__ */ s("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Ze.test(i) ? /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: i }) : i, Te = [
|
|
27
28
|
"jan",
|
|
28
29
|
"feb",
|
|
29
30
|
"mar",
|
|
@@ -36,7 +37,7 @@ const Be = /^[-+−]?\$?0(?:\.0+)?%?$/, fe = (i) => i === "—" ? /* @__PURE__ *
|
|
|
36
37
|
"oct",
|
|
37
38
|
"nov",
|
|
38
39
|
"dec"
|
|
39
|
-
],
|
|
40
|
+
], je = [
|
|
40
41
|
"Jan",
|
|
41
42
|
"Feb",
|
|
42
43
|
"Mar",
|
|
@@ -50,8 +51,8 @@ const Be = /^[-+−]?\$?0(?:\.0+)?%?$/, fe = (i) => i === "—" ? /* @__PURE__ *
|
|
|
50
51
|
"Nov",
|
|
51
52
|
"Dec"
|
|
52
53
|
];
|
|
53
|
-
function
|
|
54
|
-
const k = /* @__PURE__ */ new Map(),
|
|
54
|
+
function et(i, r, x, M = "month") {
|
|
55
|
+
const k = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Set();
|
|
55
56
|
for (const m of i) {
|
|
56
57
|
const W = r.key_fields.map((_) => String(m[_] ?? "")).join("|");
|
|
57
58
|
let u = k.get(W);
|
|
@@ -60,36 +61,36 @@ function Ve(i, r, x, M = "month") {
|
|
|
60
61
|
for (const _ of r.key_fields) u[_] = m[_];
|
|
61
62
|
k.set(W, u);
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
+
const de = String(m[r.date_field] ?? ""), w = /^(\d{4})-(\d{2})/.exec(de);
|
|
64
65
|
if (!w) continue;
|
|
65
|
-
const
|
|
66
|
+
const A = Number(m[r.value_field]) || 0;
|
|
66
67
|
if (Number(w[1]) === x) {
|
|
67
|
-
const _ = Number(w[2]) - 1,
|
|
68
|
-
|
|
68
|
+
const _ = Number(w[2]) - 1, C = M === "quarter" ? `q${Math.floor(_ / 3) + 1}` : Te[_];
|
|
69
|
+
C && (u[C] = (Number(u[C]) || 0) + A);
|
|
69
70
|
} else
|
|
70
|
-
|
|
71
|
-
r.total !== !1 && (u.total = (Number(u.total) || 0) +
|
|
71
|
+
R.add(w[1]), u[`y${w[1]}`] = (Number(u[`y${w[1]}`]) || 0) + A;
|
|
72
|
+
r.total !== !1 && (u.total = (Number(u.total) || 0) + A);
|
|
72
73
|
}
|
|
73
|
-
const
|
|
74
|
+
const oe = [...R].filter((m) => Number(m) < x).sort(), E = [...R].filter((m) => Number(m) > x).sort(), G = M === "quarter" ? [1, 2, 3, 4].map((m) => ({
|
|
74
75
|
field: `q${m}`,
|
|
75
76
|
label: `Q${m}`,
|
|
76
77
|
format: "currency",
|
|
77
78
|
sum: !0
|
|
78
|
-
})) :
|
|
79
|
+
})) : Te.map((m, W) => ({
|
|
79
80
|
field: m,
|
|
80
|
-
label:
|
|
81
|
+
label: je[W],
|
|
81
82
|
format: "currency",
|
|
82
83
|
sum: !0
|
|
83
|
-
})), L = r.color ? { color: r.color, color_negative: r.color_negative } : {},
|
|
84
|
-
...
|
|
84
|
+
})), L = r.color ? { color: r.color, color_negative: r.color_negative } : {}, ne = [
|
|
85
|
+
...oe.map((m) => ({
|
|
85
86
|
field: `y${m}`,
|
|
86
87
|
label: m,
|
|
87
88
|
format: "currency",
|
|
88
89
|
sum: !0,
|
|
89
90
|
...L
|
|
90
91
|
})),
|
|
91
|
-
...
|
|
92
|
-
...
|
|
92
|
+
...G.map((m) => ({ ...m, ...L })),
|
|
93
|
+
...E.map((m) => ({
|
|
93
94
|
field: `y${m}`,
|
|
94
95
|
label: m,
|
|
95
96
|
format: "currency",
|
|
@@ -106,12 +107,12 @@ function Ve(i, r, x, M = "month") {
|
|
|
106
107
|
}
|
|
107
108
|
] : []
|
|
108
109
|
];
|
|
109
|
-
return { rows: [...k.values()], columns:
|
|
110
|
+
return { rows: [...k.values()], columns: ne };
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
112
|
+
function I(i, r) {
|
|
113
|
+
return Ye(i, r);
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function se(i, r) {
|
|
115
116
|
if (i == null || i === "") return "—";
|
|
116
117
|
const x = Number(i);
|
|
117
118
|
if (!Number.isFinite(x)) return String(i);
|
|
@@ -133,32 +134,32 @@ function ae(i, r) {
|
|
|
133
134
|
return String(i);
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function ge(i) {
|
|
137
138
|
return i.replace(/_/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function st({
|
|
140
141
|
rows: i,
|
|
141
142
|
config: r,
|
|
142
143
|
onRowClick: x,
|
|
143
144
|
pivotYear: M,
|
|
144
145
|
rowActions: k,
|
|
145
|
-
emptyLabel:
|
|
146
|
-
emptyText:
|
|
146
|
+
emptyLabel: R,
|
|
147
|
+
emptyText: oe
|
|
147
148
|
}) {
|
|
148
|
-
var
|
|
149
|
-
const [
|
|
149
|
+
var Ce, qe, Fe, Me, Oe, Ee, ze;
|
|
150
|
+
const [E, G] = Y(() => /* @__PURE__ */ new Set()), [L, ne] = Y("month"), [m, W] = Y(
|
|
150
151
|
() => new Set(((r == null ? void 0 : r.toggles) ?? []).filter((e) => e.default_on === !1).map((e) => e.label))
|
|
151
|
-
), [u,
|
|
152
|
+
), [u, de] = Y(null), [w, A] = Y({
|
|
152
153
|
overflows: !1,
|
|
153
154
|
canScrollRight: !1,
|
|
154
155
|
cueInset: { right: 0, bottom: 0 }
|
|
155
156
|
});
|
|
156
|
-
if (
|
|
157
|
+
if (Ve(() => {
|
|
157
158
|
if (!u) return;
|
|
158
159
|
const e = () => {
|
|
159
|
-
const a = u.scrollWidth > u.clientWidth + 1, n = u.scrollWidth > u.clientWidth + u.scrollLeft + 1, l = u.querySelector("[data-qt-actions-head]"),
|
|
160
|
-
|
|
161
|
-
(F) => F.overflows === a && F.canScrollRight === n && F.cueInset.right === b && F.cueInset.bottom ===
|
|
160
|
+
const a = u.scrollWidth > u.clientWidth + 1, n = u.scrollWidth > u.clientWidth + u.scrollLeft + 1, l = u.querySelector("[data-qt-actions-head]"), o = r != null && r.sticky && l ? l.offsetWidth : 0, b = u.offsetWidth - u.clientWidth + o, N = u.offsetHeight - u.clientHeight;
|
|
161
|
+
A(
|
|
162
|
+
(F) => F.overflows === a && F.canScrollRight === n && F.cueInset.right === b && F.cueInset.bottom === N ? F : { overflows: a, canScrollRight: n, cueInset: { right: b, bottom: N } }
|
|
162
163
|
);
|
|
163
164
|
};
|
|
164
165
|
e();
|
|
@@ -167,13 +168,13 @@ function Xe({
|
|
|
167
168
|
t.disconnect(), u.removeEventListener("scroll", e);
|
|
168
169
|
};
|
|
169
170
|
}, [u, r == null ? void 0 : r.sticky]), !i || i.length === 0)
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ s("p", { className: "px-1 py-2 text-[12px] italic text-slate-400", children: oe || (R ? `No ${R.toLowerCase()} yet` : "No data") });
|
|
171
172
|
let _ = null;
|
|
172
173
|
if (r != null && r.pivot) {
|
|
173
|
-
const e = M ?? r.pivot.year ?? (/* @__PURE__ */ new Date()).getFullYear(), t =
|
|
174
|
+
const e = M ?? r.pivot.year ?? (/* @__PURE__ */ new Date()).getFullYear(), t = et(i, r.pivot, e, L);
|
|
174
175
|
i = t.rows, _ = t.columns;
|
|
175
176
|
}
|
|
176
|
-
let
|
|
177
|
+
let C = i;
|
|
177
178
|
if (r != null && r.group_by) {
|
|
178
179
|
const e = r.group_by, t = /* @__PURE__ */ new Map();
|
|
179
180
|
for (const a of i) {
|
|
@@ -182,36 +183,36 @@ function Xe({
|
|
|
182
183
|
t.set(n, { ...a, [e]: n });
|
|
183
184
|
continue;
|
|
184
185
|
}
|
|
185
|
-
for (const [
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
Number.isFinite(
|
|
186
|
+
for (const [o, b] of Object.entries(a)) {
|
|
187
|
+
if (o === e) continue;
|
|
188
|
+
const N = Number(b);
|
|
189
|
+
Number.isFinite(N) && typeof b != "boolean" && (l[o] = (Number(l[o]) || 0) + N);
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
|
|
192
|
+
C = [...t.entries()].sort(([a], [n]) => a.localeCompare(n)).map(([, a]) => a);
|
|
192
193
|
}
|
|
193
|
-
const
|
|
194
|
+
const ye = _ ? [
|
|
194
195
|
// Key columns first (configured, else the pivot's key fields), then
|
|
195
196
|
// the generated year/month/total columns.
|
|
196
|
-
...(
|
|
197
|
+
...(Ce = r == null ? void 0 : r.columns) != null && Ce.length ? r.columns : (((qe = r == null ? void 0 : r.pivot) == null ? void 0 : qe.key_fields) ?? []).map((e) => ({ field: e })),
|
|
197
198
|
..._
|
|
198
|
-
] : r != null && r.columns && r.columns.length > 0 ? r.columns : Object.keys(
|
|
199
|
+
] : r != null && r.columns && r.columns.length > 0 ? r.columns : Object.keys(C[0]).map((e) => ({ field: e })), B = /* @__PURE__ */ new Set();
|
|
199
200
|
{
|
|
200
201
|
const e = [];
|
|
201
|
-
for (const t of
|
|
202
|
+
for (const t of ye)
|
|
202
203
|
t.field && e.push(t.field), t.stack && e.push(t.stack);
|
|
203
204
|
for (const t of (r == null ? void 0 : r.toggles) ?? []) {
|
|
204
205
|
const a = !m.has(t.label);
|
|
205
206
|
if (t.hide_when_on ? a : !a)
|
|
206
207
|
for (const l of e)
|
|
207
|
-
((
|
|
208
|
+
((Fe = t.fields) != null && Fe.includes(l) || t.suffix && l.endsWith(t.suffix)) && B.add(l);
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
const
|
|
211
|
+
const h = ye.filter((e) => {
|
|
211
212
|
if (!e.field) return !0;
|
|
212
|
-
const t =
|
|
213
|
+
const t = B.has(e.field), a = e.stack ? B.has(e.stack) : !0;
|
|
213
214
|
return !(t && a);
|
|
214
|
-
}),
|
|
215
|
+
}), ve = (e) => !!e.field && !B.has(e.field), Ne = (e) => !!e.stack && !B.has(e.stack), We = [
|
|
215
216
|
"Jan",
|
|
216
217
|
"Feb",
|
|
217
218
|
"Mar",
|
|
@@ -224,15 +225,15 @@ function Xe({
|
|
|
224
225
|
"Oct",
|
|
225
226
|
"Nov",
|
|
226
227
|
"Dec"
|
|
227
|
-
],
|
|
228
|
+
], X = (r == null ? void 0 : r.highlight_group) === "$current_month" ? We[(/* @__PURE__ */ new Date()).getMonth()] : (r == null ? void 0 : r.highlight_group) ?? null, $e = (e) => !!X && (e.group === X || !e.group && e.label === X), Z = (e) => $e(e) ? "bg-[#6366f10f] dark:bg-[#a5b4fc12]" : "", Q = (e, t) => {
|
|
228
229
|
if (!e.color) return;
|
|
229
|
-
const a = e.color_negative && typeof t == "number" && t < 0, [n, l] = a ?
|
|
230
|
+
const a = e.color_negative && typeof t == "number" && t < 0, [n, l] = a ? xe(e.color_negative) : xe(e.color, e.color_dark);
|
|
230
231
|
return { "--qtc": n, "--qtcd": l };
|
|
231
|
-
},
|
|
232
|
+
}, ie = (e, t) => e.color ? "text-[color:var(--qtc)] dark:text-[color:var(--qtcd)]" : t, ue = (e) => {
|
|
232
233
|
if (!e.stack_color) return;
|
|
233
|
-
const [t, a] =
|
|
234
|
+
const [t, a] = xe(e.stack_color, e.stack_color_dark);
|
|
234
235
|
return { "--qts": t, "--qtsd": a };
|
|
235
|
-
},
|
|
236
|
+
}, z = (e, t) => t.formula ? I(t.formula, e) : t.field ? e[t.field] : null, He = Pe(() => {
|
|
236
237
|
const e = /* @__PURE__ */ new Map();
|
|
237
238
|
for (const t of (r == null ? void 0 : r.columns) ?? [])
|
|
238
239
|
!t.percent_of_total || !t.field || e.set(
|
|
@@ -240,23 +241,23 @@ function Xe({
|
|
|
240
241
|
i.reduce((a, n) => a + (Number(n[t.field]) || 0), 0)
|
|
241
242
|
);
|
|
242
243
|
return e;
|
|
243
|
-
}, [i, r]),
|
|
244
|
-
const a = Number(
|
|
245
|
-
return /* @__PURE__ */
|
|
244
|
+
}, [i, r]), Ue = (e, t) => {
|
|
245
|
+
const a = Number(z(e, t)), n = t.progress_max ? t.progress_max.includes("{{") ? I(t.progress_max, e) : Number(e[t.progress_max]) : null, l = n && Number.isFinite(n) && n > 0 && Number.isFinite(a) ? a / n * 100 : null;
|
|
246
|
+
return /* @__PURE__ */ p(
|
|
246
247
|
"div",
|
|
247
248
|
{
|
|
248
249
|
className: "flex min-w-[130px] items-center justify-end gap-1.5",
|
|
249
|
-
title: l === null ? void 0 : `${l.toLocaleString("en-US", { maximumFractionDigits: 1 })}% of ${
|
|
250
|
+
title: l === null ? void 0 : `${l.toLocaleString("en-US", { maximumFractionDigits: 1 })}% of ${se(n, t.format)}`,
|
|
250
251
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ s("span", { children: se(z(e, t), t.format) }),
|
|
253
|
+
/* @__PURE__ */ s("div", { className: "h-1 w-10 shrink-0 overflow-hidden rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ s(
|
|
253
254
|
"div",
|
|
254
255
|
{
|
|
255
256
|
className: `h-full rounded-full ${l !== null && l > 100 ? "bg-red-500" : "bg-nvr-cyan"}`,
|
|
256
257
|
style: { width: `${l === null ? 0 : Math.min(l, 100)}%` }
|
|
257
258
|
}
|
|
258
259
|
) }),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ s("span", { className: "w-9 shrink-0 text-right text-[10px] tabular-nums text-slate-400", children: l === null ? "—" : `${l.toLocaleString("en-US", { maximumFractionDigits: 0 })}%` })
|
|
260
261
|
]
|
|
261
262
|
}
|
|
262
263
|
);
|
|
@@ -264,32 +265,32 @@ function Xe({
|
|
|
264
265
|
let H = null;
|
|
265
266
|
if (r != null && r.totals) {
|
|
266
267
|
const e = {}, t = (a) => {
|
|
267
|
-
e[a] =
|
|
268
|
-
const
|
|
269
|
-
return Number.isFinite(
|
|
268
|
+
e[a] = C.reduce((n, l) => {
|
|
269
|
+
const o = Number(l[a]);
|
|
270
|
+
return Number.isFinite(o) ? n + o : n;
|
|
270
271
|
}, 0);
|
|
271
272
|
};
|
|
272
|
-
for (const a of
|
|
273
|
+
for (const a of h)
|
|
273
274
|
a.field && t(a.field), a.stack && t(a.stack);
|
|
274
275
|
H = e;
|
|
275
276
|
}
|
|
276
|
-
const
|
|
277
|
-
if (!(r != null && r.row_format_field) || !
|
|
277
|
+
const q = (e) => e.format && e.format !== "text", be = (e, t) => {
|
|
278
|
+
if (!(r != null && r.row_format_field) || !q(t)) return t.format;
|
|
278
279
|
const a = e[r.row_format_field];
|
|
279
280
|
return a === "currency" || a === "number" ? a : t.format;
|
|
280
|
-
}, T = (e, t) => r != null && r.zero_dash && Number(e) === 0 ? "—" :
|
|
281
|
+
}, T = (e, t) => r != null && r.zero_dash && Number(e) === 0 ? "—" : se(e, t), j = (e, t) => {
|
|
281
282
|
var n;
|
|
282
283
|
if ((n = t.sparkline_fields) != null && n.length) {
|
|
283
|
-
const l = t.sparkline_fields.map((d) => Number(e[d]) || 0),
|
|
284
|
-
(d,
|
|
284
|
+
const l = t.sparkline_fields.map((d) => Number(e[d]) || 0), o = Math.max(...l, 1), b = Math.min(...l, 0), N = Math.max(o - b, 1), F = l.map(
|
|
285
|
+
(d, f) => `${f / Math.max(l.length - 1, 1) * 60},${17 - (d - b) / N * 15}`
|
|
285
286
|
).join(" ");
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ s(
|
|
287
288
|
"svg",
|
|
288
289
|
{
|
|
289
290
|
viewBox: "0 0 60 18",
|
|
290
291
|
className: "inline-block h-[18px] w-[60px]",
|
|
291
|
-
"data-tip": l.map((d) =>
|
|
292
|
-
children: /* @__PURE__ */
|
|
292
|
+
"data-tip": l.map((d) => se(d, t.format)).join(" · "),
|
|
293
|
+
children: /* @__PURE__ */ s(
|
|
293
294
|
"polyline",
|
|
294
295
|
{
|
|
295
296
|
points: F,
|
|
@@ -303,74 +304,74 @@ function Xe({
|
|
|
303
304
|
);
|
|
304
305
|
}
|
|
305
306
|
if (t.percent_of_total && t.field) {
|
|
306
|
-
const l = Number(
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
-
T(
|
|
309
|
-
b != null && /* @__PURE__ */
|
|
307
|
+
const l = Number(z(e, t)), o = He.get(t.field) ?? 0, b = o > 0 && Number.isFinite(l) ? l / o * 100 : null;
|
|
308
|
+
return /* @__PURE__ */ p("span", { className: "inline-flex items-baseline gap-1", children: [
|
|
309
|
+
T(z(e, t), t.format),
|
|
310
|
+
b != null && /* @__PURE__ */ p("span", { className: "text-[9.5px] text-slate-400", children: [
|
|
310
311
|
b.toLocaleString("en-US", { maximumFractionDigits: 1 }),
|
|
311
312
|
"%"
|
|
312
313
|
] })
|
|
313
314
|
] });
|
|
314
315
|
}
|
|
315
|
-
if (t.display === "progress") return
|
|
316
|
+
if (t.display === "progress") return Ue(e, t);
|
|
316
317
|
if (t.stack)
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
return /* @__PURE__ */ p("span", { className: "inline-flex flex-col items-end leading-[15px]", style: ue(t), children: [
|
|
319
|
+
ve(t) && /* @__PURE__ */ s("span", { children: ke(T(z(e, t), be(e, t))) }),
|
|
320
|
+
Ne(t) && /* @__PURE__ */ s(
|
|
320
321
|
"span",
|
|
321
322
|
{
|
|
322
323
|
className: `text-[10.5px] ${t.stack_color ? "text-[color:var(--qts)] dark:text-[color:var(--qtsd)]" : "text-slate-400"}`,
|
|
323
|
-
children:
|
|
324
|
+
children: ke(T(e[t.stack], be(e, t)))
|
|
324
325
|
}
|
|
325
326
|
)
|
|
326
327
|
] });
|
|
327
|
-
const a =
|
|
328
|
-
return t.empty_label !== void 0 && (a == null || a === "") ? t.empty_label ? /* @__PURE__ */
|
|
329
|
-
},
|
|
328
|
+
const a = z(e, t);
|
|
329
|
+
return t.empty_label !== void 0 && (a == null || a === "") ? t.empty_label ? /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: t.empty_label }) : null : ke(T(a, be(e, t)));
|
|
330
|
+
}, we = h.some((e) => e.group), me = [];
|
|
330
331
|
{
|
|
331
332
|
let e = -1, t;
|
|
332
|
-
for (const a of
|
|
333
|
-
a.group && a.group !== t && e++,
|
|
333
|
+
for (const a of h)
|
|
334
|
+
a.group && a.group !== t && e++, me.push(a.group ? e : -1), t = a.group;
|
|
334
335
|
}
|
|
335
|
-
const
|
|
336
|
+
const ce = (e) => we && me[e] >= 0 && me[e] % 2 === 1 ? "bg-slate-50/70 dark:bg-muted/20" : "", g = !!(r != null && r.sticky), V = "border-r border-slate-200 dark:border-border", Je = (e, t) => g && e === 0 ? `sticky left-0 z-[1] ${V} ${t}` : "", _e = (e) => g ? e === 0 ? `sticky left-0 top-0 z-[3] ${V} bg-slate-50 dark:bg-muted` : "sticky top-0 z-[2] bg-white dark:bg-card" : "", U = (e) => g && (e === 0 || e === 1) ? "pl-3" : "", ee = w.overflows ? "border-l border-slate-200 dark:border-border" : "", pe = (e) => g ? `sticky right-0 z-[2] ${ee} ${e}` : "", P = (e, t, a = 0, n) => {
|
|
336
337
|
const l = a === !0 ? 1 : a === !1 ? 0 : a;
|
|
337
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ p(
|
|
338
339
|
"tr",
|
|
339
340
|
{
|
|
340
341
|
onClick: x ? () => x(e) : void 0,
|
|
341
342
|
className: `group/qtr border-b border-slate-100 dark:border-border/50 ${x ? "cursor-pointer" : ""} ${l >= 2 ? "bg-sky-50/70 hover:bg-sky-100/60 dark:bg-sky-500/10 dark:hover:bg-sky-500/15" : "hover:bg-slate-50 dark:hover:bg-muted/40"}`,
|
|
342
343
|
children: [
|
|
343
|
-
|
|
344
|
+
h.map((o, b) => /* @__PURE__ */ s(
|
|
344
345
|
"td",
|
|
345
346
|
{
|
|
346
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${
|
|
347
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${o.max_width ? "overflow-hidden text-ellipsis" : ""} ${U(b)} ${ie(o, "text-slate-700 dark:text-slate-200")} ${q(o) ? "text-right tabular-nums" : ""} ${o.group ? "min-w-[58px]" : ""} ${Z(o) || ce(b)} ${Je(b, "bg-slate-50 group-hover/qtr:bg-slate-100 dark:bg-muted dark:group-hover/qtr:bg-muted")}`,
|
|
347
348
|
style: {
|
|
348
349
|
...l > 0 && b === 0 ? { paddingLeft: 2 + l * 16 } : {},
|
|
349
|
-
...
|
|
350
|
-
...
|
|
350
|
+
...o.max_width ? { maxWidth: o.max_width } : {},
|
|
351
|
+
...Q(o, Number(z(e, o))) ?? {}
|
|
351
352
|
},
|
|
352
|
-
title:
|
|
353
|
-
children: b === 0 && n !== void 0 ? n :
|
|
353
|
+
title: o.max_width ? String(z(e, o) ?? "") : void 0,
|
|
354
|
+
children: b === 0 && n !== void 0 ? n : j(e, o)
|
|
354
355
|
},
|
|
355
|
-
|
|
356
|
+
o.field ?? o.label ?? b
|
|
356
357
|
)),
|
|
357
|
-
k && /* @__PURE__ */
|
|
358
|
+
k && /* @__PURE__ */ s(
|
|
358
359
|
"td",
|
|
359
360
|
{
|
|
360
|
-
className: `py-1 pl-2 pr-3 text-right ${
|
|
361
|
+
className: `py-1 pl-2 pr-3 text-right ${pe(
|
|
361
362
|
l >= 2 ? "bg-[#f3f9fe] group-hover/qtr:bg-[#e7f3fd] dark:bg-card dark:group-hover/qtr:bg-muted" : "bg-white group-hover/qtr:bg-slate-50 dark:bg-card dark:group-hover/qtr:bg-muted"
|
|
362
363
|
)}`,
|
|
363
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1", children: k.map((o) => /* @__PURE__ */ s(
|
|
364
365
|
"button",
|
|
365
366
|
{
|
|
366
367
|
type: "button",
|
|
367
368
|
onClick: (b) => {
|
|
368
|
-
b.stopPropagation(),
|
|
369
|
+
b.stopPropagation(), o.onClick(e);
|
|
369
370
|
},
|
|
370
371
|
className: "whitespace-nowrap rounded border border-nvr-cyan/40 bg-nvr-cyan/10 px-1.5 py-0.5 text-[11px] text-slate-700 hover:brightness-105 dark:text-slate-200",
|
|
371
|
-
children:
|
|
372
|
+
children: o.label
|
|
372
373
|
},
|
|
373
|
-
|
|
374
|
+
o.label
|
|
374
375
|
)) })
|
|
375
376
|
}
|
|
376
377
|
)
|
|
@@ -379,117 +380,125 @@ function Xe({
|
|
|
379
380
|
t
|
|
380
381
|
);
|
|
381
382
|
};
|
|
382
|
-
let
|
|
383
|
+
let he;
|
|
384
|
+
const J = [];
|
|
383
385
|
if (r != null && r.tree_group_by) {
|
|
384
|
-
const e = r.tree_group_by, t =
|
|
385
|
-
for (const l of
|
|
386
|
-
const
|
|
387
|
-
if (!
|
|
388
|
-
const b = a.get(
|
|
389
|
-
b.push(l), a.set(
|
|
386
|
+
const e = r.tree_group_by, t = C.filter((l) => !String(l[e] ?? "").trim()), a = /* @__PURE__ */ new Map();
|
|
387
|
+
for (const l of C) {
|
|
388
|
+
const o = String(l[e] ?? "").trim();
|
|
389
|
+
if (!o) continue;
|
|
390
|
+
const b = a.get(o) ?? [];
|
|
391
|
+
b.push(l), a.set(o, b);
|
|
390
392
|
}
|
|
391
|
-
const n = [...a.entries()].sort(([l], [
|
|
392
|
-
const b = r.tree_collapsed ? !
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
const n = [...a.entries()].sort(([l], [o]) => l.localeCompare(o)).map(([l, o]) => {
|
|
394
|
+
const b = r.tree_collapsed ? !E.has(l) : E.has(l);
|
|
395
|
+
J.push({ key: l, startsCollapsed: !!r.tree_collapsed });
|
|
396
|
+
const N = { [e]: l }, F = (d) => {
|
|
397
|
+
N[d] = o.reduce((f, re) => {
|
|
398
|
+
const K = Number(re[d]);
|
|
399
|
+
return Number.isFinite(K) ? f + K : f;
|
|
396
400
|
}, 0);
|
|
397
401
|
};
|
|
398
|
-
for (const d of
|
|
402
|
+
for (const d of h)
|
|
399
403
|
d.field && d.field !== e && F(d.field), d.stack && F(d.stack);
|
|
400
|
-
return /* @__PURE__ */
|
|
401
|
-
|
|
404
|
+
return /* @__PURE__ */ s(
|
|
405
|
+
Ie,
|
|
402
406
|
{
|
|
403
|
-
header: /* @__PURE__ */
|
|
407
|
+
header: /* @__PURE__ */ p(
|
|
404
408
|
"tr",
|
|
405
409
|
{
|
|
406
410
|
className: "cursor-pointer border-b border-slate-200 bg-slate-100/80 dark:border-border dark:bg-muted",
|
|
407
|
-
onClick: () =>
|
|
408
|
-
const
|
|
409
|
-
return
|
|
411
|
+
onClick: () => G((d) => {
|
|
412
|
+
const f = new Set(d);
|
|
413
|
+
return f.has(l) ? f.delete(l) : f.add(l), f;
|
|
410
414
|
}),
|
|
411
415
|
children: [
|
|
412
|
-
|
|
416
|
+
h.map((d, f) => /* @__PURE__ */ s(
|
|
413
417
|
"td",
|
|
414
418
|
{
|
|
415
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${U(
|
|
416
|
-
style:
|
|
419
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${U(f)} text-[11.5px] font-semibold ${ie(d, "text-slate-600 dark:text-slate-300")} ${q(d) ? "text-right tabular-nums" : ""} ${Z(d)} ${g && f === 0 ? `sticky left-0 z-[1] ${V} bg-slate-100 dark:bg-muted` : ""}`,
|
|
420
|
+
style: Q(
|
|
417
421
|
d,
|
|
418
|
-
Number(d.formula ?
|
|
422
|
+
Number(d.formula ? I(d.formula, N) : N[d.field ?? ""])
|
|
419
423
|
),
|
|
420
|
-
children:
|
|
424
|
+
children: f === 0 ? `${b ? "▸" : "▾"} ${l}` : d.formula ? T(I(d.formula, N), d.format) : d.field && d.field !== e && q(d) ? j(N, d) : ""
|
|
421
425
|
},
|
|
422
|
-
d.field ?? d.label ??
|
|
426
|
+
d.field ?? d.label ?? f
|
|
423
427
|
)),
|
|
424
|
-
k && /* @__PURE__ */
|
|
428
|
+
k && /* @__PURE__ */ s("td", { className: pe("bg-slate-100 dark:bg-muted") })
|
|
425
429
|
]
|
|
426
430
|
}
|
|
427
431
|
),
|
|
428
432
|
children: !b && (() => {
|
|
429
433
|
const d = r.tree_sub_split;
|
|
430
434
|
if (!d)
|
|
431
|
-
return
|
|
432
|
-
var
|
|
433
|
-
let
|
|
434
|
-
if (r.tree_strip_section_prefix && ((
|
|
435
|
-
const O = String(
|
|
436
|
-
O.startsWith(`${l} - `) && (
|
|
435
|
+
return o.map(($, S) => {
|
|
436
|
+
var D;
|
|
437
|
+
let v;
|
|
438
|
+
if (r.tree_strip_section_prefix && ((D = h[0]) != null && D.field)) {
|
|
439
|
+
const O = String($[h[0].field] ?? "");
|
|
440
|
+
O.startsWith(`${l} - `) && (v = O.slice(l.length + 3));
|
|
437
441
|
}
|
|
438
|
-
return
|
|
442
|
+
return P($, `${l}-${S}`, 1, v);
|
|
439
443
|
});
|
|
440
|
-
const
|
|
441
|
-
for (const
|
|
442
|
-
const S = String(
|
|
443
|
-
if (
|
|
444
|
-
|
|
444
|
+
const f = d.separator ?? " - ", re = [], K = /* @__PURE__ */ new Map();
|
|
445
|
+
for (const $ of o) {
|
|
446
|
+
const S = String($[d.field] ?? ""), v = S.lastIndexOf(f);
|
|
447
|
+
if (v <= 0) {
|
|
448
|
+
re.push($);
|
|
445
449
|
continue;
|
|
446
450
|
}
|
|
447
|
-
const
|
|
448
|
-
O.push(
|
|
451
|
+
const D = S.slice(0, v), O = K.get(D) ?? [];
|
|
452
|
+
O.push($), K.set(D, O);
|
|
449
453
|
}
|
|
450
454
|
return [
|
|
451
|
-
...
|
|
452
|
-
...[...
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
...re.map(($, S) => P($, `${l}-flat-${S}`, 1)),
|
|
456
|
+
...[...K.entries()].sort(([$], [S]) => $.localeCompare(S)).map(([$, S]) => {
|
|
457
|
+
const v = `s:${l}|${$}`;
|
|
458
|
+
J.push({
|
|
459
|
+
key: v,
|
|
460
|
+
startsCollapsed: r.tree_sub_collapsed ?? !0
|
|
461
|
+
});
|
|
462
|
+
const D = r.tree_sub_collapsed ?? !0 ? !E.has(v) : E.has(v), O = {}, De = (c) => {
|
|
463
|
+
O[c] = S.reduce((y, ae) => {
|
|
464
|
+
const le = Number(ae[c]);
|
|
465
|
+
return Number.isFinite(le) ? y + le : y;
|
|
457
466
|
}, 0);
|
|
458
467
|
};
|
|
459
|
-
for (const c of
|
|
460
|
-
c.field && c.field !== e &&
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
|
|
468
|
+
for (const c of h)
|
|
469
|
+
c.field && c.field !== e && De(c.field), c.stack && De(c.stack);
|
|
470
|
+
return /* @__PURE__ */ s(
|
|
471
|
+
Ie,
|
|
463
472
|
{
|
|
464
|
-
header: /* @__PURE__ */
|
|
473
|
+
header: /* @__PURE__ */ p(
|
|
465
474
|
"tr",
|
|
466
475
|
{
|
|
467
476
|
className: "cursor-pointer border-b border-slate-200/80 bg-slate-100/70 dark:border-border/60 dark:bg-muted/50",
|
|
468
|
-
onClick: () =>
|
|
469
|
-
const
|
|
470
|
-
return
|
|
477
|
+
onClick: () => G((c) => {
|
|
478
|
+
const y = new Set(c);
|
|
479
|
+
return y.has(v) ? y.delete(v) : y.add(v), y;
|
|
471
480
|
}),
|
|
472
481
|
children: [
|
|
473
|
-
|
|
482
|
+
h.map((c, y) => /* @__PURE__ */ s(
|
|
474
483
|
"td",
|
|
475
484
|
{
|
|
476
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${U(
|
|
477
|
-
style:
|
|
478
|
-
children:
|
|
485
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${U(y)} text-[11.5px] font-medium text-slate-600 dark:text-slate-300 ${q(c) ? "text-right tabular-nums" : ""} ${g && y === 0 ? `sticky left-0 z-[1] ${V} bg-slate-100/80 dark:bg-muted` : ""}`,
|
|
486
|
+
style: y === 0 ? { paddingLeft: 18 } : void 0,
|
|
487
|
+
children: y === 0 ? `${D ? "▸" : "▾"} ${$}` : c.formula ? T(I(c.formula, O), c.format) : c.field && c.field !== e && q(c) ? j(O, c) : ""
|
|
479
488
|
},
|
|
480
|
-
c.field ?? c.label ??
|
|
489
|
+
c.field ?? c.label ?? y
|
|
481
490
|
)),
|
|
482
|
-
k && /* @__PURE__ */
|
|
491
|
+
k && /* @__PURE__ */ s("td", { className: pe("bg-slate-100 dark:bg-muted") })
|
|
483
492
|
]
|
|
484
493
|
}
|
|
485
494
|
),
|
|
486
|
-
children: !
|
|
487
|
-
var
|
|
488
|
-
const
|
|
489
|
-
return
|
|
495
|
+
children: !D && S.map((c, y) => {
|
|
496
|
+
var Le;
|
|
497
|
+
const ae = String(c[d.field] ?? ""), le = ae.slice(ae.lastIndexOf(f) + f.length), Ae = ((Le = h[0]) == null ? void 0 : Le.field) === d.field ? le : void 0;
|
|
498
|
+
return P(c, `${v}-${y}`, 2, Ae);
|
|
490
499
|
})
|
|
491
500
|
},
|
|
492
|
-
|
|
501
|
+
v
|
|
493
502
|
);
|
|
494
503
|
})
|
|
495
504
|
];
|
|
@@ -498,14 +507,31 @@ function Xe({
|
|
|
498
507
|
l
|
|
499
508
|
);
|
|
500
509
|
});
|
|
501
|
-
|
|
510
|
+
he = [...t.map((l, o) => P(l, `flat-${o}`)), ...n];
|
|
502
511
|
} else
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
((
|
|
512
|
+
he = C.map((e, t) => P(e, String(t)));
|
|
513
|
+
const Ke = (e) => e.startsCollapsed ? E.has(e.key) : !E.has(e.key), te = J.length > 0 && J.every(Ke), Ge = (e) => G(
|
|
514
|
+
new Set(
|
|
515
|
+
J.filter((t) => e ? t.startsCollapsed : !t.startsCollapsed).map((t) => t.key)
|
|
516
|
+
)
|
|
517
|
+
), Se = J.length > 0 ? /* @__PURE__ */ p(
|
|
518
|
+
"button",
|
|
519
|
+
{
|
|
520
|
+
type: "button",
|
|
521
|
+
"data-query-tree-toggle": te ? "collapse" : "expand",
|
|
522
|
+
onClick: () => Ge(!te),
|
|
523
|
+
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",
|
|
524
|
+
children: [
|
|
525
|
+
te ? /* @__PURE__ */ s(Be, { className: "h-3.5 w-3.5", "aria-hidden": !0 }) : /* @__PURE__ */ s(Qe, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
526
|
+
te ? "Collapse all" : "Expand all"
|
|
527
|
+
]
|
|
528
|
+
}
|
|
529
|
+
) : null;
|
|
530
|
+
return /* @__PURE__ */ p("div", { className: g ? "flex min-h-0 flex-1 flex-col" : void 0, children: [
|
|
531
|
+
(((Me = r == null ? void 0 : r.pivot) == null ? void 0 : Me.quarter_toggle) || (((Oe = r == null ? void 0 : r.toggles) == null ? void 0 : Oe.length) ?? 0) > 0 || Se) && /* @__PURE__ */ p("div", { className: "flex shrink-0 items-center justify-between gap-2 pb-2", children: [
|
|
532
|
+
(((Ee = r == null ? void 0 : r.toggles) == null ? void 0 : Ee.length) ?? 0) > 0 ? /* @__PURE__ */ s("div", { className: "inline-flex gap-0.5 rounded-md border border-slate-200 bg-slate-50 p-0.5 dark:border-border dark:bg-muted/40", children: r.toggles.map((e) => {
|
|
507
533
|
const t = !m.has(e.label);
|
|
508
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ s(
|
|
509
535
|
"button",
|
|
510
536
|
{
|
|
511
537
|
type: "button",
|
|
@@ -519,40 +545,43 @@ function Xe({
|
|
|
519
545
|
},
|
|
520
546
|
e.label
|
|
521
547
|
);
|
|
522
|
-
}) }) : /* @__PURE__ */
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
{
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
548
|
+
}) }) : /* @__PURE__ */ s("span", {}),
|
|
549
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
|
|
550
|
+
Se,
|
|
551
|
+
((ze = r == null ? void 0 : r.pivot) == null ? void 0 : ze.quarter_toggle) && /* @__PURE__ */ s("div", { className: "inline-flex gap-0.5 rounded-md border border-slate-200 p-0.5 dark:border-border", children: ["month", "quarter"].map((e) => /* @__PURE__ */ s(
|
|
552
|
+
"button",
|
|
553
|
+
{
|
|
554
|
+
type: "button",
|
|
555
|
+
onClick: () => ne(e),
|
|
556
|
+
className: `rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${L === e ? "bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,
|
|
557
|
+
children: e === "month" ? "Monthly" : "Quarterly"
|
|
558
|
+
},
|
|
559
|
+
e
|
|
560
|
+
)) })
|
|
561
|
+
] })
|
|
533
562
|
] }),
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ p("div", { className: g ? "relative flex min-h-0 flex-1 flex-col" : "relative", children: [
|
|
564
|
+
/* @__PURE__ */ s(
|
|
536
565
|
"div",
|
|
537
566
|
{
|
|
538
|
-
ref:
|
|
567
|
+
ref: de,
|
|
539
568
|
className: g ? "min-h-0 flex-1 overflow-auto" : "overflow-x-auto",
|
|
540
|
-
children: /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
569
|
+
children: /* @__PURE__ */ p("table", { className: "w-full border-separate border-spacing-0 text-[12px] [&>tbody>tr.border-b>td]:border-b [&>tbody>tr.border-b>td]:[border-bottom-color:inherit] [&>tbody:has(+tfoot)>tr:last-child>td]:border-b-0 [&>tfoot>tr.border-t>td]:border-t [&>tfoot>tr.border-t>td]:[border-top-color:inherit]", children: [
|
|
570
|
+
/* @__PURE__ */ s("thead", { children: we ? /* @__PURE__ */ p(Re, { children: [
|
|
571
|
+
/* @__PURE__ */ p("tr", { children: [
|
|
543
572
|
(() => {
|
|
544
573
|
const e = [];
|
|
545
574
|
let t = 0;
|
|
546
|
-
for (; t <
|
|
547
|
-
const a =
|
|
575
|
+
for (; t < h.length; ) {
|
|
576
|
+
const a = h[t];
|
|
548
577
|
if (!a.group) {
|
|
549
578
|
e.push(
|
|
550
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ s(
|
|
551
580
|
"th",
|
|
552
581
|
{
|
|
553
582
|
rowSpan: 2,
|
|
554
|
-
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 ${
|
|
555
|
-
children: a.label ??
|
|
583
|
+
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 ${q(a) ? "text-right" : "text-left"} ${_e(t)}`,
|
|
584
|
+
children: a.label ?? ge(a.field ?? "")
|
|
556
585
|
},
|
|
557
586
|
`u-${a.field ?? t}`
|
|
558
587
|
)
|
|
@@ -560,14 +589,14 @@ function Xe({
|
|
|
560
589
|
continue;
|
|
561
590
|
}
|
|
562
591
|
let n = 1;
|
|
563
|
-
for (; t + n <
|
|
592
|
+
for (; t + n < h.length && h[t + n].group === a.group; )
|
|
564
593
|
n++;
|
|
565
594
|
e.push(
|
|
566
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ s(
|
|
567
596
|
"th",
|
|
568
597
|
{
|
|
569
598
|
colSpan: n,
|
|
570
|
-
className: `whitespace-nowrap border-b border-slate-100 py-1 pr-3 text-center text-[11px] font-semibold dark:border-border/60 ${a.group ===
|
|
599
|
+
className: `whitespace-nowrap border-b border-slate-100 py-1 pr-3 text-center text-[11px] font-semibold dark:border-border/60 ${a.group === X ? "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 ${ce(t)}`} ${g ? "sticky top-0 z-[2] bg-white dark:bg-card" : ""}`.trim(),
|
|
571
600
|
children: a.group
|
|
572
601
|
},
|
|
573
602
|
`g-${a.group}-${t}`
|
|
@@ -576,47 +605,47 @@ function Xe({
|
|
|
576
605
|
}
|
|
577
606
|
return e;
|
|
578
607
|
})(),
|
|
579
|
-
k && /* @__PURE__ */
|
|
608
|
+
k && /* @__PURE__ */ s(
|
|
580
609
|
"th",
|
|
581
610
|
{
|
|
582
611
|
rowSpan: 2,
|
|
583
612
|
"aria-label": "Actions",
|
|
584
613
|
"data-qt-actions-head": "",
|
|
585
|
-
className: `border-b border-slate-200 dark:border-border ${g ? `sticky right-0 top-0 z-[3] ${
|
|
614
|
+
className: `border-b border-slate-200 dark:border-border ${g ? `sticky right-0 top-0 z-[3] ${ee} bg-white dark:bg-card` : ""}`
|
|
586
615
|
}
|
|
587
616
|
)
|
|
588
617
|
] }),
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
(e, t) => e.group ? /* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ s("tr", { children: h.map(
|
|
619
|
+
(e, t) => e.group ? /* @__PURE__ */ s(
|
|
591
620
|
"th",
|
|
592
621
|
{
|
|
593
|
-
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${U(t)} text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400 ${
|
|
594
|
-
children: e.label ??
|
|
622
|
+
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${U(t)} text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400 ${q(e) ? "text-right" : "text-left"} ${Z(e) || ce(t)} ${g ? "sticky top-[26px] z-[2] bg-white dark:bg-card" : ""}`,
|
|
623
|
+
children: e.label ?? ge(e.field ?? "")
|
|
595
624
|
},
|
|
596
625
|
e.field ?? e.label ?? t
|
|
597
626
|
) : null
|
|
598
627
|
) })
|
|
599
|
-
] }) : /* @__PURE__ */
|
|
600
|
-
|
|
628
|
+
] }) : /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 dark:border-border", children: [
|
|
629
|
+
h.map((e, t) => /* @__PURE__ */ p(
|
|
601
630
|
"th",
|
|
602
631
|
{
|
|
603
|
-
className: `whitespace-nowrap border-b border-slate-200 py-1.5 pr-3 ${U(t)} text-[10.5px] font-semibold uppercase tracking-wider dark:border-border ${
|
|
632
|
+
className: `whitespace-nowrap border-b border-slate-200 py-1.5 pr-3 ${U(t)} text-[10.5px] font-semibold uppercase tracking-wider dark:border-border ${$e(e) ? "border-t-2 border-t-[#6366f1] bg-[#6366f10f] text-[#4f46e5] dark:border-t-[#a5b4fc] dark:bg-[#a5b4fc12] dark:text-[#a5b4fc]" : "text-slate-500 dark:text-slate-400"} ${e.stack ? "min-w-[64px]" : ""} ${q(e) ? "text-right" : "text-left"} ${_e(t)}`,
|
|
604
633
|
children: [
|
|
605
|
-
e.label ??
|
|
606
|
-
e.stack && (r == null ? void 0 : r.stack_legend) && /* @__PURE__ */
|
|
634
|
+
e.label ?? ge(e.field ?? ""),
|
|
635
|
+
e.stack && (r == null ? void 0 : r.stack_legend) && /* @__PURE__ */ p(
|
|
607
636
|
"span",
|
|
608
637
|
{
|
|
609
638
|
className: "flex justify-end gap-1.5 text-[9px] font-medium normal-case tracking-normal",
|
|
610
|
-
style:
|
|
639
|
+
style: ue(e) ? { ...ue(e), ...Q(e) ?? {} } : Q(e),
|
|
611
640
|
children: [
|
|
612
|
-
|
|
641
|
+
ve(e) && /* @__PURE__ */ s(
|
|
613
642
|
"span",
|
|
614
643
|
{
|
|
615
644
|
className: e.color ? "text-[color:var(--qtc)] dark:text-[color:var(--qtcd)]" : "",
|
|
616
645
|
children: r.stack_legend[0]
|
|
617
646
|
}
|
|
618
647
|
),
|
|
619
|
-
|
|
648
|
+
Ne(e) && /* @__PURE__ */ s(
|
|
620
649
|
"span",
|
|
621
650
|
{
|
|
622
651
|
className: e.stack_color ? "text-[color:var(--qts)] dark:text-[color:var(--qtsd)]" : "",
|
|
@@ -630,36 +659,36 @@ function Xe({
|
|
|
630
659
|
},
|
|
631
660
|
e.field ?? e.label ?? t
|
|
632
661
|
)),
|
|
633
|
-
k && /* @__PURE__ */
|
|
662
|
+
k && /* @__PURE__ */ s(
|
|
634
663
|
"th",
|
|
635
664
|
{
|
|
636
665
|
"aria-label": "Actions",
|
|
637
666
|
"data-qt-actions-head": "",
|
|
638
|
-
className: g ? `sticky right-0 top-0 z-[3] ${
|
|
667
|
+
className: g ? `sticky right-0 top-0 z-[3] ${ee} bg-white dark:bg-card` : void 0
|
|
639
668
|
}
|
|
640
669
|
)
|
|
641
670
|
] }) }),
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
H && /* @__PURE__ */
|
|
644
|
-
|
|
671
|
+
/* @__PURE__ */ s("tbody", { children: he }),
|
|
672
|
+
H && /* @__PURE__ */ s("tfoot", { children: /* @__PURE__ */ p("tr", { className: "border-t border-slate-300 font-semibold dark:border-border", children: [
|
|
673
|
+
h.map((e, t) => /* @__PURE__ */ s(
|
|
645
674
|
"td",
|
|
646
675
|
{
|
|
647
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${U(t)} ${
|
|
648
|
-
style:
|
|
676
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${U(t)} ${ie(e, "")} ${q(e) ? "text-right tabular-nums" : ""} ${Z(e)} ${g ? `sticky bottom-0 border-t border-slate-300 dark:border-border ${t === 0 ? `left-0 z-[3] ${V} bg-slate-50 dark:bg-muted` : "z-[2] bg-white dark:bg-card"}` : ""}`,
|
|
677
|
+
style: Q(
|
|
649
678
|
e,
|
|
650
679
|
Number(
|
|
651
|
-
e.formula ?
|
|
680
|
+
e.formula ? I(e.formula, H) : H[e.field ?? ""]
|
|
652
681
|
)
|
|
653
682
|
),
|
|
654
|
-
children: t === 0 && !e.sum && !e.formula ? "Total" : e.sum || e.formula ? e.formula ? T(
|
|
683
|
+
children: t === 0 && !e.sum && !e.formula ? "Total" : e.sum || e.formula ? e.formula ? T(I(e.formula, H), e.format) : j(H, e) : ""
|
|
655
684
|
},
|
|
656
685
|
e.field ?? e.label ?? t
|
|
657
686
|
)),
|
|
658
|
-
k && /* @__PURE__ */
|
|
687
|
+
k && /* @__PURE__ */ s(
|
|
659
688
|
"td",
|
|
660
689
|
{
|
|
661
|
-
className: `py-1.5 pr-3 text-right ${g ? `sticky bottom-0 right-0 z-[3] border-t border-slate-300 ${
|
|
662
|
-
children: /* @__PURE__ */
|
|
690
|
+
className: `py-1.5 pr-3 text-right ${g ? `sticky bottom-0 right-0 z-[3] border-t border-slate-300 ${ee} bg-white dark:border-border dark:bg-card` : ""}`,
|
|
691
|
+
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1.5", children: k.map((e) => /* @__PURE__ */ s(
|
|
663
692
|
"button",
|
|
664
693
|
{
|
|
665
694
|
type: "button",
|
|
@@ -677,7 +706,7 @@ function Xe({
|
|
|
677
706
|
),
|
|
678
707
|
w.canScrollRight && // More columns to the right: fade the edge so readers know the
|
|
679
708
|
// table scrolls sideways (the native scrollbar is often invisible).
|
|
680
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ s(
|
|
681
710
|
"div",
|
|
682
711
|
{
|
|
683
712
|
"aria-hidden": !0,
|
|
@@ -689,16 +718,16 @@ function Xe({
|
|
|
689
718
|
] })
|
|
690
719
|
] });
|
|
691
720
|
}
|
|
692
|
-
function
|
|
693
|
-
return /* @__PURE__ */
|
|
721
|
+
function Ie({ header: i, children: r }) {
|
|
722
|
+
return /* @__PURE__ */ p(Re, { children: [
|
|
694
723
|
i,
|
|
695
724
|
r
|
|
696
725
|
] });
|
|
697
726
|
}
|
|
698
727
|
export {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
728
|
+
fe as COLOR_ROLES,
|
|
729
|
+
st as QueryTable,
|
|
730
|
+
xe as colorPair,
|
|
731
|
+
Xe as darkVariant,
|
|
732
|
+
et as pivotQueryRows
|
|
704
733
|
};
|