@nivaro/react 0.3.48 → 0.3.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/InlineGridField.js +166 -105
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/shared/components/CellCopyLayer.js +81 -44
- package/dist/shared/components/CollectionBrowserView.js +306 -297
- package/dist/shared/components/DataTable.js +3 -3
- package/dist/shared/components/FulfilmentPill.js +98 -78
- package/dist/shared/components/ItemEditForm.js +4682 -4570
- package/dist/shared/components/NotificationSourcesCard.js +151 -147
- package/dist/shared/components/ProfileView.js +72 -70
- package/dist/shared/components/QueryTable.js +462 -333
- package/dist/shared/components/imports/ImportConsole.js +4 -4
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
- package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
- package/dist/shared/components/item-edit/CloneDialog.js +192 -142
- package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
- package/dist/shared/components/item-edit/FieldRow.js +236 -226
- package/dist/shared/components/item-edit/HeaderTools.js +118 -113
- package/dist/shared/components/item-edit/InlineGridField.js +92 -90
- package/dist/shared/components/item-edit/InlineTableField.js +3091 -2942
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
- package/dist/shared/components/item-edit/PlanGrid.js +162 -162
- package/dist/shared/components/item-edit/PolishFields.js +169 -162
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
- package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
- package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
- package/dist/shared/components/item-edit/helpers.js +181 -155
- package/dist/shared/components/item-edit/line-midair.js +201 -0
- package/dist/shared/components/item-edit/soft-rules.js +27 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
- package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
- package/dist/shared/components/notifications/DeliveryChips.js +9 -9
- package/dist/shared/components/panels/ItemLockBanner.js +414 -358
- package/dist/shared/components/panels/PipelinePanel.js +1171 -975
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
- package/dist/shared/components/profile/PersonProfile.js +23 -21
- package/dist/shared/components/profile/SignedInDevices.js +126 -0
- package/dist/shared/components/queue/QueueItemSheet.js +38 -37
- package/dist/shared/components/queue/QueueWorklist.js +870 -827
- package/dist/shared/components/queue/column-chooser.js +21 -0
- package/dist/shared/components/queue/live-state-aspect.js +6 -0
- package/dist/shared/components/support/SupportView.js +1 -1
- package/dist/shared/components/ui/number-draft-input.js +93 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
- package/dist/shared/lib/edit-lock-fields.js +7 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/reimport-visibility.js +10 -0
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as s, jsxs as p, Fragment as
|
|
2
|
-
import { ChevronsDownUp as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { evaluateNumeric as
|
|
5
|
-
function
|
|
6
|
-
return `color-mix(in srgb, ${
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
+
import { Search as dt, Download as it, ArrowUp as ut, ArrowDown as bt, ChevronsDownUp as mt, ChevronsUpDown as pt } from "lucide-react";
|
|
3
|
+
import { useState as I, useEffect as ct, useMemo as ht } from "react";
|
|
4
|
+
import { evaluateNumeric as xt } from "../lib/expression.js";
|
|
5
|
+
function ft(o) {
|
|
6
|
+
return `color-mix(in srgb, ${o} 55%, white)`;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const Se = {
|
|
9
9
|
// Brand ink for TEXT: the raw brand (cyan on white ≈ 1.6:1) is a fill
|
|
10
10
|
// colour, not a text colour — mix toward black in light mode, raw in dark.
|
|
11
11
|
accent: ["color-mix(in srgb, rgb(var(--nvr-cyan-rgb)) 56%, black)", "rgb(var(--nvr-cyan-rgb))"],
|
|
@@ -19,12 +19,12 @@ const fe = {
|
|
|
19
19
|
warning: ["var(--nvr-role-warning, #b45309)", "var(--nvr-role-warning-dark, #d4936a)"],
|
|
20
20
|
info: ["var(--nvr-role-info, #4f46e5)", "var(--nvr-role-info-dark, #8fa6c9)"]
|
|
21
21
|
};
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
return
|
|
22
|
+
function Ce(o, t) {
|
|
23
|
+
var h, f;
|
|
24
|
+
const m = Se[o.trim().toLowerCase()];
|
|
25
|
+
return m ? [m[0], t ? ((h = Se[t]) == null ? void 0 : h[1]) ?? t : m[1]] : [o, t ? ((f = Se[t]) == null ? void 0 : f[1]) ?? t : ft(o)];
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const kt = /^[-+−]?\$?0(?:\.0+)?%?$/, qe = (o) => o === "—" ? /* @__PURE__ */ s("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : kt.test(o) ? /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: o }) : o, Qe = [
|
|
28
28
|
"jan",
|
|
29
29
|
"feb",
|
|
30
30
|
"mar",
|
|
@@ -37,7 +37,7 @@ const Ze = /^[-+−]?\$?0(?:\.0+)?%?$/, ke = (i) => i === "—" ? /* @__PURE__ *
|
|
|
37
37
|
"oct",
|
|
38
38
|
"nov",
|
|
39
39
|
"dec"
|
|
40
|
-
],
|
|
40
|
+
], vt = [
|
|
41
41
|
"Jan",
|
|
42
42
|
"Feb",
|
|
43
43
|
"Mar",
|
|
@@ -51,168 +51,168 @@ const Ze = /^[-+−]?\$?0(?:\.0+)?%?$/, ke = (i) => i === "—" ? /* @__PURE__ *
|
|
|
51
51
|
"Nov",
|
|
52
52
|
"Dec"
|
|
53
53
|
];
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
for (const
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
if (!
|
|
60
|
-
|
|
61
|
-
for (const
|
|
62
|
-
|
|
54
|
+
function yt(o, t, m, h = "month") {
|
|
55
|
+
const f = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Set();
|
|
56
|
+
for (const u of o) {
|
|
57
|
+
const K = t.key_fields.map((T) => String(u[T] ?? "")).join("|");
|
|
58
|
+
let S = f.get(K);
|
|
59
|
+
if (!S) {
|
|
60
|
+
S = {};
|
|
61
|
+
for (const T of t.key_fields) S[T] = u[T];
|
|
62
|
+
f.set(K, S);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
66
|
-
const
|
|
67
|
-
if (Number(
|
|
68
|
-
const
|
|
69
|
-
|
|
64
|
+
const he = String(u[t.date_field] ?? ""), L = /^(\d{4})-(\d{2})/.exec(he);
|
|
65
|
+
if (!L) continue;
|
|
66
|
+
const Q = Number(u[t.value_field]) || 0;
|
|
67
|
+
if (Number(L[1]) === m) {
|
|
68
|
+
const T = Number(L[2]) - 1, V = h === "quarter" ? `q${Math.floor(T / 3) + 1}` : Qe[T];
|
|
69
|
+
V && (S[V] = (Number(S[V]) || 0) + Q);
|
|
70
70
|
} else
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
F.add(L[1]), S[`y${L[1]}`] = (Number(S[`y${L[1]}`]) || 0) + Q;
|
|
72
|
+
t.total !== !1 && (S.total = (Number(S.total) || 0) + Q);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
field: `q${
|
|
76
|
-
label: `Q${
|
|
74
|
+
const y = [...F].filter((u) => Number(u) < m).sort(), g = [...F].filter((u) => Number(u) > m).sort(), R = h === "quarter" ? [1, 2, 3, 4].map((u) => ({
|
|
75
|
+
field: `q${u}`,
|
|
76
|
+
label: `Q${u}`,
|
|
77
77
|
format: "currency",
|
|
78
78
|
sum: !0
|
|
79
|
-
})) :
|
|
80
|
-
field:
|
|
81
|
-
label:
|
|
79
|
+
})) : Qe.map((u, K) => ({
|
|
80
|
+
field: u,
|
|
81
|
+
label: vt[K],
|
|
82
82
|
format: "currency",
|
|
83
83
|
sum: !0
|
|
84
|
-
})),
|
|
85
|
-
...
|
|
86
|
-
field: `y${
|
|
87
|
-
label:
|
|
84
|
+
})), H = t.color ? { color: t.color, color_negative: t.color_negative } : {}, ce = [
|
|
85
|
+
...y.map((u) => ({
|
|
86
|
+
field: `y${u}`,
|
|
87
|
+
label: u,
|
|
88
88
|
format: "currency",
|
|
89
89
|
sum: !0,
|
|
90
|
-
...
|
|
90
|
+
...H
|
|
91
91
|
})),
|
|
92
|
-
...
|
|
93
|
-
...
|
|
94
|
-
field: `y${
|
|
95
|
-
label:
|
|
92
|
+
...R.map((u) => ({ ...u, ...H })),
|
|
93
|
+
...g.map((u) => ({
|
|
94
|
+
field: `y${u}`,
|
|
95
|
+
label: u,
|
|
96
96
|
format: "currency",
|
|
97
97
|
sum: !0,
|
|
98
|
-
...
|
|
98
|
+
...H
|
|
99
99
|
})),
|
|
100
|
-
...
|
|
100
|
+
...t.total !== !1 ? [
|
|
101
101
|
{
|
|
102
102
|
field: "total",
|
|
103
103
|
label: "Total",
|
|
104
104
|
format: "currency",
|
|
105
105
|
sum: !0,
|
|
106
|
-
...
|
|
106
|
+
...t.total_color ? { color: t.total_color, color_negative: t.color_negative } : H
|
|
107
107
|
}
|
|
108
108
|
] : []
|
|
109
109
|
];
|
|
110
|
-
return { rows: [...
|
|
110
|
+
return { rows: [...f.values()], columns: ce };
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
112
|
+
function J(o, t) {
|
|
113
|
+
return xt(o, t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
if (!Number.isFinite(
|
|
119
|
-
switch (
|
|
115
|
+
function re(o, t) {
|
|
116
|
+
if (o == null || o === "") return "—";
|
|
117
|
+
const m = Number(o);
|
|
118
|
+
if (!Number.isFinite(m)) return String(o);
|
|
119
|
+
switch (t) {
|
|
120
120
|
case "currency": {
|
|
121
|
-
const
|
|
122
|
-
return
|
|
121
|
+
const h = Number.isInteger(m);
|
|
122
|
+
return m.toLocaleString("en-US", {
|
|
123
123
|
style: "currency",
|
|
124
124
|
currency: "USD",
|
|
125
|
-
minimumFractionDigits:
|
|
125
|
+
minimumFractionDigits: h ? 0 : 2,
|
|
126
126
|
maximumFractionDigits: 2
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
case "percent":
|
|
130
|
-
return `${
|
|
130
|
+
return `${m.toLocaleString("en-US", { maximumFractionDigits: 1 })}%`;
|
|
131
131
|
case "number":
|
|
132
|
-
return
|
|
132
|
+
return m.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
133
133
|
default:
|
|
134
|
-
return String(
|
|
134
|
+
return String(o);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
137
|
+
function ae(o) {
|
|
138
|
+
return o.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase());
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
rows:
|
|
142
|
-
config:
|
|
143
|
-
onRowClick:
|
|
144
|
-
pivotYear:
|
|
145
|
-
rowActions:
|
|
146
|
-
emptyLabel:
|
|
147
|
-
emptyText:
|
|
140
|
+
function qt({
|
|
141
|
+
rows: o,
|
|
142
|
+
config: t,
|
|
143
|
+
onRowClick: m,
|
|
144
|
+
pivotYear: h,
|
|
145
|
+
rowActions: f,
|
|
146
|
+
emptyLabel: F,
|
|
147
|
+
emptyText: y
|
|
148
148
|
}) {
|
|
149
|
-
var
|
|
150
|
-
const [
|
|
151
|
-
() => new Set(((
|
|
152
|
-
), [
|
|
149
|
+
var Re, Ue, ze, Ie, He, We, Je, Ke, je, Ae;
|
|
150
|
+
const [g, R] = I(() => /* @__PURE__ */ new Set()), [H, ce] = I("month"), [u, K] = I(null), [S, he] = I(""), [L, Q] = I(!!((Re = t == null ? void 0 : t.hide_empty) != null && Re.default_on)), [T, V] = I(
|
|
151
|
+
() => new Set(((t == null ? void 0 : t.toggles) ?? []).filter((e) => e.default_on === !1).map((e) => e.label))
|
|
152
|
+
), [v, Ye] = I(null), [le, Xe] = I({
|
|
153
153
|
overflows: !1,
|
|
154
154
|
canScrollRight: !1,
|
|
155
155
|
cueInset: { right: 0, bottom: 0 }
|
|
156
156
|
});
|
|
157
|
-
if (
|
|
158
|
-
if (!
|
|
157
|
+
if (ct(() => {
|
|
158
|
+
if (!v) return;
|
|
159
159
|
const e = () => {
|
|
160
|
-
const a =
|
|
161
|
-
|
|
162
|
-
(
|
|
160
|
+
const a = v.scrollWidth > v.clientWidth + 1, n = v.scrollWidth > v.clientWidth + v.scrollLeft + 1, l = v.querySelector("[data-qt-actions-head]"), d = t != null && t.sticky && l ? l.offsetWidth : 0, b = v.offsetWidth - v.clientWidth + d, C = v.offsetHeight - v.clientHeight;
|
|
161
|
+
Xe(
|
|
162
|
+
(D) => D.overflows === a && D.canScrollRight === n && D.cueInset.right === b && D.cueInset.bottom === C ? D : { overflows: a, canScrollRight: n, cueInset: { right: b, bottom: C } }
|
|
163
163
|
);
|
|
164
164
|
};
|
|
165
165
|
e();
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
-
|
|
166
|
+
const r = new ResizeObserver(e);
|
|
167
|
+
return r.observe(v), v.firstElementChild && r.observe(v.firstElementChild), v.addEventListener("scroll", e, { passive: !0 }), () => {
|
|
168
|
+
r.disconnect(), v.removeEventListener("scroll", e);
|
|
169
169
|
};
|
|
170
|
-
}, [
|
|
171
|
-
return /* @__PURE__ */ s("p", { className: "px-1 py-2 text-[12px] italic text-slate-400", children:
|
|
172
|
-
let
|
|
173
|
-
if (
|
|
174
|
-
const e =
|
|
175
|
-
|
|
170
|
+
}, [v, t == null ? void 0 : t.sticky]), !o || o.length === 0)
|
|
171
|
+
return /* @__PURE__ */ s("p", { className: "px-1 py-2 text-[12px] italic text-slate-400", children: y || (F ? `No ${F.toLowerCase()} yet` : "No data") });
|
|
172
|
+
let xe = null;
|
|
173
|
+
if (t != null && t.pivot) {
|
|
174
|
+
const e = h ?? t.pivot.year ?? (/* @__PURE__ */ new Date()).getFullYear(), r = yt(o, t.pivot, e, H);
|
|
175
|
+
o = r.rows, xe = r.columns;
|
|
176
176
|
}
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
179
|
-
const e =
|
|
180
|
-
for (const a of
|
|
181
|
-
const n = String(a[e] ?? "—"), l =
|
|
177
|
+
let $ = o;
|
|
178
|
+
if (t != null && t.group_by) {
|
|
179
|
+
const e = t.group_by, r = /* @__PURE__ */ new Map();
|
|
180
|
+
for (const a of o) {
|
|
181
|
+
const n = String(a[e] ?? "—"), l = r.get(n);
|
|
182
182
|
if (!l) {
|
|
183
|
-
|
|
183
|
+
r.set(n, { ...a, [e]: n });
|
|
184
184
|
continue;
|
|
185
185
|
}
|
|
186
|
-
for (const [
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
Number.isFinite(
|
|
186
|
+
for (const [d, b] of Object.entries(a)) {
|
|
187
|
+
if (d === e) continue;
|
|
188
|
+
const C = Number(b);
|
|
189
|
+
Number.isFinite(C) && typeof b != "boolean" && (l[d] = (Number(l[d]) || 0) + C);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
$ = [...r.entries()].sort(([a], [n]) => a.localeCompare(n)).map(([, a]) => a);
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const Fe = xe ? [
|
|
195
195
|
// Key columns first (configured, else the pivot's key fields), then
|
|
196
196
|
// the generated year/month/total columns.
|
|
197
|
-
...(
|
|
198
|
-
...
|
|
199
|
-
] :
|
|
197
|
+
...(Ue = t == null ? void 0 : t.columns) != null && Ue.length ? t.columns : (((ze = t == null ? void 0 : t.pivot) == null ? void 0 : ze.key_fields) ?? []).map((e) => ({ field: e })),
|
|
198
|
+
...xe
|
|
199
|
+
] : t != null && t.columns && t.columns.length > 0 ? t.columns : Object.keys($[0]).map((e) => ({ field: e })), P = /* @__PURE__ */ new Set();
|
|
200
200
|
{
|
|
201
201
|
const e = [];
|
|
202
|
-
for (const
|
|
203
|
-
|
|
204
|
-
for (const
|
|
205
|
-
const a = !
|
|
206
|
-
if (
|
|
202
|
+
for (const r of Fe)
|
|
203
|
+
r.field && e.push(r.field), r.stack && e.push(r.stack);
|
|
204
|
+
for (const r of (t == null ? void 0 : t.toggles) ?? []) {
|
|
205
|
+
const a = !T.has(r.label);
|
|
206
|
+
if (r.hide_when_on ? a : !a)
|
|
207
207
|
for (const l of e)
|
|
208
|
-
((
|
|
208
|
+
((Ie = r.fields) != null && Ie.includes(l) || r.suffix && l.endsWith(r.suffix)) && P.add(l);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
const
|
|
211
|
+
const x = Fe.filter((e) => {
|
|
212
212
|
if (!e.field) return !0;
|
|
213
|
-
const
|
|
214
|
-
return !(
|
|
215
|
-
}),
|
|
213
|
+
const r = P.has(e.field), a = e.stack ? P.has(e.stack) : !0;
|
|
214
|
+
return !(r && a);
|
|
215
|
+
}), fe = (e) => !!e.field && !P.has(e.field), Le = (e) => !!e.stack && !P.has(e.stack), Ze = [
|
|
216
216
|
"Jan",
|
|
217
217
|
"Feb",
|
|
218
218
|
"Mar",
|
|
@@ -225,31 +225,31 @@ function st({
|
|
|
225
225
|
"Oct",
|
|
226
226
|
"Nov",
|
|
227
227
|
"Dec"
|
|
228
|
-
],
|
|
228
|
+
], se = (t == null ? void 0 : t.highlight_group) === "$current_month" ? Ze[(/* @__PURE__ */ new Date()).getMonth()] : (t == null ? void 0 : t.highlight_group) ?? null, Ee = (e) => !!se && (e.group === se || !e.group && e.label === se), oe = (e) => Ee(e) ? "bg-[#6366f10f] dark:bg-[#a5b4fc12]" : "", Y = (e, r) => {
|
|
229
229
|
if (!e.color) return;
|
|
230
|
-
const a = e.color_negative && typeof
|
|
230
|
+
const a = e.color_negative && typeof r == "number" && r < 0, [n, l] = a ? Ce(e.color_negative) : Ce(e.color, e.color_dark);
|
|
231
231
|
return { "--qtc": n, "--qtcd": l };
|
|
232
|
-
},
|
|
232
|
+
}, ke = (e, r) => e.color ? "text-[color:var(--qtc)] dark:text-[color:var(--qtcd)]" : r, ve = (e) => {
|
|
233
233
|
if (!e.stack_color) return;
|
|
234
|
-
const [
|
|
235
|
-
return { "--qts":
|
|
236
|
-
},
|
|
234
|
+
const [r, a] = Ce(e.stack_color, e.stack_color_dark);
|
|
235
|
+
return { "--qts": r, "--qtsd": a };
|
|
236
|
+
}, E = (e, r) => r.formula ? J(r.formula, e) : r.field ? e[r.field] : null, et = ht(() => {
|
|
237
237
|
const e = /* @__PURE__ */ new Map();
|
|
238
|
-
for (const
|
|
239
|
-
!
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
for (const r of (t == null ? void 0 : t.columns) ?? [])
|
|
239
|
+
!r.percent_of_total || !r.field || e.set(
|
|
240
|
+
r.field,
|
|
241
|
+
o.reduce((a, n) => a + (Number(n[r.field]) || 0), 0)
|
|
242
242
|
);
|
|
243
243
|
return e;
|
|
244
|
-
}, [
|
|
245
|
-
const a = Number(
|
|
244
|
+
}, [o, t]), tt = (e, r) => {
|
|
245
|
+
const a = Number(E(e, r)), n = r.progress_max ? r.progress_max.includes("{{") ? J(r.progress_max, e) : Number(e[r.progress_max]) : null, l = n && Number.isFinite(n) && n > 0 && Number.isFinite(a) ? a / n * 100 : null;
|
|
246
246
|
return /* @__PURE__ */ p(
|
|
247
247
|
"div",
|
|
248
248
|
{
|
|
249
249
|
className: "flex min-w-[130px] items-center justify-end gap-1.5",
|
|
250
|
-
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 ${re(n, r.format)}`,
|
|
251
251
|
children: [
|
|
252
|
-
/* @__PURE__ */ s("span", { children:
|
|
252
|
+
/* @__PURE__ */ s("span", { children: re(E(e, r), r.format) }),
|
|
253
253
|
/* @__PURE__ */ s("div", { className: "h-1 w-10 shrink-0 overflow-hidden rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ s(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
@@ -261,39 +261,62 @@ function st({
|
|
|
261
261
|
]
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
264
|
+
}, X = ((He = t == null ? void 0 : t.hide_empty) == null ? void 0 : He.fields) ?? [];
|
|
265
|
+
X.length > 0 && L && ($ = $.filter(
|
|
266
|
+
(e) => X.some((r) => {
|
|
267
|
+
const a = e[r];
|
|
268
|
+
return a != null && a !== "" && Number(a) !== 0;
|
|
269
|
+
})
|
|
270
|
+
));
|
|
271
|
+
const ne = t != null && t.search ? S.trim().toLowerCase() : "";
|
|
272
|
+
ne && ($ = $.filter(
|
|
273
|
+
(e) => x.some((r) => {
|
|
274
|
+
const a = E(e, r);
|
|
275
|
+
return a == null || a === "" ? !1 : String(a).toLowerCase().includes(ne) || re(a, r.format).toLowerCase().includes(ne);
|
|
276
|
+
})
|
|
277
|
+
));
|
|
278
|
+
const ye = !!(t != null && t.sortable) && !(t != null && t.tree_group_by), Z = (e, r) => e.field ?? e.label ?? String(r);
|
|
279
|
+
if (ye && u) {
|
|
280
|
+
const e = x.findIndex((a, n) => Z(a, n) === u.key), r = e >= 0 ? x[e] : null;
|
|
281
|
+
r && ($ = [...$].sort(
|
|
282
|
+
(a, n) => gt(E(a, r), E(n, r), u.dir)
|
|
283
|
+
));
|
|
284
|
+
}
|
|
285
|
+
const rt = (e) => K(
|
|
286
|
+
(r) => !r || r.key !== e ? { key: e, dir: 1 } : r.dir === 1 ? { key: e, dir: -1 } : null
|
|
287
|
+
);
|
|
288
|
+
let j = null;
|
|
289
|
+
if (t != null && t.totals) {
|
|
290
|
+
const e = {}, r = (a) => {
|
|
291
|
+
e[a] = $.reduce((n, l) => {
|
|
292
|
+
const d = Number(l[a]);
|
|
293
|
+
return Number.isFinite(d) ? n + d : n;
|
|
271
294
|
}, 0);
|
|
272
295
|
};
|
|
273
|
-
for (const a of
|
|
274
|
-
a.field &&
|
|
275
|
-
|
|
296
|
+
for (const a of x)
|
|
297
|
+
a.field && r(a.field), a.stack && r(a.stack);
|
|
298
|
+
j = e;
|
|
276
299
|
}
|
|
277
|
-
const
|
|
278
|
-
if (!(
|
|
279
|
-
const a = e[
|
|
280
|
-
return a === "currency" || a === "number" ? a :
|
|
281
|
-
},
|
|
300
|
+
const O = (e) => e.format && e.format !== "text", ge = (e, r) => {
|
|
301
|
+
if (!(t != null && t.row_format_field) || !O(r)) return r.format;
|
|
302
|
+
const a = e[t.row_format_field];
|
|
303
|
+
return a === "currency" || a === "number" ? a : r.format;
|
|
304
|
+
}, W = (e, r) => t != null && t.zero_dash && Number(e) === 0 ? "—" : re(e, r), de = (e, r) => {
|
|
282
305
|
var n;
|
|
283
|
-
if ((n =
|
|
284
|
-
const l =
|
|
285
|
-
(
|
|
306
|
+
if ((n = r.sparkline_fields) != null && n.length) {
|
|
307
|
+
const l = r.sparkline_fields.map((i) => Number(e[i]) || 0), d = Math.max(...l, 1), b = Math.min(...l, 0), C = Math.max(d - b, 1), D = l.map(
|
|
308
|
+
(i, k) => `${k / Math.max(l.length - 1, 1) * 60},${17 - (i - b) / C * 15}`
|
|
286
309
|
).join(" ");
|
|
287
310
|
return /* @__PURE__ */ s(
|
|
288
311
|
"svg",
|
|
289
312
|
{
|
|
290
313
|
viewBox: "0 0 60 18",
|
|
291
314
|
className: "inline-block h-[18px] w-[60px]",
|
|
292
|
-
"data-tip": l.map((
|
|
315
|
+
"data-tip": l.map((i) => re(i, r.format)).join(" · "),
|
|
293
316
|
children: /* @__PURE__ */ s(
|
|
294
317
|
"polyline",
|
|
295
318
|
{
|
|
296
|
-
points:
|
|
319
|
+
points: D,
|
|
297
320
|
fill: "none",
|
|
298
321
|
stroke: "#00a5cc",
|
|
299
322
|
strokeWidth: "1.5",
|
|
@@ -303,202 +326,202 @@ function st({
|
|
|
303
326
|
}
|
|
304
327
|
);
|
|
305
328
|
}
|
|
306
|
-
if (
|
|
307
|
-
const l = Number(
|
|
329
|
+
if (r.percent_of_total && r.field) {
|
|
330
|
+
const l = Number(E(e, r)), d = et.get(r.field) ?? 0, b = d > 0 && Number.isFinite(l) ? l / d * 100 : null;
|
|
308
331
|
return /* @__PURE__ */ p("span", { className: "inline-flex items-baseline gap-1", children: [
|
|
309
|
-
|
|
332
|
+
W(E(e, r), r.format),
|
|
310
333
|
b != null && /* @__PURE__ */ p("span", { className: "text-[9.5px] text-slate-400", children: [
|
|
311
334
|
b.toLocaleString("en-US", { maximumFractionDigits: 1 }),
|
|
312
335
|
"%"
|
|
313
336
|
] })
|
|
314
337
|
] });
|
|
315
338
|
}
|
|
316
|
-
if (
|
|
317
|
-
if (
|
|
318
|
-
return /* @__PURE__ */ p("span", { className: "inline-flex flex-col items-end leading-[15px]", style:
|
|
319
|
-
|
|
320
|
-
|
|
339
|
+
if (r.display === "progress") return tt(e, r);
|
|
340
|
+
if (r.stack)
|
|
341
|
+
return /* @__PURE__ */ p("span", { className: "inline-flex flex-col items-end leading-[15px]", style: ve(r), children: [
|
|
342
|
+
fe(r) && /* @__PURE__ */ s("span", { children: qe(W(E(e, r), ge(e, r))) }),
|
|
343
|
+
Le(r) && /* @__PURE__ */ s(
|
|
321
344
|
"span",
|
|
322
345
|
{
|
|
323
|
-
className: `text-[10.5px] ${
|
|
324
|
-
children:
|
|
346
|
+
className: `text-[10.5px] ${r.stack_color ? "text-[color:var(--qts)] dark:text-[color:var(--qtsd)]" : "text-slate-400"}`,
|
|
347
|
+
children: qe(W(e[r.stack], ge(e, r)))
|
|
325
348
|
}
|
|
326
349
|
)
|
|
327
350
|
] });
|
|
328
|
-
const a =
|
|
329
|
-
return
|
|
330
|
-
},
|
|
351
|
+
const a = E(e, r);
|
|
352
|
+
return r.empty_label !== void 0 && (a == null || a === "") ? r.empty_label ? /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: r.empty_label }) : null : qe(W(a, ge(e, r)));
|
|
353
|
+
}, Oe = x.some((e) => e.group), Ne = [];
|
|
331
354
|
{
|
|
332
|
-
let e = -1,
|
|
333
|
-
for (const a of
|
|
334
|
-
a.group && a.group !==
|
|
355
|
+
let e = -1, r;
|
|
356
|
+
for (const a of x)
|
|
357
|
+
a.group && a.group !== r && e++, Ne.push(a.group ? e : -1), r = a.group;
|
|
335
358
|
}
|
|
336
|
-
const
|
|
359
|
+
const we = (e) => Oe && Ne[e] >= 0 && Ne[e] % 2 === 1 ? "bg-slate-50/70 dark:bg-muted/20" : "", N = !!(t != null && t.sticky), ee = "border-r border-slate-200 dark:border-border", at = (e, r) => N && e === 0 ? `sticky left-0 z-[1] ${ee} ${r}` : "", Me = (e) => N ? e === 0 ? `sticky left-0 top-0 z-[3] ${ee} bg-slate-50 dark:bg-muted` : "sticky top-0 z-[2] bg-white dark:bg-card" : "", A = (e) => N && (e === 0 || e === 1) ? "pl-3" : "", ie = le.overflows ? "border-l border-slate-200 dark:border-border" : "", $e = (e) => N ? `sticky right-0 z-[2] ${ie} ${e}` : "", te = (e, r, a = 0, n) => {
|
|
337
360
|
const l = a === !0 ? 1 : a === !1 ? 0 : a;
|
|
338
361
|
return /* @__PURE__ */ p(
|
|
339
362
|
"tr",
|
|
340
363
|
{
|
|
341
|
-
onClick:
|
|
342
|
-
className: `group/qtr border-b border-slate-100 dark:border-border/50 ${
|
|
364
|
+
onClick: m ? () => m(e) : void 0,
|
|
365
|
+
className: `group/qtr border-b border-slate-100 dark:border-border/50 ${m ? "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"}`,
|
|
343
366
|
children: [
|
|
344
|
-
|
|
367
|
+
x.map((d, b) => /* @__PURE__ */ s(
|
|
345
368
|
"td",
|
|
346
369
|
{
|
|
347
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${
|
|
370
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${d.max_width ? "overflow-hidden text-ellipsis" : ""} ${A(b)} ${ke(d, "text-slate-700 dark:text-slate-200")} ${O(d) ? "text-right tabular-nums" : ""} ${d.group ? "min-w-[58px]" : ""} ${oe(d) || we(b)} ${at(b, "bg-slate-50 group-hover/qtr:bg-slate-100 dark:bg-muted dark:group-hover/qtr:bg-muted")}`,
|
|
348
371
|
style: {
|
|
349
372
|
...l > 0 && b === 0 ? { paddingLeft: 2 + l * 16 } : {},
|
|
350
|
-
...
|
|
351
|
-
...
|
|
373
|
+
...d.max_width ? { maxWidth: d.max_width } : {},
|
|
374
|
+
...Y(d, Number(E(e, d))) ?? {}
|
|
352
375
|
},
|
|
353
|
-
title:
|
|
354
|
-
children: b === 0 && n !== void 0 ? n :
|
|
376
|
+
title: d.max_width ? String(E(e, d) ?? "") : void 0,
|
|
377
|
+
children: b === 0 && n !== void 0 ? n : de(e, d)
|
|
355
378
|
},
|
|
356
|
-
|
|
379
|
+
d.field ?? d.label ?? b
|
|
357
380
|
)),
|
|
358
|
-
|
|
381
|
+
f && /* @__PURE__ */ s(
|
|
359
382
|
"td",
|
|
360
383
|
{
|
|
361
|
-
className: `py-1 pl-2 pr-3 text-right ${
|
|
384
|
+
className: `py-1 pl-2 pr-3 text-right ${$e(
|
|
362
385
|
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"
|
|
363
386
|
)}`,
|
|
364
|
-
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1", children:
|
|
387
|
+
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1", children: f.map((d) => /* @__PURE__ */ s(
|
|
365
388
|
"button",
|
|
366
389
|
{
|
|
367
390
|
type: "button",
|
|
368
391
|
onClick: (b) => {
|
|
369
|
-
b.stopPropagation(),
|
|
392
|
+
b.stopPropagation(), d.onClick(e);
|
|
370
393
|
},
|
|
371
394
|
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",
|
|
372
|
-
children:
|
|
395
|
+
children: d.label
|
|
373
396
|
},
|
|
374
|
-
|
|
397
|
+
d.label
|
|
375
398
|
)) })
|
|
376
399
|
}
|
|
377
400
|
)
|
|
378
401
|
]
|
|
379
402
|
},
|
|
380
|
-
|
|
403
|
+
r
|
|
381
404
|
);
|
|
382
405
|
};
|
|
383
|
-
let
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const e =
|
|
387
|
-
for (const l of
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
const b = a.get(
|
|
391
|
-
b.push(l), a.set(
|
|
406
|
+
let _e;
|
|
407
|
+
const B = [];
|
|
408
|
+
if (t != null && t.tree_group_by) {
|
|
409
|
+
const e = t.tree_group_by, r = $.filter((l) => !String(l[e] ?? "").trim()), a = /* @__PURE__ */ new Map();
|
|
410
|
+
for (const l of $) {
|
|
411
|
+
const d = String(l[e] ?? "").trim();
|
|
412
|
+
if (!d) continue;
|
|
413
|
+
const b = a.get(d) ?? [];
|
|
414
|
+
b.push(l), a.set(d, b);
|
|
392
415
|
}
|
|
393
|
-
const n = [...a.entries()].sort(([l], [
|
|
394
|
-
const b =
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
return Number.isFinite(
|
|
416
|
+
const n = [...a.entries()].sort(([l], [d]) => l.localeCompare(d)).map(([l, d]) => {
|
|
417
|
+
const b = t.tree_collapsed ? !g.has(l) : g.has(l);
|
|
418
|
+
B.push({ key: l, startsCollapsed: !!t.tree_collapsed });
|
|
419
|
+
const C = { [e]: l }, D = (i) => {
|
|
420
|
+
C[i] = d.reduce((k, be) => {
|
|
421
|
+
const G = Number(be[i]);
|
|
422
|
+
return Number.isFinite(G) ? k + G : k;
|
|
400
423
|
}, 0);
|
|
401
424
|
};
|
|
402
|
-
for (const
|
|
403
|
-
|
|
425
|
+
for (const i of x)
|
|
426
|
+
i.field && i.field !== e && D(i.field), i.stack && D(i.stack);
|
|
404
427
|
return /* @__PURE__ */ s(
|
|
405
|
-
|
|
428
|
+
Ve,
|
|
406
429
|
{
|
|
407
430
|
header: /* @__PURE__ */ p(
|
|
408
431
|
"tr",
|
|
409
432
|
{
|
|
410
433
|
className: "cursor-pointer border-b border-slate-200 bg-slate-100/80 dark:border-border dark:bg-muted",
|
|
411
|
-
onClick: () =>
|
|
412
|
-
const
|
|
413
|
-
return
|
|
434
|
+
onClick: () => R((i) => {
|
|
435
|
+
const k = new Set(i);
|
|
436
|
+
return k.has(l) ? k.delete(l) : k.add(l), k;
|
|
414
437
|
}),
|
|
415
438
|
children: [
|
|
416
|
-
|
|
439
|
+
x.map((i, k) => /* @__PURE__ */ s(
|
|
417
440
|
"td",
|
|
418
441
|
{
|
|
419
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${
|
|
420
|
-
style:
|
|
421
|
-
|
|
422
|
-
Number(
|
|
442
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${A(k)} text-[11.5px] font-semibold ${ke(i, "text-slate-600 dark:text-slate-300")} ${O(i) ? "text-right tabular-nums" : ""} ${oe(i)} ${N && k === 0 ? `sticky left-0 z-[1] ${ee} bg-slate-100 dark:bg-muted` : ""}`,
|
|
443
|
+
style: Y(
|
|
444
|
+
i,
|
|
445
|
+
Number(i.formula ? J(i.formula, C) : C[i.field ?? ""])
|
|
423
446
|
),
|
|
424
|
-
children:
|
|
447
|
+
children: k === 0 ? `${b ? "▸" : "▾"} ${l}` : i.formula ? W(J(i.formula, C), i.format) : i.field && i.field !== e && O(i) ? de(C, i) : ""
|
|
425
448
|
},
|
|
426
|
-
|
|
449
|
+
i.field ?? i.label ?? k
|
|
427
450
|
)),
|
|
428
|
-
|
|
451
|
+
f && /* @__PURE__ */ s("td", { className: $e("bg-slate-100 dark:bg-muted") })
|
|
429
452
|
]
|
|
430
453
|
}
|
|
431
454
|
),
|
|
432
455
|
children: !b && (() => {
|
|
433
|
-
const
|
|
434
|
-
if (!
|
|
435
|
-
return
|
|
436
|
-
var
|
|
437
|
-
let
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
440
|
-
|
|
456
|
+
const i = t.tree_sub_split;
|
|
457
|
+
if (!i)
|
|
458
|
+
return d.map((q, M) => {
|
|
459
|
+
var z;
|
|
460
|
+
let _;
|
|
461
|
+
if (t.tree_strip_section_prefix && ((z = x[0]) != null && z.field)) {
|
|
462
|
+
const U = String(q[x[0].field] ?? "");
|
|
463
|
+
U.startsWith(`${l} - `) && (_ = U.slice(l.length + 3));
|
|
441
464
|
}
|
|
442
|
-
return
|
|
465
|
+
return te(q, `${l}-${M}`, 1, _);
|
|
443
466
|
});
|
|
444
|
-
const
|
|
445
|
-
for (const
|
|
446
|
-
const
|
|
447
|
-
if (
|
|
448
|
-
|
|
467
|
+
const k = i.separator ?? " - ", be = [], G = /* @__PURE__ */ new Map();
|
|
468
|
+
for (const q of d) {
|
|
469
|
+
const M = String(q[i.field] ?? ""), _ = M.lastIndexOf(k);
|
|
470
|
+
if (_ <= 0) {
|
|
471
|
+
be.push(q);
|
|
449
472
|
continue;
|
|
450
473
|
}
|
|
451
|
-
const
|
|
452
|
-
|
|
474
|
+
const z = M.slice(0, _), U = G.get(z) ?? [];
|
|
475
|
+
U.push(q), G.set(z, U);
|
|
453
476
|
}
|
|
454
477
|
return [
|
|
455
|
-
...
|
|
456
|
-
...[...
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
key:
|
|
460
|
-
startsCollapsed:
|
|
478
|
+
...be.map((q, M) => te(q, `${l}-flat-${M}`, 1)),
|
|
479
|
+
...[...G.entries()].sort(([q], [M]) => q.localeCompare(M)).map(([q, M]) => {
|
|
480
|
+
const _ = `s:${l}|${q}`;
|
|
481
|
+
B.push({
|
|
482
|
+
key: _,
|
|
483
|
+
startsCollapsed: t.tree_sub_collapsed ?? !0
|
|
461
484
|
});
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
return Number.isFinite(
|
|
485
|
+
const z = t.tree_sub_collapsed ?? !0 ? !g.has(_) : g.has(_), U = {}, Be = (c) => {
|
|
486
|
+
U[c] = M.reduce((w, me) => {
|
|
487
|
+
const pe = Number(me[c]);
|
|
488
|
+
return Number.isFinite(pe) ? w + pe : w;
|
|
466
489
|
}, 0);
|
|
467
490
|
};
|
|
468
|
-
for (const c of
|
|
469
|
-
c.field && c.field !== e &&
|
|
491
|
+
for (const c of x)
|
|
492
|
+
c.field && c.field !== e && Be(c.field), c.stack && Be(c.stack);
|
|
470
493
|
return /* @__PURE__ */ s(
|
|
471
|
-
|
|
494
|
+
Ve,
|
|
472
495
|
{
|
|
473
496
|
header: /* @__PURE__ */ p(
|
|
474
497
|
"tr",
|
|
475
498
|
{
|
|
476
499
|
className: "cursor-pointer border-b border-slate-200/80 bg-slate-100/70 dark:border-border/60 dark:bg-muted/50",
|
|
477
|
-
onClick: () =>
|
|
478
|
-
const
|
|
479
|
-
return
|
|
500
|
+
onClick: () => R((c) => {
|
|
501
|
+
const w = new Set(c);
|
|
502
|
+
return w.has(_) ? w.delete(_) : w.add(_), w;
|
|
480
503
|
}),
|
|
481
504
|
children: [
|
|
482
|
-
|
|
505
|
+
x.map((c, w) => /* @__PURE__ */ s(
|
|
483
506
|
"td",
|
|
484
507
|
{
|
|
485
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${
|
|
486
|
-
style:
|
|
487
|
-
children:
|
|
508
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${A(w)} text-[11.5px] font-medium text-slate-600 dark:text-slate-300 ${O(c) ? "text-right tabular-nums" : ""} ${N && w === 0 ? `sticky left-0 z-[1] ${ee} bg-slate-100/80 dark:bg-muted` : ""}`,
|
|
509
|
+
style: w === 0 ? { paddingLeft: 18 } : void 0,
|
|
510
|
+
children: w === 0 ? `${z ? "▸" : "▾"} ${q}` : c.formula ? W(J(c.formula, U), c.format) : c.field && c.field !== e && O(c) ? de(U, c) : ""
|
|
488
511
|
},
|
|
489
|
-
c.field ?? c.label ??
|
|
512
|
+
c.field ?? c.label ?? w
|
|
490
513
|
)),
|
|
491
|
-
|
|
514
|
+
f && /* @__PURE__ */ s("td", { className: $e("bg-slate-100 dark:bg-muted") })
|
|
492
515
|
]
|
|
493
516
|
}
|
|
494
517
|
),
|
|
495
|
-
children: !
|
|
496
|
-
var
|
|
497
|
-
const
|
|
498
|
-
return
|
|
518
|
+
children: !z && M.map((c, w) => {
|
|
519
|
+
var Ge;
|
|
520
|
+
const me = String(c[i.field] ?? ""), pe = me.slice(me.lastIndexOf(k) + k.length), nt = ((Ge = x[0]) == null ? void 0 : Ge.field) === i.field ? pe : void 0;
|
|
521
|
+
return te(c, `${_}-${w}`, 2, nt);
|
|
499
522
|
})
|
|
500
523
|
},
|
|
501
|
-
|
|
524
|
+
_
|
|
502
525
|
);
|
|
503
526
|
})
|
|
504
527
|
];
|
|
@@ -507,149 +530,230 @@ function st({
|
|
|
507
530
|
l
|
|
508
531
|
);
|
|
509
532
|
});
|
|
510
|
-
|
|
533
|
+
_e = [...r.map((l, d) => te(l, `flat-${d}`)), ...n];
|
|
511
534
|
} else
|
|
512
|
-
|
|
513
|
-
const
|
|
535
|
+
_e = $.map((e, r) => te(e, String(r)));
|
|
536
|
+
const lt = (e) => e.startsCollapsed ? g.has(e.key) : !g.has(e.key), ue = B.length > 0 && B.every(lt), st = (e) => R(
|
|
514
537
|
new Set(
|
|
515
|
-
|
|
538
|
+
B.filter((r) => e ? r.startsCollapsed : !r.startsCollapsed).map((r) => r.key)
|
|
516
539
|
)
|
|
517
|
-
),
|
|
540
|
+
), Te = B.length > 0 ? /* @__PURE__ */ p(
|
|
518
541
|
"button",
|
|
519
542
|
{
|
|
520
543
|
type: "button",
|
|
521
|
-
"data-query-tree-toggle":
|
|
522
|
-
onClick: () =>
|
|
544
|
+
"data-query-tree-toggle": ue ? "collapse" : "expand",
|
|
545
|
+
onClick: () => st(!ue),
|
|
523
546
|
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
547
|
children: [
|
|
525
|
-
|
|
526
|
-
|
|
548
|
+
ue ? /* @__PURE__ */ s(mt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }) : /* @__PURE__ */ s(pt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
549
|
+
ue ? "Collapse all" : "Expand all"
|
|
527
550
|
]
|
|
528
551
|
}
|
|
529
|
-
) : null
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
552
|
+
) : null, ot = typeof (t == null ? void 0 : t.export_csv) == "object" && t.export_csv.filename ? t.export_csv.filename : "export.csv", De = t != null && t.search || t != null && t.export_csv || X.length > 0 ? /* @__PURE__ */ p("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
553
|
+
(t == null ? void 0 : t.search) && /* @__PURE__ */ p("label", { className: "relative inline-flex items-center", children: [
|
|
554
|
+
/* @__PURE__ */ s(
|
|
555
|
+
dt,
|
|
556
|
+
{
|
|
557
|
+
className: "pointer-events-none absolute left-2 h-3.5 w-3.5 text-slate-400",
|
|
558
|
+
"aria-hidden": !0
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ s(
|
|
562
|
+
"input",
|
|
563
|
+
{
|
|
564
|
+
type: "search",
|
|
565
|
+
value: S,
|
|
566
|
+
onChange: (e) => he(e.target.value),
|
|
567
|
+
placeholder: "Search rows",
|
|
568
|
+
"aria-label": "Search rows",
|
|
569
|
+
"data-qt-search": "",
|
|
570
|
+
className: "h-7 w-48 rounded-md border border-slate-200 bg-white pl-7 pr-2 text-[12px] text-slate-700 outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-200"
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] }),
|
|
574
|
+
X.length > 0 && /* @__PURE__ */ s(
|
|
575
|
+
"button",
|
|
576
|
+
{
|
|
577
|
+
type: "button",
|
|
578
|
+
"aria-pressed": L,
|
|
579
|
+
"data-qt-hide-empty": L ? "on" : "off",
|
|
580
|
+
onClick: () => Q((e) => !e),
|
|
581
|
+
className: `h-7 whitespace-nowrap rounded-md border px-2.5 text-[11.5px] font-medium transition-colors ${L ? "border-nvr-cyan bg-nvr-cyan text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted"}`,
|
|
582
|
+
children: ((We = t == null ? void 0 : t.hide_empty) == null ? void 0 : We.label) ?? "Hide empty rows"
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
(ne || L && X.length > 0) && /* @__PURE__ */ p(
|
|
586
|
+
"span",
|
|
587
|
+
{
|
|
588
|
+
className: "text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
589
|
+
"data-qt-shown": "",
|
|
590
|
+
children: [
|
|
591
|
+
$.length.toLocaleString("en-US"),
|
|
592
|
+
" of ",
|
|
593
|
+
o.length.toLocaleString("en-US"),
|
|
594
|
+
" rows"
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
(t == null ? void 0 : t.export_csv) && /* @__PURE__ */ p(
|
|
599
|
+
"button",
|
|
600
|
+
{
|
|
601
|
+
type: "button",
|
|
602
|
+
"data-qt-csv": "",
|
|
603
|
+
onClick: () => wt(
|
|
604
|
+
ot,
|
|
605
|
+
Nt(
|
|
606
|
+
x.filter((e) => fe(e) || !e.field),
|
|
607
|
+
$,
|
|
608
|
+
E,
|
|
609
|
+
(e) => e.label ?? ae(e.field ?? "")
|
|
610
|
+
)
|
|
611
|
+
),
|
|
612
|
+
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",
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ s(it, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
615
|
+
"CSV"
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
] }) : null;
|
|
620
|
+
return /* @__PURE__ */ p("div", { className: N ? "flex min-h-0 flex-1 flex-col" : void 0, children: [
|
|
621
|
+
De && /* @__PURE__ */ s("div", { className: "shrink-0 pb-2", children: De }),
|
|
622
|
+
(((Je = t == null ? void 0 : t.pivot) == null ? void 0 : Je.quarter_toggle) || (((Ke = t == null ? void 0 : t.toggles) == null ? void 0 : Ke.length) ?? 0) > 0 || Te) && /* @__PURE__ */ p("div", { className: "flex shrink-0 flex-wrap items-center justify-between gap-2 pb-2", children: [
|
|
623
|
+
(((je = t == null ? void 0 : t.toggles) == null ? void 0 : je.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: t.toggles.map((e) => {
|
|
624
|
+
const r = !T.has(e.label);
|
|
534
625
|
return /* @__PURE__ */ s(
|
|
535
626
|
"button",
|
|
536
627
|
{
|
|
537
628
|
type: "button",
|
|
538
|
-
"aria-pressed":
|
|
539
|
-
onClick: () =>
|
|
629
|
+
"aria-pressed": r,
|
|
630
|
+
onClick: () => V((a) => {
|
|
540
631
|
const n = new Set(a);
|
|
541
632
|
return n.has(e.label) ? n.delete(e.label) : n.add(e.label), n;
|
|
542
633
|
}),
|
|
543
|
-
className: `rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors ${
|
|
634
|
+
className: `whitespace-nowrap rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors ${r ? "bg-nvr-cyan text-white shadow-sm" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"}`,
|
|
544
635
|
children: e.label
|
|
545
636
|
},
|
|
546
637
|
e.label
|
|
547
638
|
);
|
|
548
639
|
}) }) : /* @__PURE__ */ s("span", {}),
|
|
549
|
-
/* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
|
|
550
|
-
|
|
551
|
-
((
|
|
640
|
+
/* @__PURE__ */ p("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
641
|
+
Te,
|
|
642
|
+
((Ae = t == null ? void 0 : t.pivot) == null ? void 0 : Ae.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
643
|
"button",
|
|
553
644
|
{
|
|
554
645
|
type: "button",
|
|
555
|
-
onClick: () =>
|
|
556
|
-
className: `rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${
|
|
646
|
+
onClick: () => ce(e),
|
|
647
|
+
className: `rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${H === 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
648
|
children: e === "month" ? "Monthly" : "Quarterly"
|
|
558
649
|
},
|
|
559
650
|
e
|
|
560
651
|
)) })
|
|
561
652
|
] })
|
|
562
653
|
] }),
|
|
563
|
-
/* @__PURE__ */ p("div", { className:
|
|
654
|
+
/* @__PURE__ */ p("div", { className: N ? "relative flex min-h-0 flex-1 flex-col" : "relative", children: [
|
|
564
655
|
/* @__PURE__ */ s(
|
|
565
656
|
"div",
|
|
566
657
|
{
|
|
567
|
-
ref:
|
|
568
|
-
className:
|
|
658
|
+
ref: Ye,
|
|
659
|
+
className: N ? "min-h-0 flex-1 overflow-auto" : "overflow-x-auto",
|
|
569
660
|
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:
|
|
661
|
+
/* @__PURE__ */ s("thead", { children: Oe ? /* @__PURE__ */ p(Pe, { children: [
|
|
571
662
|
/* @__PURE__ */ p("tr", { children: [
|
|
572
663
|
(() => {
|
|
573
664
|
const e = [];
|
|
574
|
-
let
|
|
575
|
-
for (;
|
|
576
|
-
const a =
|
|
665
|
+
let r = 0;
|
|
666
|
+
for (; r < x.length; ) {
|
|
667
|
+
const a = x[r];
|
|
577
668
|
if (!a.group) {
|
|
578
669
|
e.push(
|
|
579
670
|
/* @__PURE__ */ s(
|
|
580
671
|
"th",
|
|
581
672
|
{
|
|
582
673
|
rowSpan: 2,
|
|
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 ${
|
|
584
|
-
children: a.label ??
|
|
674
|
+
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 ${O(a) ? "text-right" : "text-left"} ${Me(r)}`,
|
|
675
|
+
children: a.label ?? ae(a.field ?? "")
|
|
585
676
|
},
|
|
586
|
-
`u-${a.field ??
|
|
677
|
+
`u-${a.field ?? r}`
|
|
587
678
|
)
|
|
588
|
-
),
|
|
679
|
+
), r++;
|
|
589
680
|
continue;
|
|
590
681
|
}
|
|
591
682
|
let n = 1;
|
|
592
|
-
for (;
|
|
683
|
+
for (; r + n < x.length && x[r + n].group === a.group; )
|
|
593
684
|
n++;
|
|
594
685
|
e.push(
|
|
595
686
|
/* @__PURE__ */ s(
|
|
596
687
|
"th",
|
|
597
688
|
{
|
|
598
689
|
colSpan: n,
|
|
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 ===
|
|
690
|
+
className: `whitespace-nowrap border-b border-slate-100 py-1 pr-3 text-center text-[11px] font-semibold dark:border-border/60 ${a.group === se ? "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)}`} ${N ? "sticky top-0 z-[2] bg-white dark:bg-card" : ""}`.trim(),
|
|
600
691
|
children: a.group
|
|
601
692
|
},
|
|
602
|
-
`g-${a.group}-${
|
|
693
|
+
`g-${a.group}-${r}`
|
|
603
694
|
)
|
|
604
|
-
),
|
|
695
|
+
), r += n;
|
|
605
696
|
}
|
|
606
697
|
return e;
|
|
607
698
|
})(),
|
|
608
|
-
|
|
699
|
+
f && /* @__PURE__ */ s(
|
|
609
700
|
"th",
|
|
610
701
|
{
|
|
611
702
|
rowSpan: 2,
|
|
612
703
|
"aria-label": "Actions",
|
|
613
704
|
"data-qt-actions-head": "",
|
|
614
|
-
className: `border-b border-slate-200 dark:border-border ${
|
|
705
|
+
className: `border-b border-slate-200 dark:border-border ${N ? `sticky right-0 top-0 z-[3] ${ie} bg-white dark:bg-card` : ""}`
|
|
615
706
|
}
|
|
616
707
|
)
|
|
617
708
|
] }),
|
|
618
|
-
/* @__PURE__ */ s("tr", { children:
|
|
619
|
-
(e,
|
|
709
|
+
/* @__PURE__ */ s("tr", { children: x.map(
|
|
710
|
+
(e, r) => e.group ? /* @__PURE__ */ s(
|
|
620
711
|
"th",
|
|
621
712
|
{
|
|
622
|
-
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${
|
|
623
|
-
children: e.label ??
|
|
713
|
+
className: `min-w-[58px] whitespace-nowrap border-b border-slate-200 py-1 pr-3 ${A(r)} text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400 ${O(e) ? "text-right" : "text-left"} ${oe(e) || we(r)} ${N ? "sticky top-[26px] z-[2] bg-white dark:bg-card" : ""}`,
|
|
714
|
+
children: e.label ?? ae(e.field ?? "")
|
|
624
715
|
},
|
|
625
|
-
e.field ?? e.label ??
|
|
716
|
+
e.field ?? e.label ?? r
|
|
626
717
|
) : null
|
|
627
718
|
) })
|
|
628
719
|
] }) : /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 dark:border-border", children: [
|
|
629
|
-
|
|
720
|
+
x.map((e, r) => /* @__PURE__ */ p(
|
|
630
721
|
"th",
|
|
631
722
|
{
|
|
632
|
-
className: `whitespace-nowrap border-b border-slate-200 py-1.5 pr-3 ${
|
|
723
|
+
className: `whitespace-nowrap border-b border-slate-200 py-1.5 pr-3 ${A(r)} text-[10.5px] font-semibold uppercase tracking-wider dark:border-border ${Ee(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]" : ""} ${O(e) ? "text-right" : "text-left"} ${Me(r)}`,
|
|
724
|
+
"aria-sort": ye && (u == null ? void 0 : u.key) === Z(e, r) ? u.dir === 1 ? "ascending" : "descending" : void 0,
|
|
633
725
|
children: [
|
|
634
|
-
|
|
635
|
-
|
|
726
|
+
ye ? /* @__PURE__ */ p(
|
|
727
|
+
"button",
|
|
728
|
+
{
|
|
729
|
+
type: "button",
|
|
730
|
+
"data-qt-sort": Z(e, r),
|
|
731
|
+
onClick: () => rt(Z(e, r)),
|
|
732
|
+
className: `inline-flex items-center gap-0.5 font-semibold uppercase tracking-wider hover:text-slate-800 dark:hover:text-slate-100 ${O(e) ? "flex-row-reverse" : ""}`,
|
|
733
|
+
children: [
|
|
734
|
+
e.label ?? ae(e.field ?? ""),
|
|
735
|
+
(u == null ? void 0 : u.key) === Z(e, r) && (u.dir === 1 ? /* @__PURE__ */ s(ut, { className: "h-3 w-3", "aria-hidden": !0 }) : /* @__PURE__ */ s(bt, { className: "h-3 w-3", "aria-hidden": !0 }))
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
) : e.label ?? ae(e.field ?? ""),
|
|
739
|
+
e.stack && (t == null ? void 0 : t.stack_legend) && /* @__PURE__ */ p(
|
|
636
740
|
"span",
|
|
637
741
|
{
|
|
638
742
|
className: "flex justify-end gap-1.5 text-[9px] font-medium normal-case tracking-normal",
|
|
639
|
-
style:
|
|
743
|
+
style: ve(e) ? { ...ve(e), ...Y(e) ?? {} } : Y(e),
|
|
640
744
|
children: [
|
|
641
|
-
|
|
745
|
+
fe(e) && /* @__PURE__ */ s(
|
|
642
746
|
"span",
|
|
643
747
|
{
|
|
644
748
|
className: e.color ? "text-[color:var(--qtc)] dark:text-[color:var(--qtcd)]" : "",
|
|
645
|
-
children:
|
|
749
|
+
children: t.stack_legend[0]
|
|
646
750
|
}
|
|
647
751
|
),
|
|
648
|
-
|
|
752
|
+
Le(e) && /* @__PURE__ */ s(
|
|
649
753
|
"span",
|
|
650
754
|
{
|
|
651
755
|
className: e.stack_color ? "text-[color:var(--qts)] dark:text-[color:var(--qtsd)]" : "",
|
|
652
|
-
children:
|
|
756
|
+
children: t.stack_legend[1]
|
|
653
757
|
}
|
|
654
758
|
)
|
|
655
759
|
]
|
|
@@ -657,38 +761,38 @@ function st({
|
|
|
657
761
|
)
|
|
658
762
|
]
|
|
659
763
|
},
|
|
660
|
-
e.field ?? e.label ??
|
|
764
|
+
e.field ?? e.label ?? r
|
|
661
765
|
)),
|
|
662
|
-
|
|
766
|
+
f && /* @__PURE__ */ s(
|
|
663
767
|
"th",
|
|
664
768
|
{
|
|
665
769
|
"aria-label": "Actions",
|
|
666
770
|
"data-qt-actions-head": "",
|
|
667
|
-
className:
|
|
771
|
+
className: N ? `sticky right-0 top-0 z-[3] ${ie} bg-white dark:bg-card` : void 0
|
|
668
772
|
}
|
|
669
773
|
)
|
|
670
774
|
] }) }),
|
|
671
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
672
|
-
|
|
673
|
-
|
|
775
|
+
/* @__PURE__ */ s("tbody", { children: _e }),
|
|
776
|
+
j && /* @__PURE__ */ s("tfoot", { children: /* @__PURE__ */ p("tr", { className: "border-t border-slate-300 font-semibold dark:border-border", children: [
|
|
777
|
+
x.map((e, r) => /* @__PURE__ */ s(
|
|
674
778
|
"td",
|
|
675
779
|
{
|
|
676
|
-
className: `whitespace-nowrap py-1.5 pr-3 ${
|
|
677
|
-
style:
|
|
780
|
+
className: `whitespace-nowrap py-1.5 pr-3 ${A(r)} ${ke(e, "")} ${O(e) ? "text-right tabular-nums" : ""} ${oe(e)} ${N ? `sticky bottom-0 border-t border-slate-300 dark:border-border ${r === 0 ? `left-0 z-[3] ${ee} bg-slate-50 dark:bg-muted` : "z-[2] bg-white dark:bg-card"}` : ""}`,
|
|
781
|
+
style: Y(
|
|
678
782
|
e,
|
|
679
783
|
Number(
|
|
680
|
-
e.formula ?
|
|
784
|
+
e.formula ? J(e.formula, j) : j[e.field ?? ""]
|
|
681
785
|
)
|
|
682
786
|
),
|
|
683
|
-
children:
|
|
787
|
+
children: r === 0 && !e.sum && !e.formula ? "Total" : e.sum || e.formula ? e.formula ? W(J(e.formula, j), e.format) : de(j, e) : ""
|
|
684
788
|
},
|
|
685
|
-
e.field ?? e.label ??
|
|
789
|
+
e.field ?? e.label ?? r
|
|
686
790
|
)),
|
|
687
|
-
|
|
791
|
+
f && /* @__PURE__ */ s(
|
|
688
792
|
"td",
|
|
689
793
|
{
|
|
690
|
-
className: `py-1.5 pr-3 text-right ${
|
|
691
|
-
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1.5", children:
|
|
794
|
+
className: `py-1.5 pr-3 text-right ${N ? `sticky bottom-0 right-0 z-[3] border-t border-slate-300 ${ie} bg-white dark:border-border dark:bg-card` : ""}`,
|
|
795
|
+
children: /* @__PURE__ */ s("span", { className: "inline-flex flex-nowrap gap-1.5", children: f.map((e) => /* @__PURE__ */ s(
|
|
692
796
|
"button",
|
|
693
797
|
{
|
|
694
798
|
type: "button",
|
|
@@ -704,7 +808,7 @@ function st({
|
|
|
704
808
|
] })
|
|
705
809
|
}
|
|
706
810
|
),
|
|
707
|
-
|
|
811
|
+
le.canScrollRight && // More columns to the right: fade the edge so readers know the
|
|
708
812
|
// table scrolls sideways (the native scrollbar is often invisible).
|
|
709
813
|
/* @__PURE__ */ s(
|
|
710
814
|
"div",
|
|
@@ -712,22 +816,47 @@ function st({
|
|
|
712
816
|
"aria-hidden": !0,
|
|
713
817
|
"data-qt-scroll-cue": "",
|
|
714
818
|
className: "pointer-events-none absolute top-0 w-10 bg-gradient-to-r from-transparent to-white dark:to-card",
|
|
715
|
-
style: { right:
|
|
819
|
+
style: { right: le.cueInset.right, bottom: le.cueInset.bottom }
|
|
716
820
|
}
|
|
717
821
|
)
|
|
718
822
|
] })
|
|
719
823
|
] });
|
|
720
824
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
825
|
+
function gt(o, t, m = 1) {
|
|
826
|
+
const h = (y) => y == null || y === "";
|
|
827
|
+
if (h(o) && h(t)) return 0;
|
|
828
|
+
if (h(o)) return 1;
|
|
829
|
+
if (h(t)) return -1;
|
|
830
|
+
const f = typeof o == "number" ? o : Number(o), F = typeof t == "number" ? t : Number(t);
|
|
831
|
+
return Number.isFinite(f) && Number.isFinite(F) ? (f - F) * m : String(o).localeCompare(String(t), void 0, { numeric: !0, sensitivity: "base" }) * m;
|
|
832
|
+
}
|
|
833
|
+
function Nt(o, t, m, h) {
|
|
834
|
+
const f = (y) => {
|
|
835
|
+
if (y == null) return "";
|
|
836
|
+
const g = typeof y == "object" ? JSON.stringify(y) : String(y), R = /^[=+\-@]/.test(g) && !/^-?\d/.test(g) ? `'${g}` : g;
|
|
837
|
+
return /[",\r\n]/.test(R) ? `"${R.replace(/"/g, '""')}"` : R;
|
|
838
|
+
}, F = [o.map((y) => f(h(y))).join(",")];
|
|
839
|
+
for (const y of t) F.push(o.map((g) => f(m(y, g))).join(","));
|
|
840
|
+
return `${F.join(`\r
|
|
841
|
+
`)}\r
|
|
842
|
+
`;
|
|
843
|
+
}
|
|
844
|
+
function wt(o, t) {
|
|
845
|
+
const m = URL.createObjectURL(new Blob([`\uFEFF${t}`], { type: "text/csv;charset=utf-8" })), h = document.createElement("a");
|
|
846
|
+
h.href = m, h.download = o, document.body.appendChild(h), h.click(), h.remove(), setTimeout(() => URL.revokeObjectURL(m), 0);
|
|
847
|
+
}
|
|
848
|
+
function Ve({ header: o, children: t }) {
|
|
849
|
+
return /* @__PURE__ */ p(Pe, { children: [
|
|
850
|
+
o,
|
|
851
|
+
t
|
|
725
852
|
] });
|
|
726
853
|
}
|
|
727
854
|
export {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
855
|
+
Se as COLOR_ROLES,
|
|
856
|
+
qt as QueryTable,
|
|
857
|
+
Ce as colorPair,
|
|
858
|
+
ft as darkVariant,
|
|
859
|
+
yt as pivotQueryRows,
|
|
860
|
+
Nt as queryTableCsv,
|
|
861
|
+
gt as sortCompare
|
|
733
862
|
};
|