@object-ui/plugin-report 4.0.1 → 4.0.4
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/CHANGELOG.md +39 -0
- package/dist/index.js +461 -477
- package/dist/index.umd.cjs +18 -18
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2,68 +2,52 @@ import { ComponentRegistry as e } from "@object-ui/core";
|
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import n, { useState as r } from "react";
|
|
4
4
|
import { Badge as i, Button as a, Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u, Checkbox as d, ConfigPanelRenderer as f, Input as p, Label as m, Skeleton as h, Tabs as g, TabsContent as _, TabsList as v, TabsTrigger as y, useConfigDraft as b } from "@object-ui/components";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function r(e, n, r) {
|
|
11
|
-
var i = null;
|
|
12
|
-
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
13
|
-
else r = n;
|
|
14
|
-
return n = r.ref, {
|
|
15
|
-
$$typeof: t,
|
|
16
|
-
type: e,
|
|
17
|
-
key: i,
|
|
18
|
-
ref: n === void 0 ? null : n,
|
|
19
|
-
props: r
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
23
|
-
})), F = (/* @__PURE__ */ N(((e, t) => {
|
|
24
|
-
t.exports = P();
|
|
25
|
-
})))(), I = ({ schema: t }) => {
|
|
5
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
6
|
+
import { SchemaRenderer as w } from "@object-ui/react";
|
|
7
|
+
import { Calendar as T, Clock as E, Download as D, Filter as ee, Layers as O, Mail as k, Plus as A, Printer as j, RefreshCw as M, Save as N, Settings as te, Trash2 as P } from "lucide-react";
|
|
8
|
+
//#region src/ReportRenderer.tsx
|
|
9
|
+
var F = ({ schema: t }) => {
|
|
26
10
|
let { title: n, description: r, data: i, columns: a } = t;
|
|
27
11
|
t.chart?.type;
|
|
28
12
|
let d = !!t.chart;
|
|
29
|
-
return /* @__PURE__ */ (
|
|
13
|
+
return /* @__PURE__ */ C(o, {
|
|
30
14
|
className: `h-full flex flex-col ${t.className || ""}`,
|
|
31
|
-
children: [/* @__PURE__ */ (
|
|
15
|
+
children: [/* @__PURE__ */ C(l, { children: [n && /* @__PURE__ */ S(u, { children: n }), r && /* @__PURE__ */ S(c, { children: r })] }), /* @__PURE__ */ C(s, {
|
|
32
16
|
className: "flex-1 overflow-auto space-y-4",
|
|
33
17
|
children: [d && (() => {
|
|
34
18
|
let n = t.chart?.type, r = n ? e.get(n) : null;
|
|
35
|
-
return r ||= e.get("chart"), r ? /* @__PURE__ */ (
|
|
19
|
+
return r ||= e.get("chart"), r ? /* @__PURE__ */ S("div", {
|
|
36
20
|
className: "min-h-[300px] border rounded-lg p-4 bg-background/50",
|
|
37
|
-
children: /* @__PURE__ */ (
|
|
21
|
+
children: /* @__PURE__ */ S(r, { schema: {
|
|
38
22
|
...t.chart,
|
|
39
23
|
data: t.chart.data || i
|
|
40
24
|
} })
|
|
41
|
-
}) : /* @__PURE__ */ (
|
|
25
|
+
}) : /* @__PURE__ */ C("div", {
|
|
42
26
|
className: "min-h-[100px] border rounded-md p-4 bg-muted/20 text-muted-foreground flex items-center justify-center",
|
|
43
27
|
children: ["Unknown component type: ", n || "chart"]
|
|
44
28
|
});
|
|
45
|
-
})(), i && i.length > 0 && /* @__PURE__ */ (
|
|
29
|
+
})(), i && i.length > 0 && /* @__PURE__ */ S("div", {
|
|
46
30
|
className: "border rounded-lg",
|
|
47
31
|
children: (() => {
|
|
48
32
|
let t = e.get("aggrid") || e.get("table");
|
|
49
|
-
return t ? /* @__PURE__ */ (
|
|
33
|
+
return t ? /* @__PURE__ */ S(t, { schema: {
|
|
50
34
|
type: "aggrid",
|
|
51
35
|
rowData: i,
|
|
52
36
|
columnDefs: a,
|
|
53
37
|
domLayout: "autoHeight"
|
|
54
|
-
} }) : /* @__PURE__ */ (
|
|
38
|
+
} }) : /* @__PURE__ */ S("div", {
|
|
55
39
|
className: "overflow-x-auto",
|
|
56
|
-
children: /* @__PURE__ */ (
|
|
40
|
+
children: /* @__PURE__ */ C("table", {
|
|
57
41
|
className: "w-full text-sm text-left",
|
|
58
|
-
children: [/* @__PURE__ */ (
|
|
42
|
+
children: [/* @__PURE__ */ S("thead", {
|
|
59
43
|
className: "text-xs uppercase bg-muted",
|
|
60
|
-
children: /* @__PURE__ */ (
|
|
44
|
+
children: /* @__PURE__ */ S("tr", { children: a?.map((e) => /* @__PURE__ */ S("th", {
|
|
61
45
|
className: "px-6 py-3",
|
|
62
46
|
children: e.headerName || e.label || e.field
|
|
63
47
|
}, e.field)) })
|
|
64
|
-
}), /* @__PURE__ */ (
|
|
48
|
+
}), /* @__PURE__ */ S("tbody", { children: i.map((e, t) => /* @__PURE__ */ S("tr", {
|
|
65
49
|
className: "bg-background border-b",
|
|
66
|
-
children: a?.map((t) => /* @__PURE__ */ (
|
|
50
|
+
children: a?.map((t) => /* @__PURE__ */ S("td", {
|
|
67
51
|
className: "px-6 py-4",
|
|
68
52
|
children: e[t.field]
|
|
69
53
|
}, t.field))
|
|
@@ -77,29 +61,29 @@ var N = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
77
61
|
};
|
|
78
62
|
//#endregion
|
|
79
63
|
//#region src/ReportExportEngine.ts
|
|
80
|
-
function
|
|
64
|
+
function I(e, t, n) {
|
|
81
65
|
let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
|
|
82
66
|
let n = e[t.name];
|
|
83
|
-
return n =
|
|
67
|
+
return n = U(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
|
|
84
68
|
}));
|
|
85
|
-
|
|
69
|
+
K([...n?.includeHeaders === !1 ? [] : [i.join(",")], ...a.map((e) => e.join(","))].join("\n"), n?.filename || `${e.title || "report"}.csv`, "text/csv");
|
|
86
70
|
}
|
|
87
|
-
function
|
|
71
|
+
function L(e, t, n) {
|
|
88
72
|
let r = {
|
|
89
73
|
title: e.title,
|
|
90
74
|
description: e.description,
|
|
91
75
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
92
76
|
data: t
|
|
93
77
|
};
|
|
94
|
-
|
|
78
|
+
K(JSON.stringify(r, null, 2), n?.filename || `${e.title || "report"}.json`, "application/json");
|
|
95
79
|
}
|
|
96
|
-
function
|
|
97
|
-
let r = e.fields || [], i =
|
|
98
|
-
|
|
80
|
+
function R(e, t, n) {
|
|
81
|
+
let r = e.fields || [], i = G(n?.orientation), a = W(n?.pageSize);
|
|
82
|
+
K(`<!DOCTYPE html>
|
|
99
83
|
<html>
|
|
100
84
|
<head>
|
|
101
85
|
<meta charset="utf-8">
|
|
102
|
-
<title>${
|
|
86
|
+
<title>${H(e.title || "Report")}</title>
|
|
103
87
|
<style>
|
|
104
88
|
@page { size: ${a} ${i}; margin: 20mm; }
|
|
105
89
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #333; }
|
|
@@ -113,20 +97,20 @@ function z(e, t, n) {
|
|
|
113
97
|
</style>
|
|
114
98
|
</head>
|
|
115
99
|
<body>
|
|
116
|
-
<h1>${
|
|
117
|
-
${e.description ? `<p class="description">${
|
|
100
|
+
<h1>${H(e.title || "Report")}</h1>
|
|
101
|
+
${e.description ? `<p class="description">${H(e.description)}</p>` : ""}
|
|
118
102
|
<p class="meta">Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}</p>
|
|
119
103
|
<table>
|
|
120
|
-
<thead><tr>${r.map((e) => `<th>${
|
|
121
|
-
<tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${
|
|
104
|
+
<thead><tr>${r.map((e) => `<th>${H(e.label || e.name)}</th>`).join("")}</tr></thead>
|
|
105
|
+
<tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${H(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
|
|
122
106
|
</table>
|
|
123
107
|
</body>
|
|
124
108
|
</html>`, n?.filename || `${e.title || "report"}.html`, "text/html");
|
|
125
109
|
}
|
|
126
|
-
function
|
|
127
|
-
let r = e.fields || [], i =
|
|
110
|
+
function z(e, t, n) {
|
|
111
|
+
let r = e.fields || [], i = G(n?.orientation), a = W(n?.pageSize), o = window.open("", "_blank");
|
|
128
112
|
if (!o) {
|
|
129
|
-
|
|
113
|
+
R(e, t, {
|
|
130
114
|
...n,
|
|
131
115
|
format: "html",
|
|
132
116
|
filename: n?.filename?.replace(/\.pdf$/, ".html") || `${e.title || "report"}.html`
|
|
@@ -137,7 +121,7 @@ function B(e, t, n) {
|
|
|
137
121
|
<html>
|
|
138
122
|
<head>
|
|
139
123
|
<meta charset="utf-8">
|
|
140
|
-
<title>${
|
|
124
|
+
<title>${H(e.title || "Report")}</title>
|
|
141
125
|
<style>
|
|
142
126
|
@page { size: ${a} ${i}; margin: 20mm; }
|
|
143
127
|
@media print { .no-print { display: none; } }
|
|
@@ -152,56 +136,56 @@ function B(e, t, n) {
|
|
|
152
136
|
</style>
|
|
153
137
|
</head>
|
|
154
138
|
<body>
|
|
155
|
-
<h1>${
|
|
156
|
-
${e.description ? `<p class="description">${
|
|
139
|
+
<h1>${H(e.title || "Report")}</h1>
|
|
140
|
+
${e.description ? `<p class="description">${H(e.description)}</p>` : ""}
|
|
157
141
|
<p class="meta">Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}</p>
|
|
158
142
|
<table>
|
|
159
|
-
<thead><tr>${r.map((e) => `<th>${
|
|
160
|
-
<tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${
|
|
143
|
+
<thead><tr>${r.map((e) => `<th>${H(e.label || e.name)}</th>`).join("")}</tr></thead>
|
|
144
|
+
<tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${H(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
|
|
161
145
|
</table>
|
|
162
146
|
</body>
|
|
163
147
|
</html>`), o.document.close(), o.onload = () => {
|
|
164
148
|
o.print();
|
|
165
149
|
};
|
|
166
150
|
}
|
|
167
|
-
function
|
|
151
|
+
function B(e, t, n) {
|
|
168
152
|
let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
|
|
169
153
|
let n = e[t.name];
|
|
170
|
-
return n =
|
|
154
|
+
return n = U(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n") || n.includes(" ")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
|
|
171
155
|
}));
|
|
172
|
-
|
|
156
|
+
K("" + [...n?.includeHeaders === !1 ? [] : [i.join(" ")], ...a.map((e) => e.join(" "))].join("\n"), n?.filename || `${e.title || "report"}.tsv`, "text/tab-separated-values");
|
|
173
157
|
}
|
|
174
|
-
function
|
|
158
|
+
function V(e, t, n, r) {
|
|
175
159
|
switch (e) {
|
|
176
160
|
case "csv":
|
|
177
|
-
|
|
161
|
+
I(t, n, r);
|
|
178
162
|
break;
|
|
179
163
|
case "json":
|
|
180
|
-
|
|
164
|
+
L(t, n, r);
|
|
181
165
|
break;
|
|
182
166
|
case "html":
|
|
183
|
-
|
|
167
|
+
R(t, n, r);
|
|
184
168
|
break;
|
|
185
169
|
case "pdf":
|
|
186
|
-
|
|
170
|
+
z(t, n, r);
|
|
187
171
|
break;
|
|
188
172
|
case "excel":
|
|
189
|
-
|
|
173
|
+
B(t, n, r);
|
|
190
174
|
break;
|
|
191
175
|
default: console.warn(`Unsupported export format: ${e}`);
|
|
192
176
|
}
|
|
193
177
|
}
|
|
194
|
-
function
|
|
178
|
+
function H(e) {
|
|
195
179
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
196
180
|
}
|
|
197
|
-
function
|
|
181
|
+
function U(e) {
|
|
198
182
|
if (typeof e == "string" && e.length > 0) {
|
|
199
183
|
let t = e.charAt(0);
|
|
200
184
|
if (t === "=" || t === "+" || t === "-" || t === "@" || t === "|") return `\t${e}`;
|
|
201
185
|
}
|
|
202
186
|
return e;
|
|
203
187
|
}
|
|
204
|
-
function
|
|
188
|
+
function W(e) {
|
|
205
189
|
return [
|
|
206
190
|
"A4",
|
|
207
191
|
"A3",
|
|
@@ -209,19 +193,19 @@ function G(e) {
|
|
|
209
193
|
"Legal"
|
|
210
194
|
].includes(e || "") ? e : "A4";
|
|
211
195
|
}
|
|
212
|
-
function
|
|
196
|
+
function G(e) {
|
|
213
197
|
return e === "landscape" ? "landscape" : "portrait";
|
|
214
198
|
}
|
|
215
|
-
function
|
|
199
|
+
function K(e, t, n) {
|
|
216
200
|
let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
217
201
|
a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
218
202
|
}
|
|
219
203
|
//#endregion
|
|
220
204
|
//#region src/formatValue.ts
|
|
221
|
-
function
|
|
205
|
+
function q(e, t) {
|
|
222
206
|
if (e == null || e === "") return "";
|
|
223
207
|
let n = t?.type, r = t?.format;
|
|
224
|
-
if (n === "date" || r === "date" ||
|
|
208
|
+
if (n === "date" || r === "date" || J(e)) return Y(e);
|
|
225
209
|
if (n === "number" || typeof e == "number") {
|
|
226
210
|
let t = typeof e == "number" ? e : Number(e);
|
|
227
211
|
return isNaN(t) ? String(e) : r === "currency" || r === "currency_cny" ? `¥${t.toLocaleString("en-US", {
|
|
@@ -237,10 +221,10 @@ function J(e, t) {
|
|
|
237
221
|
}
|
|
238
222
|
return String(e);
|
|
239
223
|
}
|
|
240
|
-
function
|
|
224
|
+
function J(e) {
|
|
241
225
|
return typeof e == "string" ? /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/.test(e) : !1;
|
|
242
226
|
}
|
|
243
|
-
function
|
|
227
|
+
function Y(e) {
|
|
244
228
|
try {
|
|
245
229
|
let t = new Date(e);
|
|
246
230
|
return isNaN(t.getTime()) ? String(e) : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
|
|
@@ -250,7 +234,7 @@ function ne(e) {
|
|
|
250
234
|
}
|
|
251
235
|
//#endregion
|
|
252
236
|
//#region src/ReportViewer.tsx
|
|
253
|
-
function
|
|
237
|
+
function ne(e, t) {
|
|
254
238
|
if (!t || t.length === 0 || !e || e.length === 0) return null;
|
|
255
239
|
let n = t[0], r = n.field, i = /* @__PURE__ */ new Map();
|
|
256
240
|
for (let t of e) {
|
|
@@ -266,18 +250,18 @@ function re(e, t) {
|
|
|
266
250
|
let o = n.sort === "desc" ? -1 : 1;
|
|
267
251
|
return a.sort((e, t) => e.key.localeCompare(t.key) * o), a;
|
|
268
252
|
}
|
|
269
|
-
var
|
|
253
|
+
var X = ({ schema: t, onRefresh: r }) => {
|
|
270
254
|
let { report: d, data: f, showToolbar: p = !0, allowExport: m = !0, allowPrint: g = !0, loading: _ = !1 } = t, v = (e) => {
|
|
271
255
|
if (!d) {
|
|
272
256
|
console.warn("ReportViewer: Cannot export, no report defined");
|
|
273
257
|
return;
|
|
274
258
|
}
|
|
275
|
-
|
|
259
|
+
V(e, d, f || [], d.exportConfigs?.[e]);
|
|
276
260
|
}, y = () => {
|
|
277
261
|
window.print();
|
|
278
262
|
}, b = () => {
|
|
279
263
|
r?.();
|
|
280
|
-
},
|
|
264
|
+
}, x = (e, t) => {
|
|
281
265
|
if (!f) return 0;
|
|
282
266
|
let n = f.map((t) => Number(t[e]) || 0);
|
|
283
267
|
switch (t) {
|
|
@@ -288,7 +272,7 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
288
272
|
case "max": return n.length > 0 ? Math.max(...n) : 0;
|
|
289
273
|
default: return "";
|
|
290
274
|
}
|
|
291
|
-
},
|
|
275
|
+
}, T = (e, t) => {
|
|
292
276
|
let n = d?.conditionalFormatting;
|
|
293
277
|
if (!(!n || !Array.isArray(n))) for (let r of n) {
|
|
294
278
|
if (r.field !== e) continue;
|
|
@@ -315,111 +299,111 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
315
299
|
return r.backgroundColor && (e.backgroundColor = r.backgroundColor), r.textColor && (e.color = r.textColor), e;
|
|
316
300
|
}
|
|
317
301
|
}
|
|
318
|
-
},
|
|
302
|
+
}, E = (e, t) => e == null || e === "" ? "" : t.renderAs === "badge" ? /* @__PURE__ */ S(i, {
|
|
319
303
|
className: t.colorMap?.[String(e)] || "",
|
|
320
304
|
children: String(e)
|
|
321
|
-
}) :
|
|
322
|
-
return d ? /* @__PURE__ */ (
|
|
305
|
+
}) : q(e, t);
|
|
306
|
+
return d ? /* @__PURE__ */ C("div", {
|
|
323
307
|
className: "space-y-4",
|
|
324
|
-
children: [p && /* @__PURE__ */ (
|
|
308
|
+
children: [p && /* @__PURE__ */ C("div", {
|
|
325
309
|
className: "flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",
|
|
326
|
-
children: [/* @__PURE__ */ (
|
|
310
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
|
|
327
311
|
className: "text-lg font-semibold",
|
|
328
312
|
children: d.title
|
|
329
|
-
}), d.description && /* @__PURE__ */ (
|
|
313
|
+
}), d.description && /* @__PURE__ */ S("p", {
|
|
330
314
|
className: "text-sm text-muted-foreground",
|
|
331
315
|
children: d.description
|
|
332
|
-
})] }), /* @__PURE__ */ (
|
|
316
|
+
})] }), /* @__PURE__ */ C("div", {
|
|
333
317
|
className: "flex items-center gap-2",
|
|
334
318
|
children: [
|
|
335
|
-
d.refreshInterval && /* @__PURE__ */ (
|
|
319
|
+
d.refreshInterval && /* @__PURE__ */ C(a, {
|
|
336
320
|
variant: "outline",
|
|
337
321
|
size: "sm",
|
|
338
322
|
onClick: b,
|
|
339
|
-
children: [/* @__PURE__ */ (
|
|
323
|
+
children: [/* @__PURE__ */ S(M, { className: "h-4 w-4 mr-2" }), "Refresh"]
|
|
340
324
|
}),
|
|
341
|
-
g && /* @__PURE__ */ (
|
|
325
|
+
g && /* @__PURE__ */ C(a, {
|
|
342
326
|
variant: "outline",
|
|
343
327
|
size: "sm",
|
|
344
328
|
onClick: y,
|
|
345
|
-
children: [/* @__PURE__ */ (
|
|
329
|
+
children: [/* @__PURE__ */ S(j, { className: "h-4 w-4 mr-2" }), "Print"]
|
|
346
330
|
}),
|
|
347
|
-
m && d.showExportButtons && /* @__PURE__ */ (
|
|
331
|
+
m && d.showExportButtons && /* @__PURE__ */ C("div", {
|
|
348
332
|
className: "flex items-center gap-1",
|
|
349
333
|
children: [
|
|
350
|
-
/* @__PURE__ */ (
|
|
334
|
+
/* @__PURE__ */ C(a, {
|
|
351
335
|
variant: "outline",
|
|
352
336
|
size: "sm",
|
|
353
337
|
onClick: () => v("pdf"),
|
|
354
|
-
children: [/* @__PURE__ */ (
|
|
338
|
+
children: [/* @__PURE__ */ S(D, { className: "h-4 w-4 mr-2" }), "PDF"]
|
|
355
339
|
}),
|
|
356
|
-
/* @__PURE__ */ (
|
|
340
|
+
/* @__PURE__ */ C(a, {
|
|
357
341
|
variant: "outline",
|
|
358
342
|
size: "sm",
|
|
359
343
|
onClick: () => v("excel"),
|
|
360
|
-
children: [/* @__PURE__ */ (
|
|
344
|
+
children: [/* @__PURE__ */ S(D, { className: "h-4 w-4 mr-2" }), "Excel"]
|
|
361
345
|
}),
|
|
362
|
-
/* @__PURE__ */ (
|
|
346
|
+
/* @__PURE__ */ C(a, {
|
|
363
347
|
variant: "outline",
|
|
364
348
|
size: "sm",
|
|
365
349
|
onClick: () => v("csv"),
|
|
366
|
-
children: [/* @__PURE__ */ (
|
|
350
|
+
children: [/* @__PURE__ */ S(D, { className: "h-4 w-4 mr-2" }), "CSV"]
|
|
367
351
|
})
|
|
368
352
|
]
|
|
369
353
|
})
|
|
370
354
|
]
|
|
371
355
|
})]
|
|
372
|
-
}), /* @__PURE__ */ (
|
|
356
|
+
}), /* @__PURE__ */ C(o, { children: [/* @__PURE__ */ C(l, { children: [!p && d.title && /* @__PURE__ */ S(u, { children: d.title }), !p && d.description && /* @__PURE__ */ S(c, { children: d.description })] }), /* @__PURE__ */ C(s, {
|
|
373
357
|
className: "space-y-6",
|
|
374
358
|
children: [
|
|
375
|
-
_ && /* @__PURE__ */ (
|
|
359
|
+
_ && /* @__PURE__ */ C("div", {
|
|
376
360
|
className: "space-y-6",
|
|
377
|
-
children: [/* @__PURE__ */ (
|
|
361
|
+
children: [/* @__PURE__ */ S("div", {
|
|
378
362
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
379
363
|
children: [
|
|
380
364
|
1,
|
|
381
365
|
2,
|
|
382
366
|
3
|
|
383
|
-
].map((e) => /* @__PURE__ */ (
|
|
367
|
+
].map((e) => /* @__PURE__ */ S(o, { children: /* @__PURE__ */ C(s, {
|
|
384
368
|
className: "p-4 space-y-2",
|
|
385
|
-
children: [/* @__PURE__ */ (
|
|
369
|
+
children: [/* @__PURE__ */ S(h, { className: "h-4 w-20" }), /* @__PURE__ */ S(h, { className: "h-8 w-28" })]
|
|
386
370
|
}) }, e))
|
|
387
|
-
}), /* @__PURE__ */ (
|
|
371
|
+
}), /* @__PURE__ */ C("div", {
|
|
388
372
|
className: "space-y-2",
|
|
389
|
-
children: [/* @__PURE__ */ (
|
|
373
|
+
children: [/* @__PURE__ */ S(h, { className: "h-10 w-full" }), [
|
|
390
374
|
1,
|
|
391
375
|
2,
|
|
392
376
|
3,
|
|
393
377
|
4,
|
|
394
378
|
5
|
|
395
|
-
].map((e) => /* @__PURE__ */ (
|
|
379
|
+
].map((e) => /* @__PURE__ */ S(h, { className: "h-8 w-full" }, e))]
|
|
396
380
|
})]
|
|
397
381
|
}),
|
|
398
|
-
!_ && d.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ (
|
|
382
|
+
!_ && d.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ C("div", {
|
|
399
383
|
className: "space-y-2",
|
|
400
384
|
children: [
|
|
401
|
-
t.title && t.type !== "header" && /* @__PURE__ */ (
|
|
385
|
+
t.title && t.type !== "header" && /* @__PURE__ */ S("h3", {
|
|
402
386
|
className: "text-lg font-semibold border-b pb-2",
|
|
403
387
|
children: t.title
|
|
404
388
|
}),
|
|
405
|
-
t.type === "header" && t.title && /* @__PURE__ */ (
|
|
389
|
+
t.type === "header" && t.title && /* @__PURE__ */ S("div", {
|
|
406
390
|
className: "text-2xl font-bold py-4",
|
|
407
391
|
children: t.title
|
|
408
392
|
}),
|
|
409
|
-
t.type === "summary" && /* @__PURE__ */ (
|
|
393
|
+
t.type === "summary" && /* @__PURE__ */ S("div", {
|
|
410
394
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
411
|
-
children: d.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ (
|
|
395
|
+
children: d.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ S(o, { children: /* @__PURE__ */ C(s, {
|
|
412
396
|
className: "p-4",
|
|
413
|
-
children: [/* @__PURE__ */ (
|
|
397
|
+
children: [/* @__PURE__ */ S("div", {
|
|
414
398
|
className: "text-sm text-muted-foreground",
|
|
415
399
|
children: e.label || e.name
|
|
416
|
-
}), /* @__PURE__ */ (
|
|
400
|
+
}), /* @__PURE__ */ S("div", {
|
|
417
401
|
className: "text-2xl font-bold",
|
|
418
|
-
children:
|
|
402
|
+
children: q(x(e.name, e.aggregation), e)
|
|
419
403
|
})]
|
|
420
404
|
}) }, t))
|
|
421
405
|
}),
|
|
422
|
-
t.type === "chart" && t.chart && /* @__PURE__ */ (
|
|
406
|
+
t.type === "chart" && t.chart && /* @__PURE__ */ S("div", {
|
|
423
407
|
className: "min-h-[300px]",
|
|
424
408
|
children: (() => {
|
|
425
409
|
let n = t.chart.type, r = !!t.chart.chartType;
|
|
@@ -429,7 +413,7 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
429
413
|
series: t.chart.series || (t.chart.yAxisFields ? t.chart.yAxisFields.map((e) => ({ dataKey: e })) : []),
|
|
430
414
|
chartType: t.chart.chartType || "bar"
|
|
431
415
|
} : {};
|
|
432
|
-
return /* @__PURE__ */ (
|
|
416
|
+
return /* @__PURE__ */ S(w, { schema: {
|
|
433
417
|
...t.chart,
|
|
434
418
|
type: n,
|
|
435
419
|
...i,
|
|
@@ -438,21 +422,21 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
438
422
|
} });
|
|
439
423
|
})()
|
|
440
424
|
}),
|
|
441
|
-
t.type === "table" && /* @__PURE__ */ (
|
|
425
|
+
t.type === "table" && /* @__PURE__ */ S("div", {
|
|
442
426
|
className: "border rounded-lg overflow-x-auto",
|
|
443
|
-
children: /* @__PURE__ */ (
|
|
427
|
+
children: /* @__PURE__ */ C("table", {
|
|
444
428
|
className: "w-full text-sm min-w-[600px]",
|
|
445
|
-
children: [/* @__PURE__ */ (
|
|
429
|
+
children: [/* @__PURE__ */ S("thead", {
|
|
446
430
|
className: "bg-muted",
|
|
447
|
-
children: /* @__PURE__ */ (
|
|
431
|
+
children: /* @__PURE__ */ S("tr", { children: t.columns?.map((e, t) => /* @__PURE__ */ S("th", {
|
|
448
432
|
className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
|
|
449
433
|
children: e.label || e.name
|
|
450
434
|
}, t)) })
|
|
451
|
-
}), /* @__PURE__ */ (
|
|
452
|
-
let e =
|
|
453
|
-
return e ? e.map((e) => /* @__PURE__ */ (
|
|
435
|
+
}), /* @__PURE__ */ S("tbody", { children: (() => {
|
|
436
|
+
let e = ne(f || [], d.groupBy || []);
|
|
437
|
+
return e ? e.map((e) => /* @__PURE__ */ C(n.Fragment, { children: [/* @__PURE__ */ S("tr", {
|
|
454
438
|
className: "bg-muted/60",
|
|
455
|
-
children: /* @__PURE__ */ (
|
|
439
|
+
children: /* @__PURE__ */ C("td", {
|
|
456
440
|
colSpan: t.columns?.length || 1,
|
|
457
441
|
className: "px-4 py-2 font-semibold text-sm",
|
|
458
442
|
children: [
|
|
@@ -462,59 +446,59 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
462
446
|
")"
|
|
463
447
|
]
|
|
464
448
|
})
|
|
465
|
-
}), e.rows.map((e, n) => /* @__PURE__ */ (
|
|
449
|
+
}), e.rows.map((e, n) => /* @__PURE__ */ S("tr", {
|
|
466
450
|
className: "border-t hover:bg-muted/50 even:bg-muted/20",
|
|
467
|
-
children: t.columns?.map((t, n) => /* @__PURE__ */ (
|
|
451
|
+
children: t.columns?.map((t, n) => /* @__PURE__ */ S("td", {
|
|
468
452
|
className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
|
|
469
|
-
style:
|
|
470
|
-
children:
|
|
453
|
+
style: T(t.name, e[t.name]),
|
|
454
|
+
children: E(e[t.name], t)
|
|
471
455
|
}, n))
|
|
472
|
-
}, n))] }, e.key)) : f?.map((e, n) => /* @__PURE__ */ (
|
|
456
|
+
}, n))] }, e.key)) : f?.map((e, n) => /* @__PURE__ */ S("tr", {
|
|
473
457
|
className: "border-t hover:bg-muted/50 even:bg-muted/20",
|
|
474
|
-
children: t.columns?.map((t, n) => /* @__PURE__ */ (
|
|
458
|
+
children: t.columns?.map((t, n) => /* @__PURE__ */ S("td", {
|
|
475
459
|
className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
|
|
476
|
-
style:
|
|
477
|
-
children:
|
|
460
|
+
style: T(t.name, e[t.name]),
|
|
461
|
+
children: E(e[t.name], t)
|
|
478
462
|
}, n))
|
|
479
463
|
}, n));
|
|
480
464
|
})() })]
|
|
481
465
|
})
|
|
482
466
|
}),
|
|
483
|
-
t.type === "text" && t.text && /* @__PURE__ */ (
|
|
467
|
+
t.type === "text" && t.text && /* @__PURE__ */ S("div", {
|
|
484
468
|
className: "prose max-w-none",
|
|
485
|
-
children: /* @__PURE__ */ (
|
|
469
|
+
children: /* @__PURE__ */ S("p", { children: t.text })
|
|
486
470
|
}),
|
|
487
|
-
t.type === "page-break" && /* @__PURE__ */ (
|
|
488
|
-
t.content && /* @__PURE__ */ (
|
|
471
|
+
t.type === "page-break" && /* @__PURE__ */ S("div", { className: "border-t-2 border-dashed my-8 print:page-break-after-always" }),
|
|
472
|
+
t.content && /* @__PURE__ */ S(w, { schema: t.content })
|
|
489
473
|
]
|
|
490
474
|
}, r)),
|
|
491
|
-
!d.sections && f && f.length > 0 && /* @__PURE__ */ (
|
|
475
|
+
!d.sections && f && f.length > 0 && /* @__PURE__ */ S("div", {
|
|
492
476
|
className: "border rounded-lg overflow-x-auto",
|
|
493
|
-
children: /* @__PURE__ */ (
|
|
477
|
+
children: /* @__PURE__ */ C("table", {
|
|
494
478
|
className: "w-full text-sm min-w-[600px]",
|
|
495
|
-
children: [/* @__PURE__ */ (
|
|
479
|
+
children: [/* @__PURE__ */ S("thead", {
|
|
496
480
|
className: "bg-muted",
|
|
497
|
-
children: /* @__PURE__ */ (
|
|
481
|
+
children: /* @__PURE__ */ S("tr", { children: d.fields?.map((e, t) => /* @__PURE__ */ S("th", {
|
|
498
482
|
className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
|
|
499
483
|
children: e.label || e.name
|
|
500
484
|
}, t)) })
|
|
501
|
-
}), /* @__PURE__ */ (
|
|
485
|
+
}), /* @__PURE__ */ S("tbody", { children: f.map((e, t) => /* @__PURE__ */ S("tr", {
|
|
502
486
|
className: "border-t hover:bg-muted/50 even:bg-muted/20",
|
|
503
|
-
children: d.fields?.map((t, n) => /* @__PURE__ */ (
|
|
487
|
+
children: d.fields?.map((t, n) => /* @__PURE__ */ S("td", {
|
|
504
488
|
className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
|
|
505
|
-
style:
|
|
506
|
-
children:
|
|
489
|
+
style: T(t.name, e[t.name]),
|
|
490
|
+
children: E(e[t.name], t)
|
|
507
491
|
}, n))
|
|
508
492
|
}, t)) })]
|
|
509
493
|
})
|
|
510
494
|
})
|
|
511
495
|
]
|
|
512
496
|
})] })]
|
|
513
|
-
}) : /* @__PURE__ */ (
|
|
497
|
+
}) : /* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, {
|
|
514
498
|
className: "p-8 text-center text-muted-foreground",
|
|
515
499
|
children: "No report to display"
|
|
516
500
|
}) });
|
|
517
|
-
},
|
|
501
|
+
}, Z = ({ schedule: e, onChange: t }) => {
|
|
518
502
|
let [n, i] = r(e || {
|
|
519
503
|
enabled: !1,
|
|
520
504
|
frequency: "weekly",
|
|
@@ -529,27 +513,27 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
529
513
|
};
|
|
530
514
|
i(r), t?.(r);
|
|
531
515
|
};
|
|
532
|
-
return /* @__PURE__ */ (
|
|
516
|
+
return /* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(l, { children: /* @__PURE__ */ C(u, {
|
|
533
517
|
className: "flex items-center gap-2",
|
|
534
|
-
children: [/* @__PURE__ */ (
|
|
535
|
-
}) }), /* @__PURE__ */ (
|
|
518
|
+
children: [/* @__PURE__ */ S(T, { className: "h-5 w-5" }), "Schedule Configuration"]
|
|
519
|
+
}) }), /* @__PURE__ */ C(s, {
|
|
536
520
|
className: "space-y-4",
|
|
537
|
-
children: [/* @__PURE__ */ (
|
|
521
|
+
children: [/* @__PURE__ */ C("div", {
|
|
538
522
|
className: "flex items-center gap-2",
|
|
539
|
-
children: [/* @__PURE__ */ (
|
|
523
|
+
children: [/* @__PURE__ */ S("input", {
|
|
540
524
|
type: "checkbox",
|
|
541
525
|
id: "schedule-enabled",
|
|
542
526
|
checked: n.enabled || !1,
|
|
543
527
|
onChange: (e) => a({ enabled: e.target.checked }),
|
|
544
528
|
className: "rounded"
|
|
545
|
-
}), /* @__PURE__ */ (
|
|
529
|
+
}), /* @__PURE__ */ S(m, {
|
|
546
530
|
htmlFor: "schedule-enabled",
|
|
547
531
|
children: "Enable Scheduled Report"
|
|
548
532
|
})]
|
|
549
|
-
}), n.enabled && /* @__PURE__ */ (
|
|
550
|
-
/* @__PURE__ */ (
|
|
533
|
+
}), n.enabled && /* @__PURE__ */ C(x, { children: [
|
|
534
|
+
/* @__PURE__ */ C("div", {
|
|
551
535
|
className: "space-y-2",
|
|
552
|
-
children: [/* @__PURE__ */ (
|
|
536
|
+
children: [/* @__PURE__ */ S(m, { children: "Frequency" }), /* @__PURE__ */ S("select", {
|
|
553
537
|
className: "w-full border rounded-md p-2 bg-background",
|
|
554
538
|
value: n.frequency || "weekly",
|
|
555
539
|
onChange: (e) => a({ frequency: e.target.value }),
|
|
@@ -578,15 +562,15 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
578
562
|
value: "yearly",
|
|
579
563
|
label: "Yearly"
|
|
580
564
|
}
|
|
581
|
-
].map((e) => /* @__PURE__ */ (
|
|
565
|
+
].map((e) => /* @__PURE__ */ S("option", {
|
|
582
566
|
value: e.value,
|
|
583
567
|
children: e.label
|
|
584
568
|
}, e.value))
|
|
585
569
|
})]
|
|
586
570
|
}),
|
|
587
|
-
n.frequency === "weekly" && /* @__PURE__ */ (
|
|
571
|
+
n.frequency === "weekly" && /* @__PURE__ */ C("div", {
|
|
588
572
|
className: "space-y-2",
|
|
589
|
-
children: [/* @__PURE__ */ (
|
|
573
|
+
children: [/* @__PURE__ */ S(m, { children: "Day of Week" }), /* @__PURE__ */ S("select", {
|
|
590
574
|
className: "w-full border rounded-md p-2 bg-background",
|
|
591
575
|
value: n.dayOfWeek ?? 1,
|
|
592
576
|
onChange: (e) => a({ dayOfWeek: Number(e.target.value) }),
|
|
@@ -619,15 +603,15 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
619
603
|
value: 6,
|
|
620
604
|
label: "Saturday"
|
|
621
605
|
}
|
|
622
|
-
].map((e) => /* @__PURE__ */ (
|
|
606
|
+
].map((e) => /* @__PURE__ */ S("option", {
|
|
623
607
|
value: e.value,
|
|
624
608
|
children: e.label
|
|
625
609
|
}, e.value))
|
|
626
610
|
})]
|
|
627
611
|
}),
|
|
628
|
-
n.frequency === "monthly" && /* @__PURE__ */ (
|
|
612
|
+
n.frequency === "monthly" && /* @__PURE__ */ C("div", {
|
|
629
613
|
className: "space-y-2",
|
|
630
|
-
children: [/* @__PURE__ */ (
|
|
614
|
+
children: [/* @__PURE__ */ S(m, { children: "Day of Month" }), /* @__PURE__ */ S(p, {
|
|
631
615
|
type: "number",
|
|
632
616
|
min: 1,
|
|
633
617
|
max: 31,
|
|
@@ -635,28 +619,28 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
635
619
|
onChange: (e) => a({ dayOfMonth: Number(e.target.value) })
|
|
636
620
|
})]
|
|
637
621
|
}),
|
|
638
|
-
/* @__PURE__ */ (
|
|
622
|
+
/* @__PURE__ */ C("div", {
|
|
639
623
|
className: "space-y-2",
|
|
640
|
-
children: [/* @__PURE__ */ (
|
|
624
|
+
children: [/* @__PURE__ */ C(m, {
|
|
641
625
|
className: "flex items-center gap-2",
|
|
642
|
-
children: [/* @__PURE__ */ (
|
|
643
|
-
}), /* @__PURE__ */ (
|
|
626
|
+
children: [/* @__PURE__ */ S(E, { className: "h-4 w-4" }), "Time"]
|
|
627
|
+
}), /* @__PURE__ */ S(p, {
|
|
644
628
|
type: "time",
|
|
645
629
|
value: n.time || "09:00",
|
|
646
630
|
onChange: (e) => a({ time: e.target.value })
|
|
647
631
|
})]
|
|
648
632
|
}),
|
|
649
|
-
/* @__PURE__ */ (
|
|
633
|
+
/* @__PURE__ */ C("div", {
|
|
650
634
|
className: "space-y-2",
|
|
651
|
-
children: [/* @__PURE__ */ (
|
|
635
|
+
children: [/* @__PURE__ */ S(m, { children: "Timezone" }), /* @__PURE__ */ S(p, {
|
|
652
636
|
value: n.timezone || "",
|
|
653
637
|
onChange: (e) => a({ timezone: e.target.value }),
|
|
654
638
|
placeholder: "e.g. America/New_York"
|
|
655
639
|
})]
|
|
656
640
|
}),
|
|
657
|
-
/* @__PURE__ */ (
|
|
641
|
+
/* @__PURE__ */ C("div", {
|
|
658
642
|
className: "space-y-2",
|
|
659
|
-
children: [/* @__PURE__ */ (
|
|
643
|
+
children: [/* @__PURE__ */ S(m, { children: "Export Formats" }), /* @__PURE__ */ S("div", {
|
|
660
644
|
className: "flex flex-wrap gap-2",
|
|
661
645
|
children: [
|
|
662
646
|
{
|
|
@@ -675,9 +659,9 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
675
659
|
value: "html",
|
|
676
660
|
label: "HTML"
|
|
677
661
|
}
|
|
678
|
-
].map((e) => /* @__PURE__ */ (
|
|
662
|
+
].map((e) => /* @__PURE__ */ C("label", {
|
|
679
663
|
className: "flex items-center gap-1.5 px-3 py-1.5 border rounded-md cursor-pointer hover:bg-muted/50",
|
|
680
|
-
children: [/* @__PURE__ */ (
|
|
664
|
+
children: [/* @__PURE__ */ S("input", {
|
|
681
665
|
type: "checkbox",
|
|
682
666
|
checked: n.formats?.includes(e.value) || !1,
|
|
683
667
|
onChange: (t) => {
|
|
@@ -685,27 +669,27 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
685
669
|
a({ formats: t.target.checked ? [...r, e.value] : r.filter((t) => t !== e.value) });
|
|
686
670
|
},
|
|
687
671
|
className: "rounded"
|
|
688
|
-
}), /* @__PURE__ */ (
|
|
672
|
+
}), /* @__PURE__ */ S("span", {
|
|
689
673
|
className: "text-sm",
|
|
690
674
|
children: e.label
|
|
691
675
|
})]
|
|
692
676
|
}, e.value))
|
|
693
677
|
})]
|
|
694
678
|
}),
|
|
695
|
-
/* @__PURE__ */ (
|
|
679
|
+
/* @__PURE__ */ C("div", {
|
|
696
680
|
className: "space-y-2",
|
|
697
|
-
children: [/* @__PURE__ */ (
|
|
681
|
+
children: [/* @__PURE__ */ C(m, {
|
|
698
682
|
className: "flex items-center gap-2",
|
|
699
|
-
children: [/* @__PURE__ */ (
|
|
700
|
-
}), /* @__PURE__ */ (
|
|
683
|
+
children: [/* @__PURE__ */ S(k, { className: "h-4 w-4" }), "Email Recipients"]
|
|
684
|
+
}), /* @__PURE__ */ S(p, {
|
|
701
685
|
placeholder: "email1@example.com, email2@example.com",
|
|
702
686
|
value: n.recipients?.join(", ") || "",
|
|
703
687
|
onChange: (e) => a({ recipients: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
704
688
|
})]
|
|
705
689
|
}),
|
|
706
|
-
/* @__PURE__ */ (
|
|
690
|
+
/* @__PURE__ */ C("div", {
|
|
707
691
|
className: "space-y-2",
|
|
708
|
-
children: [/* @__PURE__ */ (
|
|
692
|
+
children: [/* @__PURE__ */ S(m, { children: "Email Subject" }), /* @__PURE__ */ S(p, {
|
|
709
693
|
value: n.subject || "",
|
|
710
694
|
onChange: (e) => a({ subject: e.target.value }),
|
|
711
695
|
placeholder: "Scheduled Report: {report_title}"
|
|
@@ -713,8 +697,8 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
713
697
|
})
|
|
714
698
|
] })]
|
|
715
699
|
})] });
|
|
716
|
-
},
|
|
717
|
-
let { report: t, dataSources: n = [], availableFields: i = [], showPreview: d = !0, onSave: f, onCancel: h } = e, [b,
|
|
700
|
+
}, Q = ({ schema: e }) => {
|
|
701
|
+
let { report: t, dataSources: n = [], availableFields: i = [], showPreview: d = !0, onSave: f, onCancel: h } = e, [b, w] = r(t || {
|
|
718
702
|
type: "report",
|
|
719
703
|
title: "New Report",
|
|
720
704
|
fields: [],
|
|
@@ -723,242 +707,242 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
723
707
|
sections: [],
|
|
724
708
|
showExportButtons: !0,
|
|
725
709
|
showPrintButton: !0
|
|
726
|
-
}), [
|
|
727
|
-
if (i.length > 0 &&
|
|
728
|
-
let e = i.find((e) => !
|
|
710
|
+
}), [E, D] = r(b.fields || []), [k, j] = r(b.filters || []), [M, F] = r(b.groupBy || []), [I, L] = r(b.sections || []), R = () => {
|
|
711
|
+
if (i.length > 0 && E.length < i.length) {
|
|
712
|
+
let e = i.find((e) => !E.some((t) => t.name === e.name));
|
|
729
713
|
if (e) {
|
|
730
|
-
let t = [...
|
|
731
|
-
|
|
714
|
+
let t = [...E, e];
|
|
715
|
+
D(t), w({
|
|
732
716
|
...b,
|
|
733
717
|
fields: t
|
|
734
718
|
});
|
|
735
719
|
}
|
|
736
720
|
}
|
|
737
|
-
},
|
|
738
|
-
let t =
|
|
739
|
-
|
|
721
|
+
}, z = (e) => {
|
|
722
|
+
let t = E.filter((t, n) => n !== e);
|
|
723
|
+
D(t), w({
|
|
740
724
|
...b,
|
|
741
725
|
fields: t
|
|
742
726
|
});
|
|
743
|
-
},
|
|
744
|
-
let n = [...
|
|
745
|
-
n[e] = t,
|
|
727
|
+
}, B = (e, t) => {
|
|
728
|
+
let n = [...E];
|
|
729
|
+
n[e] = t, D(n), w({
|
|
746
730
|
...b,
|
|
747
731
|
fields: n
|
|
748
732
|
});
|
|
749
|
-
},
|
|
733
|
+
}, V = () => {
|
|
750
734
|
let e = {
|
|
751
735
|
field: i[0]?.name || "",
|
|
752
736
|
operator: "equals",
|
|
753
737
|
value: ""
|
|
754
|
-
}, t = [...
|
|
755
|
-
|
|
738
|
+
}, t = [...k, e];
|
|
739
|
+
j(t), w({
|
|
756
740
|
...b,
|
|
757
741
|
filters: t
|
|
758
742
|
});
|
|
759
|
-
},
|
|
760
|
-
let t =
|
|
761
|
-
|
|
743
|
+
}, H = (e) => {
|
|
744
|
+
let t = k.filter((t, n) => n !== e);
|
|
745
|
+
j(t), w({
|
|
762
746
|
...b,
|
|
763
747
|
filters: t
|
|
764
748
|
});
|
|
765
|
-
},
|
|
766
|
-
let n = [...
|
|
767
|
-
n[e] = t,
|
|
749
|
+
}, U = (e, t) => {
|
|
750
|
+
let n = [...k];
|
|
751
|
+
n[e] = t, j(n), w({
|
|
768
752
|
...b,
|
|
769
753
|
filters: n
|
|
770
754
|
});
|
|
771
|
-
},
|
|
755
|
+
}, W = () => {
|
|
772
756
|
let e = {
|
|
773
757
|
field: i[0]?.name || "",
|
|
774
758
|
sort: "asc"
|
|
775
|
-
}, t = [...
|
|
776
|
-
|
|
759
|
+
}, t = [...M, e];
|
|
760
|
+
F(t), w({
|
|
777
761
|
...b,
|
|
778
762
|
groupBy: t
|
|
779
763
|
});
|
|
780
|
-
},
|
|
781
|
-
let t =
|
|
782
|
-
|
|
764
|
+
}, G = (e) => {
|
|
765
|
+
let t = M.filter((t, n) => n !== e);
|
|
766
|
+
F(t), w({
|
|
783
767
|
...b,
|
|
784
768
|
groupBy: t
|
|
785
769
|
});
|
|
786
|
-
},
|
|
787
|
-
let n = [...
|
|
788
|
-
n[e] = t,
|
|
770
|
+
}, K = (e, t) => {
|
|
771
|
+
let n = [...M];
|
|
772
|
+
n[e] = t, F(n), w({
|
|
789
773
|
...b,
|
|
790
774
|
groupBy: n
|
|
791
775
|
});
|
|
792
|
-
},
|
|
776
|
+
}, q = (e) => {
|
|
793
777
|
let t = {
|
|
794
778
|
type: e,
|
|
795
779
|
title: `New ${e} Section`
|
|
796
|
-
}, n = [...
|
|
797
|
-
|
|
780
|
+
}, n = [...I, t];
|
|
781
|
+
L(n), w({
|
|
798
782
|
...b,
|
|
799
783
|
sections: n
|
|
800
784
|
});
|
|
801
|
-
},
|
|
802
|
-
let t =
|
|
803
|
-
|
|
785
|
+
}, J = (e) => {
|
|
786
|
+
let t = I.filter((t, n) => n !== e);
|
|
787
|
+
L(t), w({
|
|
804
788
|
...b,
|
|
805
789
|
sections: t
|
|
806
790
|
});
|
|
807
|
-
},
|
|
808
|
-
let n = [...
|
|
809
|
-
n[e] = t,
|
|
791
|
+
}, Y = (e, t) => {
|
|
792
|
+
let n = [...I];
|
|
793
|
+
n[e] = t, L(n), w({
|
|
810
794
|
...b,
|
|
811
795
|
sections: n
|
|
812
796
|
});
|
|
813
797
|
};
|
|
814
|
-
return /* @__PURE__ */ (
|
|
798
|
+
return /* @__PURE__ */ C("div", {
|
|
815
799
|
className: "space-y-4",
|
|
816
|
-
children: [/* @__PURE__ */ (
|
|
800
|
+
children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ C(l, { children: [/* @__PURE__ */ S(u, { children: "Report Builder" }), /* @__PURE__ */ S(c, { children: "Configure your report settings, fields, filters, and sections" })] }), /* @__PURE__ */ C(s, { children: [/* @__PURE__ */ C(g, {
|
|
817
801
|
defaultValue: "basic",
|
|
818
802
|
className: "w-full",
|
|
819
803
|
children: [
|
|
820
|
-
/* @__PURE__ */ (
|
|
804
|
+
/* @__PURE__ */ C(v, {
|
|
821
805
|
className: "grid w-full grid-cols-6",
|
|
822
806
|
children: [
|
|
823
|
-
/* @__PURE__ */ (
|
|
807
|
+
/* @__PURE__ */ C(y, {
|
|
824
808
|
value: "basic",
|
|
825
|
-
children: [/* @__PURE__ */ (
|
|
809
|
+
children: [/* @__PURE__ */ S(te, { className: "h-4 w-4 mr-2" }), "Basic"]
|
|
826
810
|
}),
|
|
827
|
-
/* @__PURE__ */ (
|
|
811
|
+
/* @__PURE__ */ C(y, {
|
|
828
812
|
value: "fields",
|
|
829
|
-
children: [/* @__PURE__ */ (
|
|
813
|
+
children: [/* @__PURE__ */ S(O, { className: "h-4 w-4 mr-2" }), "Fields"]
|
|
830
814
|
}),
|
|
831
|
-
/* @__PURE__ */ (
|
|
815
|
+
/* @__PURE__ */ C(y, {
|
|
832
816
|
value: "filters",
|
|
833
|
-
children: [/* @__PURE__ */ (
|
|
817
|
+
children: [/* @__PURE__ */ S(ee, { className: "h-4 w-4 mr-2" }), "Filters"]
|
|
834
818
|
}),
|
|
835
|
-
/* @__PURE__ */ (
|
|
819
|
+
/* @__PURE__ */ C(y, {
|
|
836
820
|
value: "grouping",
|
|
837
|
-
children: [/* @__PURE__ */ (
|
|
821
|
+
children: [/* @__PURE__ */ S(O, { className: "h-4 w-4 mr-2" }), "Group By"]
|
|
838
822
|
}),
|
|
839
|
-
/* @__PURE__ */ (
|
|
823
|
+
/* @__PURE__ */ C(y, {
|
|
840
824
|
value: "sections",
|
|
841
|
-
children: [/* @__PURE__ */ (
|
|
825
|
+
children: [/* @__PURE__ */ S(O, { className: "h-4 w-4 mr-2" }), "Sections"]
|
|
842
826
|
}),
|
|
843
|
-
/* @__PURE__ */ (
|
|
827
|
+
/* @__PURE__ */ C(y, {
|
|
844
828
|
value: "schedule",
|
|
845
|
-
children: [/* @__PURE__ */ (
|
|
829
|
+
children: [/* @__PURE__ */ S(T, { className: "h-4 w-4 mr-2" }), "Schedule"]
|
|
846
830
|
})
|
|
847
831
|
]
|
|
848
832
|
}),
|
|
849
|
-
/* @__PURE__ */ (
|
|
833
|
+
/* @__PURE__ */ S(_, {
|
|
850
834
|
value: "basic",
|
|
851
835
|
className: "space-y-4 mt-4",
|
|
852
|
-
children: /* @__PURE__ */ (
|
|
836
|
+
children: /* @__PURE__ */ C("div", {
|
|
853
837
|
className: "space-y-4",
|
|
854
838
|
children: [
|
|
855
|
-
/* @__PURE__ */ (
|
|
839
|
+
/* @__PURE__ */ C("div", {
|
|
856
840
|
className: "space-y-2",
|
|
857
|
-
children: [/* @__PURE__ */ (
|
|
841
|
+
children: [/* @__PURE__ */ S(m, {
|
|
858
842
|
htmlFor: "report-title",
|
|
859
843
|
children: "Report Title"
|
|
860
|
-
}), /* @__PURE__ */ (
|
|
844
|
+
}), /* @__PURE__ */ S(p, {
|
|
861
845
|
id: "report-title",
|
|
862
846
|
value: b.title || "",
|
|
863
|
-
onChange: (e) =>
|
|
847
|
+
onChange: (e) => w({
|
|
864
848
|
...b,
|
|
865
849
|
title: e.target.value
|
|
866
850
|
}),
|
|
867
851
|
placeholder: "Enter report title"
|
|
868
852
|
})]
|
|
869
853
|
}),
|
|
870
|
-
/* @__PURE__ */ (
|
|
854
|
+
/* @__PURE__ */ C("div", {
|
|
871
855
|
className: "space-y-2",
|
|
872
|
-
children: [/* @__PURE__ */ (
|
|
856
|
+
children: [/* @__PURE__ */ S(m, {
|
|
873
857
|
htmlFor: "report-description",
|
|
874
858
|
children: "Description"
|
|
875
|
-
}), /* @__PURE__ */ (
|
|
859
|
+
}), /* @__PURE__ */ S(p, {
|
|
876
860
|
id: "report-description",
|
|
877
861
|
value: b.description || "",
|
|
878
|
-
onChange: (e) =>
|
|
862
|
+
onChange: (e) => w({
|
|
879
863
|
...b,
|
|
880
864
|
description: e.target.value
|
|
881
865
|
}),
|
|
882
866
|
placeholder: "Enter report description"
|
|
883
867
|
})]
|
|
884
868
|
}),
|
|
885
|
-
n.length > 0 && /* @__PURE__ */ (
|
|
869
|
+
n.length > 0 && /* @__PURE__ */ C("div", {
|
|
886
870
|
className: "space-y-2",
|
|
887
|
-
children: [/* @__PURE__ */ (
|
|
871
|
+
children: [/* @__PURE__ */ S(m, { children: "Data Source" }), /* @__PURE__ */ C("select", {
|
|
888
872
|
className: "w-full border rounded-md p-2",
|
|
889
|
-
children: [/* @__PURE__ */ (
|
|
873
|
+
children: [/* @__PURE__ */ S("option", {
|
|
890
874
|
value: "",
|
|
891
875
|
children: "Select a data source"
|
|
892
|
-
}), n.map((e, t) => /* @__PURE__ */ (
|
|
876
|
+
}), n.map((e, t) => /* @__PURE__ */ C("option", {
|
|
893
877
|
value: t,
|
|
894
878
|
children: ["Data Source ", t + 1]
|
|
895
879
|
}, t))]
|
|
896
880
|
})]
|
|
897
881
|
}),
|
|
898
|
-
/* @__PURE__ */ (
|
|
882
|
+
/* @__PURE__ */ C("div", {
|
|
899
883
|
className: "space-y-2",
|
|
900
|
-
children: [/* @__PURE__ */ (
|
|
884
|
+
children: [/* @__PURE__ */ S(m, { children: "Export Options" }), /* @__PURE__ */ C("div", {
|
|
901
885
|
className: "flex items-center gap-4",
|
|
902
|
-
children: [/* @__PURE__ */ (
|
|
886
|
+
children: [/* @__PURE__ */ C("label", {
|
|
903
887
|
className: "flex items-center gap-2",
|
|
904
|
-
children: [/* @__PURE__ */ (
|
|
888
|
+
children: [/* @__PURE__ */ S("input", {
|
|
905
889
|
type: "checkbox",
|
|
906
890
|
checked: b.showExportButtons || !1,
|
|
907
|
-
onChange: (e) =>
|
|
891
|
+
onChange: (e) => w({
|
|
908
892
|
...b,
|
|
909
893
|
showExportButtons: e.target.checked
|
|
910
894
|
})
|
|
911
|
-
}), /* @__PURE__ */ (
|
|
895
|
+
}), /* @__PURE__ */ S("span", {
|
|
912
896
|
className: "text-sm",
|
|
913
897
|
children: "Show Export Buttons"
|
|
914
898
|
})]
|
|
915
|
-
}), /* @__PURE__ */ (
|
|
899
|
+
}), /* @__PURE__ */ C("label", {
|
|
916
900
|
className: "flex items-center gap-2",
|
|
917
|
-
children: [/* @__PURE__ */ (
|
|
901
|
+
children: [/* @__PURE__ */ S("input", {
|
|
918
902
|
type: "checkbox",
|
|
919
903
|
checked: b.showPrintButton || !1,
|
|
920
|
-
onChange: (e) =>
|
|
904
|
+
onChange: (e) => w({
|
|
921
905
|
...b,
|
|
922
906
|
showPrintButton: e.target.checked
|
|
923
907
|
})
|
|
924
|
-
}), /* @__PURE__ */ (
|
|
908
|
+
}), /* @__PURE__ */ S("span", {
|
|
925
909
|
className: "text-sm",
|
|
926
910
|
children: "Show Print Button"
|
|
927
911
|
})]
|
|
928
912
|
})]
|
|
929
913
|
})]
|
|
930
914
|
}),
|
|
931
|
-
/* @__PURE__ */ (
|
|
915
|
+
/* @__PURE__ */ C("div", {
|
|
932
916
|
className: "space-y-2",
|
|
933
|
-
children: [/* @__PURE__ */ (
|
|
917
|
+
children: [/* @__PURE__ */ S(m, {
|
|
934
918
|
htmlFor: "export-format",
|
|
935
919
|
children: "Default Export Format"
|
|
936
|
-
}), /* @__PURE__ */ (
|
|
920
|
+
}), /* @__PURE__ */ C("select", {
|
|
937
921
|
id: "export-format",
|
|
938
922
|
className: "w-full border rounded-md p-2",
|
|
939
923
|
value: b.defaultExportFormat || "pdf",
|
|
940
|
-
onChange: (e) =>
|
|
924
|
+
onChange: (e) => w({
|
|
941
925
|
...b,
|
|
942
926
|
defaultExportFormat: e.target.value
|
|
943
927
|
}),
|
|
944
928
|
children: [
|
|
945
|
-
/* @__PURE__ */ (
|
|
929
|
+
/* @__PURE__ */ S("option", {
|
|
946
930
|
value: "pdf",
|
|
947
931
|
children: "PDF"
|
|
948
932
|
}),
|
|
949
|
-
/* @__PURE__ */ (
|
|
933
|
+
/* @__PURE__ */ S("option", {
|
|
950
934
|
value: "excel",
|
|
951
935
|
children: "Excel"
|
|
952
936
|
}),
|
|
953
|
-
/* @__PURE__ */ (
|
|
937
|
+
/* @__PURE__ */ S("option", {
|
|
954
938
|
value: "csv",
|
|
955
939
|
children: "CSV"
|
|
956
940
|
}),
|
|
957
|
-
/* @__PURE__ */ (
|
|
941
|
+
/* @__PURE__ */ S("option", {
|
|
958
942
|
value: "json",
|
|
959
943
|
children: "JSON"
|
|
960
944
|
}),
|
|
961
|
-
/* @__PURE__ */ (
|
|
945
|
+
/* @__PURE__ */ S("option", {
|
|
962
946
|
value: "html",
|
|
963
947
|
children: "HTML"
|
|
964
948
|
})
|
|
@@ -968,343 +952,343 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
968
952
|
]
|
|
969
953
|
})
|
|
970
954
|
}),
|
|
971
|
-
/* @__PURE__ */ (
|
|
955
|
+
/* @__PURE__ */ C(_, {
|
|
972
956
|
value: "fields",
|
|
973
957
|
className: "space-y-4 mt-4",
|
|
974
|
-
children: [/* @__PURE__ */ (
|
|
958
|
+
children: [/* @__PURE__ */ C("div", {
|
|
975
959
|
className: "flex items-center justify-between",
|
|
976
|
-
children: [/* @__PURE__ */ (
|
|
960
|
+
children: [/* @__PURE__ */ S(m, { children: "Report Fields" }), /* @__PURE__ */ C(a, {
|
|
977
961
|
size: "sm",
|
|
978
962
|
variant: "outline",
|
|
979
|
-
onClick:
|
|
980
|
-
disabled:
|
|
981
|
-
children: [/* @__PURE__ */ (
|
|
963
|
+
onClick: R,
|
|
964
|
+
disabled: E.length >= i.length,
|
|
965
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Add Field"]
|
|
982
966
|
})]
|
|
983
|
-
}), /* @__PURE__ */ (
|
|
967
|
+
}), /* @__PURE__ */ C("div", {
|
|
984
968
|
className: "space-y-2",
|
|
985
|
-
children: [
|
|
969
|
+
children: [E.map((e, t) => /* @__PURE__ */ S("div", {
|
|
986
970
|
className: "flex items-center gap-2 p-3 border rounded-lg",
|
|
987
|
-
children: /* @__PURE__ */ (
|
|
971
|
+
children: /* @__PURE__ */ C("div", {
|
|
988
972
|
className: "flex-1 grid grid-cols-4 gap-2",
|
|
989
973
|
children: [
|
|
990
|
-
/* @__PURE__ */ (
|
|
974
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
991
975
|
className: "text-xs",
|
|
992
976
|
children: "Field Name"
|
|
993
|
-
}), /* @__PURE__ */ (
|
|
977
|
+
}), /* @__PURE__ */ S("div", {
|
|
994
978
|
className: "text-sm font-medium",
|
|
995
979
|
children: e.name
|
|
996
980
|
})] }),
|
|
997
|
-
/* @__PURE__ */ (
|
|
981
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
998
982
|
className: "text-xs",
|
|
999
983
|
children: "Label"
|
|
1000
|
-
}), /* @__PURE__ */ (
|
|
984
|
+
}), /* @__PURE__ */ S(p, {
|
|
1001
985
|
className: "h-8 text-sm",
|
|
1002
986
|
value: e.label || e.name,
|
|
1003
|
-
onChange: (n) =>
|
|
987
|
+
onChange: (n) => B(t, {
|
|
1004
988
|
...e,
|
|
1005
989
|
label: n.target.value
|
|
1006
990
|
})
|
|
1007
991
|
})] }),
|
|
1008
|
-
/* @__PURE__ */ (
|
|
992
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1009
993
|
className: "text-xs",
|
|
1010
994
|
children: "Aggregation"
|
|
1011
|
-
}), /* @__PURE__ */ (
|
|
995
|
+
}), /* @__PURE__ */ C("select", {
|
|
1012
996
|
className: "w-full border rounded-md h-8 text-sm px-2",
|
|
1013
997
|
value: e.aggregation || "",
|
|
1014
|
-
onChange: (n) =>
|
|
998
|
+
onChange: (n) => B(t, {
|
|
1015
999
|
...e,
|
|
1016
1000
|
aggregation: n.target.value
|
|
1017
1001
|
}),
|
|
1018
1002
|
children: [
|
|
1019
|
-
/* @__PURE__ */ (
|
|
1003
|
+
/* @__PURE__ */ S("option", {
|
|
1020
1004
|
value: "",
|
|
1021
1005
|
children: "None"
|
|
1022
1006
|
}),
|
|
1023
|
-
/* @__PURE__ */ (
|
|
1007
|
+
/* @__PURE__ */ S("option", {
|
|
1024
1008
|
value: "sum",
|
|
1025
1009
|
children: "Sum"
|
|
1026
1010
|
}),
|
|
1027
|
-
/* @__PURE__ */ (
|
|
1011
|
+
/* @__PURE__ */ S("option", {
|
|
1028
1012
|
value: "count",
|
|
1029
1013
|
children: "Count"
|
|
1030
1014
|
}),
|
|
1031
|
-
/* @__PURE__ */ (
|
|
1015
|
+
/* @__PURE__ */ S("option", {
|
|
1032
1016
|
value: "avg",
|
|
1033
1017
|
children: "Average"
|
|
1034
1018
|
}),
|
|
1035
|
-
/* @__PURE__ */ (
|
|
1019
|
+
/* @__PURE__ */ S("option", {
|
|
1036
1020
|
value: "min",
|
|
1037
1021
|
children: "Min"
|
|
1038
1022
|
}),
|
|
1039
|
-
/* @__PURE__ */ (
|
|
1023
|
+
/* @__PURE__ */ S("option", {
|
|
1040
1024
|
value: "max",
|
|
1041
1025
|
children: "Max"
|
|
1042
1026
|
})
|
|
1043
1027
|
]
|
|
1044
1028
|
})] }),
|
|
1045
|
-
/* @__PURE__ */ (
|
|
1029
|
+
/* @__PURE__ */ S("div", {
|
|
1046
1030
|
className: "flex items-end justify-end",
|
|
1047
|
-
children: /* @__PURE__ */ (
|
|
1031
|
+
children: /* @__PURE__ */ S(a, {
|
|
1048
1032
|
size: "sm",
|
|
1049
1033
|
variant: "ghost",
|
|
1050
1034
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50",
|
|
1051
|
-
onClick: () =>
|
|
1052
|
-
children: /* @__PURE__ */ (
|
|
1035
|
+
onClick: () => z(t),
|
|
1036
|
+
children: /* @__PURE__ */ S(P, { className: "h-4 w-4" })
|
|
1053
1037
|
})
|
|
1054
1038
|
})
|
|
1055
1039
|
]
|
|
1056
1040
|
})
|
|
1057
|
-
}, t)),
|
|
1041
|
+
}, t)), E.length === 0 && /* @__PURE__ */ S("div", {
|
|
1058
1042
|
className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
|
|
1059
1043
|
children: "No fields selected. Click \"Add Field\" to begin."
|
|
1060
1044
|
})]
|
|
1061
1045
|
})]
|
|
1062
1046
|
}),
|
|
1063
|
-
/* @__PURE__ */ (
|
|
1047
|
+
/* @__PURE__ */ C(_, {
|
|
1064
1048
|
value: "filters",
|
|
1065
1049
|
className: "space-y-4 mt-4",
|
|
1066
|
-
children: [/* @__PURE__ */ (
|
|
1050
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1067
1051
|
className: "flex items-center justify-between",
|
|
1068
|
-
children: [/* @__PURE__ */ (
|
|
1052
|
+
children: [/* @__PURE__ */ S(m, { children: "Report Filters" }), /* @__PURE__ */ C(a, {
|
|
1069
1053
|
size: "sm",
|
|
1070
1054
|
variant: "outline",
|
|
1071
|
-
onClick:
|
|
1072
|
-
children: [/* @__PURE__ */ (
|
|
1055
|
+
onClick: V,
|
|
1056
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Add Filter"]
|
|
1073
1057
|
})]
|
|
1074
|
-
}), /* @__PURE__ */ (
|
|
1058
|
+
}), /* @__PURE__ */ C("div", {
|
|
1075
1059
|
className: "space-y-2",
|
|
1076
|
-
children: [
|
|
1060
|
+
children: [k.map((e, t) => /* @__PURE__ */ C("div", {
|
|
1077
1061
|
className: "flex items-center gap-2 p-3 border rounded-lg",
|
|
1078
|
-
children: [/* @__PURE__ */ (
|
|
1062
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1079
1063
|
className: "flex-1 grid grid-cols-3 gap-2",
|
|
1080
1064
|
children: [
|
|
1081
|
-
/* @__PURE__ */ (
|
|
1065
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1082
1066
|
className: "text-xs",
|
|
1083
1067
|
children: "Field"
|
|
1084
|
-
}), /* @__PURE__ */ (
|
|
1068
|
+
}), /* @__PURE__ */ S("select", {
|
|
1085
1069
|
className: "w-full border rounded-md h-8 text-sm px-2",
|
|
1086
1070
|
value: e.field,
|
|
1087
|
-
onChange: (n) =>
|
|
1071
|
+
onChange: (n) => U(t, {
|
|
1088
1072
|
...e,
|
|
1089
1073
|
field: n.target.value
|
|
1090
1074
|
}),
|
|
1091
|
-
children: i.map((e, t) => /* @__PURE__ */ (
|
|
1075
|
+
children: i.map((e, t) => /* @__PURE__ */ S("option", {
|
|
1092
1076
|
value: e.name,
|
|
1093
1077
|
children: e.label || e.name
|
|
1094
1078
|
}, t))
|
|
1095
1079
|
})] }),
|
|
1096
|
-
/* @__PURE__ */ (
|
|
1080
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1097
1081
|
className: "text-xs",
|
|
1098
1082
|
children: "Operator"
|
|
1099
|
-
}), /* @__PURE__ */ (
|
|
1083
|
+
}), /* @__PURE__ */ C("select", {
|
|
1100
1084
|
className: "w-full border rounded-md h-8 text-sm px-2",
|
|
1101
1085
|
value: e.operator,
|
|
1102
|
-
onChange: (n) =>
|
|
1086
|
+
onChange: (n) => U(t, {
|
|
1103
1087
|
...e,
|
|
1104
1088
|
operator: n.target.value
|
|
1105
1089
|
}),
|
|
1106
1090
|
children: [
|
|
1107
|
-
/* @__PURE__ */ (
|
|
1091
|
+
/* @__PURE__ */ S("option", {
|
|
1108
1092
|
value: "equals",
|
|
1109
1093
|
children: "Equals"
|
|
1110
1094
|
}),
|
|
1111
|
-
/* @__PURE__ */ (
|
|
1095
|
+
/* @__PURE__ */ S("option", {
|
|
1112
1096
|
value: "contains",
|
|
1113
1097
|
children: "Contains"
|
|
1114
1098
|
}),
|
|
1115
|
-
/* @__PURE__ */ (
|
|
1099
|
+
/* @__PURE__ */ S("option", {
|
|
1116
1100
|
value: "gt",
|
|
1117
1101
|
children: "Greater Than"
|
|
1118
1102
|
}),
|
|
1119
|
-
/* @__PURE__ */ (
|
|
1103
|
+
/* @__PURE__ */ S("option", {
|
|
1120
1104
|
value: "lt",
|
|
1121
1105
|
children: "Less Than"
|
|
1122
1106
|
}),
|
|
1123
|
-
/* @__PURE__ */ (
|
|
1107
|
+
/* @__PURE__ */ S("option", {
|
|
1124
1108
|
value: "between",
|
|
1125
1109
|
children: "Between"
|
|
1126
1110
|
})
|
|
1127
1111
|
]
|
|
1128
1112
|
})] }),
|
|
1129
|
-
/* @__PURE__ */ (
|
|
1113
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1130
1114
|
className: "text-xs",
|
|
1131
1115
|
children: "Value"
|
|
1132
|
-
}), /* @__PURE__ */ (
|
|
1116
|
+
}), /* @__PURE__ */ S(p, {
|
|
1133
1117
|
className: "h-8 text-sm",
|
|
1134
1118
|
value: String(e.value),
|
|
1135
|
-
onChange: (n) =>
|
|
1119
|
+
onChange: (n) => U(t, {
|
|
1136
1120
|
...e,
|
|
1137
1121
|
value: n.target.value
|
|
1138
1122
|
})
|
|
1139
1123
|
})] })
|
|
1140
1124
|
]
|
|
1141
|
-
}), /* @__PURE__ */ (
|
|
1125
|
+
}), /* @__PURE__ */ S(a, {
|
|
1142
1126
|
size: "sm",
|
|
1143
1127
|
variant: "ghost",
|
|
1144
1128
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
|
|
1145
|
-
onClick: () =>
|
|
1146
|
-
children: /* @__PURE__ */ (
|
|
1129
|
+
onClick: () => H(t),
|
|
1130
|
+
children: /* @__PURE__ */ S(P, { className: "h-4 w-4" })
|
|
1147
1131
|
})]
|
|
1148
|
-
}, t)),
|
|
1132
|
+
}, t)), k.length === 0 && /* @__PURE__ */ S("div", {
|
|
1149
1133
|
className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
|
|
1150
1134
|
children: "No filters defined."
|
|
1151
1135
|
})]
|
|
1152
1136
|
})]
|
|
1153
1137
|
}),
|
|
1154
|
-
/* @__PURE__ */ (
|
|
1138
|
+
/* @__PURE__ */ C(_, {
|
|
1155
1139
|
value: "grouping",
|
|
1156
1140
|
className: "space-y-4 mt-4",
|
|
1157
|
-
children: [/* @__PURE__ */ (
|
|
1141
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1158
1142
|
className: "flex items-center justify-between",
|
|
1159
|
-
children: [/* @__PURE__ */ (
|
|
1143
|
+
children: [/* @__PURE__ */ S(m, { children: "Grouping Rules" }), /* @__PURE__ */ C(a, {
|
|
1160
1144
|
size: "sm",
|
|
1161
1145
|
variant: "outline",
|
|
1162
|
-
onClick:
|
|
1163
|
-
children: [/* @__PURE__ */ (
|
|
1146
|
+
onClick: W,
|
|
1147
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Add Group"]
|
|
1164
1148
|
})]
|
|
1165
|
-
}), /* @__PURE__ */ (
|
|
1149
|
+
}), /* @__PURE__ */ C("div", {
|
|
1166
1150
|
className: "space-y-2",
|
|
1167
|
-
children: [
|
|
1151
|
+
children: [M.map((e, t) => /* @__PURE__ */ C("div", {
|
|
1168
1152
|
className: "flex items-center gap-2 p-3 border rounded-lg",
|
|
1169
|
-
children: [/* @__PURE__ */ (
|
|
1153
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1170
1154
|
className: "flex-1 grid grid-cols-2 gap-2",
|
|
1171
|
-
children: [/* @__PURE__ */ (
|
|
1155
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1172
1156
|
className: "text-xs",
|
|
1173
1157
|
children: "Field"
|
|
1174
|
-
}), /* @__PURE__ */ (
|
|
1158
|
+
}), /* @__PURE__ */ S("select", {
|
|
1175
1159
|
className: "w-full border rounded-md h-8 text-sm px-2",
|
|
1176
1160
|
value: e.field,
|
|
1177
|
-
onChange: (n) =>
|
|
1161
|
+
onChange: (n) => K(t, {
|
|
1178
1162
|
...e,
|
|
1179
1163
|
field: n.target.value
|
|
1180
1164
|
}),
|
|
1181
|
-
children: i.map((e, t) => /* @__PURE__ */ (
|
|
1165
|
+
children: i.map((e, t) => /* @__PURE__ */ S("option", {
|
|
1182
1166
|
value: e.name,
|
|
1183
1167
|
children: e.label || e.name
|
|
1184
1168
|
}, t))
|
|
1185
|
-
})] }), /* @__PURE__ */ (
|
|
1169
|
+
})] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1186
1170
|
className: "text-xs",
|
|
1187
1171
|
children: "Sort Order"
|
|
1188
|
-
}), /* @__PURE__ */ (
|
|
1172
|
+
}), /* @__PURE__ */ C("select", {
|
|
1189
1173
|
className: "w-full border rounded-md h-8 text-sm px-2",
|
|
1190
1174
|
value: e.sort || "asc",
|
|
1191
|
-
onChange: (n) =>
|
|
1175
|
+
onChange: (n) => K(t, {
|
|
1192
1176
|
...e,
|
|
1193
1177
|
sort: n.target.value
|
|
1194
1178
|
}),
|
|
1195
|
-
children: [/* @__PURE__ */ (
|
|
1179
|
+
children: [/* @__PURE__ */ S("option", {
|
|
1196
1180
|
value: "asc",
|
|
1197
1181
|
children: "Ascending"
|
|
1198
|
-
}), /* @__PURE__ */ (
|
|
1182
|
+
}), /* @__PURE__ */ S("option", {
|
|
1199
1183
|
value: "desc",
|
|
1200
1184
|
children: "Descending"
|
|
1201
1185
|
})]
|
|
1202
1186
|
})] })]
|
|
1203
|
-
}), /* @__PURE__ */ (
|
|
1187
|
+
}), /* @__PURE__ */ S(a, {
|
|
1204
1188
|
size: "sm",
|
|
1205
1189
|
variant: "ghost",
|
|
1206
1190
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
|
|
1207
|
-
onClick: () =>
|
|
1208
|
-
children: /* @__PURE__ */ (
|
|
1191
|
+
onClick: () => G(t),
|
|
1192
|
+
children: /* @__PURE__ */ S(P, { className: "h-4 w-4" })
|
|
1209
1193
|
})]
|
|
1210
|
-
}, t)),
|
|
1194
|
+
}, t)), M.length === 0 && /* @__PURE__ */ S("div", {
|
|
1211
1195
|
className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
|
|
1212
1196
|
children: "No grouping rules applied."
|
|
1213
1197
|
})]
|
|
1214
1198
|
})]
|
|
1215
1199
|
}),
|
|
1216
|
-
/* @__PURE__ */ (
|
|
1200
|
+
/* @__PURE__ */ C(_, {
|
|
1217
1201
|
value: "sections",
|
|
1218
1202
|
className: "space-y-4 mt-4",
|
|
1219
|
-
children: [/* @__PURE__ */ (
|
|
1203
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1220
1204
|
className: "flex items-center justify-between",
|
|
1221
|
-
children: [/* @__PURE__ */ (
|
|
1205
|
+
children: [/* @__PURE__ */ S(m, { children: "Report Sections" }), /* @__PURE__ */ C("div", {
|
|
1222
1206
|
className: "flex gap-2",
|
|
1223
1207
|
children: [
|
|
1224
|
-
/* @__PURE__ */ (
|
|
1208
|
+
/* @__PURE__ */ C(a, {
|
|
1225
1209
|
size: "sm",
|
|
1226
1210
|
variant: "outline",
|
|
1227
|
-
onClick: () =>
|
|
1228
|
-
children: [/* @__PURE__ */ (
|
|
1211
|
+
onClick: () => q("header"),
|
|
1212
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Header"]
|
|
1229
1213
|
}),
|
|
1230
|
-
/* @__PURE__ */ (
|
|
1214
|
+
/* @__PURE__ */ C(a, {
|
|
1231
1215
|
size: "sm",
|
|
1232
1216
|
variant: "outline",
|
|
1233
|
-
onClick: () =>
|
|
1234
|
-
children: [/* @__PURE__ */ (
|
|
1217
|
+
onClick: () => q("chart"),
|
|
1218
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Chart"]
|
|
1235
1219
|
}),
|
|
1236
|
-
/* @__PURE__ */ (
|
|
1220
|
+
/* @__PURE__ */ C(a, {
|
|
1237
1221
|
size: "sm",
|
|
1238
1222
|
variant: "outline",
|
|
1239
|
-
onClick: () =>
|
|
1240
|
-
children: [/* @__PURE__ */ (
|
|
1223
|
+
onClick: () => q("table"),
|
|
1224
|
+
children: [/* @__PURE__ */ S(A, { className: "h-4 w-4 mr-2" }), "Table"]
|
|
1241
1225
|
})
|
|
1242
1226
|
]
|
|
1243
1227
|
})]
|
|
1244
|
-
}), /* @__PURE__ */ (
|
|
1228
|
+
}), /* @__PURE__ */ C("div", {
|
|
1245
1229
|
className: "space-y-2",
|
|
1246
|
-
children: [
|
|
1230
|
+
children: [I.map((e, t) => /* @__PURE__ */ C("div", {
|
|
1247
1231
|
className: "p-3 border rounded-lg space-y-2",
|
|
1248
|
-
children: [/* @__PURE__ */ (
|
|
1232
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1249
1233
|
className: "flex items-center justify-between",
|
|
1250
|
-
children: [/* @__PURE__ */ (
|
|
1234
|
+
children: [/* @__PURE__ */ C("div", {
|
|
1251
1235
|
className: "font-medium flex items-center gap-2",
|
|
1252
|
-
children: [/* @__PURE__ */ (
|
|
1236
|
+
children: [/* @__PURE__ */ S("div", {
|
|
1253
1237
|
className: "text-xs bg-muted px-2 py-0.5 rounded uppercase",
|
|
1254
1238
|
children: e.type
|
|
1255
1239
|
}), e.title]
|
|
1256
|
-
}), /* @__PURE__ */ (
|
|
1240
|
+
}), /* @__PURE__ */ S(a, {
|
|
1257
1241
|
size: "sm",
|
|
1258
1242
|
variant: "ghost",
|
|
1259
1243
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50",
|
|
1260
|
-
onClick: () =>
|
|
1261
|
-
children: /* @__PURE__ */ (
|
|
1244
|
+
onClick: () => J(t),
|
|
1245
|
+
children: /* @__PURE__ */ S(P, { className: "h-4 w-4" })
|
|
1262
1246
|
})]
|
|
1263
|
-
}), /* @__PURE__ */ (
|
|
1247
|
+
}), /* @__PURE__ */ C("div", {
|
|
1264
1248
|
className: "grid grid-cols-2 gap-2",
|
|
1265
1249
|
children: [
|
|
1266
|
-
/* @__PURE__ */ (
|
|
1250
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1267
1251
|
className: "text-xs",
|
|
1268
1252
|
children: "Title"
|
|
1269
|
-
}), /* @__PURE__ */ (
|
|
1253
|
+
}), /* @__PURE__ */ S(p, {
|
|
1270
1254
|
className: "h-8 text-sm",
|
|
1271
1255
|
value: e.title || "",
|
|
1272
|
-
onChange: (n) =>
|
|
1256
|
+
onChange: (n) => Y(t, {
|
|
1273
1257
|
...e,
|
|
1274
1258
|
title: n.target.value
|
|
1275
1259
|
})
|
|
1276
1260
|
})] }),
|
|
1277
|
-
e.type === "text" && /* @__PURE__ */ (
|
|
1261
|
+
e.type === "text" && /* @__PURE__ */ C("div", {
|
|
1278
1262
|
className: "col-span-2",
|
|
1279
|
-
children: [/* @__PURE__ */ (
|
|
1263
|
+
children: [/* @__PURE__ */ S(m, {
|
|
1280
1264
|
className: "text-xs",
|
|
1281
1265
|
children: "Content"
|
|
1282
|
-
}), /* @__PURE__ */ (
|
|
1266
|
+
}), /* @__PURE__ */ S(p, {
|
|
1283
1267
|
className: "h-8 text-sm",
|
|
1284
1268
|
value: e.text || "",
|
|
1285
|
-
onChange: (n) =>
|
|
1269
|
+
onChange: (n) => Y(t, {
|
|
1286
1270
|
...e,
|
|
1287
1271
|
text: n.target.value
|
|
1288
1272
|
})
|
|
1289
1273
|
})]
|
|
1290
1274
|
}),
|
|
1291
|
-
e.type === "chart" && /* @__PURE__ */ (
|
|
1275
|
+
e.type === "chart" && /* @__PURE__ */ C("div", {
|
|
1292
1276
|
className: "col-span-2 grid grid-cols-2 gap-2 mt-2 p-2 bg-muted/20 rounded",
|
|
1293
1277
|
children: [
|
|
1294
|
-
/* @__PURE__ */ (
|
|
1278
|
+
/* @__PURE__ */ S("div", {
|
|
1295
1279
|
className: "col-span-2",
|
|
1296
|
-
children: /* @__PURE__ */ (
|
|
1280
|
+
children: /* @__PURE__ */ S(m, {
|
|
1297
1281
|
className: "text-xs font-semibold",
|
|
1298
1282
|
children: "Chart Configuration"
|
|
1299
1283
|
})
|
|
1300
1284
|
}),
|
|
1301
|
-
/* @__PURE__ */ (
|
|
1285
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1302
1286
|
className: "text-xs",
|
|
1303
1287
|
children: "Chart Type"
|
|
1304
|
-
}), /* @__PURE__ */ (
|
|
1288
|
+
}), /* @__PURE__ */ C("select", {
|
|
1305
1289
|
className: "flex h-8 w-full rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1306
1290
|
value: e.chart?.chartType || "bar",
|
|
1307
|
-
onChange: (n) =>
|
|
1291
|
+
onChange: (n) => Y(t, {
|
|
1308
1292
|
...e,
|
|
1309
1293
|
chart: {
|
|
1310
1294
|
...e.chart,
|
|
@@ -1313,31 +1297,31 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
1313
1297
|
}
|
|
1314
1298
|
}),
|
|
1315
1299
|
children: [
|
|
1316
|
-
/* @__PURE__ */ (
|
|
1300
|
+
/* @__PURE__ */ S("option", {
|
|
1317
1301
|
value: "bar",
|
|
1318
1302
|
children: "Bar"
|
|
1319
1303
|
}),
|
|
1320
|
-
/* @__PURE__ */ (
|
|
1304
|
+
/* @__PURE__ */ S("option", {
|
|
1321
1305
|
value: "line",
|
|
1322
1306
|
children: "Line"
|
|
1323
1307
|
}),
|
|
1324
|
-
/* @__PURE__ */ (
|
|
1308
|
+
/* @__PURE__ */ S("option", {
|
|
1325
1309
|
value: "area",
|
|
1326
1310
|
children: "Area"
|
|
1327
1311
|
}),
|
|
1328
|
-
/* @__PURE__ */ (
|
|
1312
|
+
/* @__PURE__ */ S("option", {
|
|
1329
1313
|
value: "pie",
|
|
1330
1314
|
children: "Pie"
|
|
1331
1315
|
})
|
|
1332
1316
|
]
|
|
1333
1317
|
})] }),
|
|
1334
|
-
/* @__PURE__ */ (
|
|
1318
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(m, {
|
|
1335
1319
|
className: "text-xs",
|
|
1336
1320
|
children: "X-Axis Field"
|
|
1337
|
-
}), /* @__PURE__ */ (
|
|
1321
|
+
}), /* @__PURE__ */ C("select", {
|
|
1338
1322
|
className: "flex h-8 w-full rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1339
1323
|
value: e.chart?.xAxisField || "",
|
|
1340
|
-
onChange: (n) =>
|
|
1324
|
+
onChange: (n) => Y(t, {
|
|
1341
1325
|
...e,
|
|
1342
1326
|
chart: {
|
|
1343
1327
|
...e.chart,
|
|
@@ -1346,33 +1330,33 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
1346
1330
|
}
|
|
1347
1331
|
}),
|
|
1348
1332
|
children: [
|
|
1349
|
-
/* @__PURE__ */ (
|
|
1333
|
+
/* @__PURE__ */ S("option", {
|
|
1350
1334
|
value: "",
|
|
1351
1335
|
children: "Select Field..."
|
|
1352
1336
|
}),
|
|
1353
|
-
i.map((e) => /* @__PURE__ */ (
|
|
1337
|
+
i.map((e) => /* @__PURE__ */ S("option", {
|
|
1354
1338
|
value: e.name,
|
|
1355
1339
|
children: e.label || e.name
|
|
1356
1340
|
}, e.name)),
|
|
1357
|
-
i.length === 0 && /* @__PURE__ */ (
|
|
1341
|
+
i.length === 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("option", {
|
|
1358
1342
|
value: "name",
|
|
1359
1343
|
children: "Name"
|
|
1360
|
-
}), /* @__PURE__ */ (
|
|
1344
|
+
}), /* @__PURE__ */ S("option", {
|
|
1361
1345
|
value: "month",
|
|
1362
1346
|
children: "Month"
|
|
1363
1347
|
})] })
|
|
1364
1348
|
]
|
|
1365
1349
|
})] }),
|
|
1366
|
-
/* @__PURE__ */ (
|
|
1350
|
+
/* @__PURE__ */ C("div", {
|
|
1367
1351
|
className: "col-span-2",
|
|
1368
|
-
children: [/* @__PURE__ */ (
|
|
1352
|
+
children: [/* @__PURE__ */ S(m, {
|
|
1369
1353
|
className: "text-xs",
|
|
1370
1354
|
children: "Y-Axis Fields (comma separated)"
|
|
1371
|
-
}), /* @__PURE__ */ (
|
|
1355
|
+
}), /* @__PURE__ */ S(p, {
|
|
1372
1356
|
className: "h-8 text-sm",
|
|
1373
1357
|
placeholder: "e.g. value, count",
|
|
1374
1358
|
value: e.chart?.yAxisFields?.join(", ") || "",
|
|
1375
|
-
onChange: (n) =>
|
|
1359
|
+
onChange: (n) => Y(t, {
|
|
1376
1360
|
...e,
|
|
1377
1361
|
chart: {
|
|
1378
1362
|
...e.chart,
|
|
@@ -1386,56 +1370,56 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
1386
1370
|
})
|
|
1387
1371
|
]
|
|
1388
1372
|
})]
|
|
1389
|
-
}, t)),
|
|
1373
|
+
}, t)), I.length === 0 && /* @__PURE__ */ S("div", {
|
|
1390
1374
|
className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
|
|
1391
1375
|
children: "No customized sections. The default report layout will be used."
|
|
1392
1376
|
})]
|
|
1393
1377
|
})]
|
|
1394
1378
|
}),
|
|
1395
|
-
/* @__PURE__ */ (
|
|
1379
|
+
/* @__PURE__ */ S(_, {
|
|
1396
1380
|
value: "schedule",
|
|
1397
1381
|
className: "space-y-4 mt-4",
|
|
1398
|
-
children: /* @__PURE__ */ (
|
|
1382
|
+
children: /* @__PURE__ */ S(Z, {
|
|
1399
1383
|
schedule: b.schedule,
|
|
1400
|
-
onChange: (e) =>
|
|
1384
|
+
onChange: (e) => w({
|
|
1401
1385
|
...b,
|
|
1402
1386
|
schedule: e
|
|
1403
1387
|
})
|
|
1404
1388
|
})
|
|
1405
1389
|
})
|
|
1406
1390
|
]
|
|
1407
|
-
}), /* @__PURE__ */ (
|
|
1391
|
+
}), /* @__PURE__ */ C("div", {
|
|
1408
1392
|
className: "flex items-center justify-end gap-2 mt-6 pt-4 border-t",
|
|
1409
|
-
children: [/* @__PURE__ */ (
|
|
1393
|
+
children: [/* @__PURE__ */ S(a, {
|
|
1410
1394
|
variant: "outline",
|
|
1411
1395
|
onClick: () => {
|
|
1412
1396
|
h && console.log("Report cancelled:", h);
|
|
1413
1397
|
},
|
|
1414
1398
|
children: "Cancel"
|
|
1415
|
-
}), /* @__PURE__ */ (
|
|
1399
|
+
}), /* @__PURE__ */ C(a, {
|
|
1416
1400
|
onClick: () => {
|
|
1417
1401
|
console.log("Saving report:", b), f && alert("Report saved! (Handler: " + f + ")");
|
|
1418
1402
|
},
|
|
1419
|
-
children: [/* @__PURE__ */ (
|
|
1403
|
+
children: [/* @__PURE__ */ S(N, { className: "h-4 w-4 mr-2" }), "Save Report"]
|
|
1420
1404
|
})]
|
|
1421
|
-
})] })] }), d && /* @__PURE__ */ (
|
|
1405
|
+
})] })] }), d && /* @__PURE__ */ C(o, {
|
|
1422
1406
|
className: "mt-8 border-2 border-blue-100",
|
|
1423
|
-
children: [/* @__PURE__ */ (
|
|
1407
|
+
children: [/* @__PURE__ */ S(l, {
|
|
1424
1408
|
className: "bg-blue-50/50",
|
|
1425
|
-
children: /* @__PURE__ */ (
|
|
1409
|
+
children: /* @__PURE__ */ S(u, {
|
|
1426
1410
|
className: "text-blue-900 text-sm uppercase tracking-wide",
|
|
1427
1411
|
children: "Live Preview"
|
|
1428
1412
|
})
|
|
1429
|
-
}), /* @__PURE__ */ (
|
|
1413
|
+
}), /* @__PURE__ */ S(s, {
|
|
1430
1414
|
className: "pt-6",
|
|
1431
|
-
children: /* @__PURE__ */ (
|
|
1415
|
+
children: /* @__PURE__ */ S(X, { schema: {
|
|
1432
1416
|
type: "report-viewer",
|
|
1433
1417
|
report: {
|
|
1434
1418
|
...b,
|
|
1435
|
-
fields:
|
|
1436
|
-
filters:
|
|
1437
|
-
groupBy:
|
|
1438
|
-
sections:
|
|
1419
|
+
fields: E,
|
|
1420
|
+
filters: k,
|
|
1421
|
+
groupBy: M,
|
|
1422
|
+
sections: I
|
|
1439
1423
|
},
|
|
1440
1424
|
data: [
|
|
1441
1425
|
{
|
|
@@ -1461,7 +1445,7 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
1461
1445
|
})]
|
|
1462
1446
|
})]
|
|
1463
1447
|
});
|
|
1464
|
-
},
|
|
1448
|
+
}, re = [
|
|
1465
1449
|
{
|
|
1466
1450
|
value: "",
|
|
1467
1451
|
label: "None"
|
|
@@ -1487,7 +1471,7 @@ var Y = ({ schema: t, onRefresh: r }) => {
|
|
|
1487
1471
|
label: "Max"
|
|
1488
1472
|
}
|
|
1489
1473
|
];
|
|
1490
|
-
function
|
|
1474
|
+
function ie({ availableFields: e, value: t, onChange: n }) {
|
|
1491
1475
|
let r = Array.isArray(t) ? t.map((e) => typeof e == "string" ? {
|
|
1492
1476
|
name: e,
|
|
1493
1477
|
label: e,
|
|
@@ -1516,40 +1500,40 @@ function ae({ availableFields: e, value: t, onChange: n }) {
|
|
|
1516
1500
|
showInSummary: !!t
|
|
1517
1501
|
} : n));
|
|
1518
1502
|
};
|
|
1519
|
-
return e.length === 0 ? /* @__PURE__ */ (
|
|
1503
|
+
return e.length === 0 ? /* @__PURE__ */ S("div", {
|
|
1520
1504
|
className: "text-xs text-muted-foreground py-2",
|
|
1521
1505
|
"data-testid": "field-picker-empty",
|
|
1522
1506
|
children: "No fields available"
|
|
1523
|
-
}) : /* @__PURE__ */ (
|
|
1507
|
+
}) : /* @__PURE__ */ S("div", {
|
|
1524
1508
|
className: "space-y-1 py-1",
|
|
1525
1509
|
"data-testid": "field-picker",
|
|
1526
1510
|
children: e.map((e) => {
|
|
1527
1511
|
let t = i.includes(e.value), n = r.find((t) => t.name === e.value);
|
|
1528
|
-
return /* @__PURE__ */ (
|
|
1512
|
+
return /* @__PURE__ */ C("div", {
|
|
1529
1513
|
className: "flex items-center gap-2 px-1 py-0.5 rounded hover:bg-muted/50 text-xs",
|
|
1530
|
-
children: [/* @__PURE__ */ (
|
|
1514
|
+
children: [/* @__PURE__ */ C("label", {
|
|
1531
1515
|
className: "flex items-center gap-2 flex-1 cursor-pointer",
|
|
1532
1516
|
children: [
|
|
1533
|
-
/* @__PURE__ */ (
|
|
1517
|
+
/* @__PURE__ */ S(d, {
|
|
1534
1518
|
checked: t,
|
|
1535
1519
|
onCheckedChange: () => a(e.value),
|
|
1536
1520
|
"data-testid": `field-picker-${e.value}`
|
|
1537
1521
|
}),
|
|
1538
|
-
/* @__PURE__ */ (
|
|
1522
|
+
/* @__PURE__ */ S("span", {
|
|
1539
1523
|
className: "flex-1",
|
|
1540
1524
|
children: e.label
|
|
1541
1525
|
}),
|
|
1542
|
-
e.type && /* @__PURE__ */ (
|
|
1526
|
+
e.type && /* @__PURE__ */ S("span", {
|
|
1543
1527
|
className: "text-[10px] text-muted-foreground",
|
|
1544
1528
|
children: e.type
|
|
1545
1529
|
})
|
|
1546
1530
|
]
|
|
1547
|
-
}), t && /* @__PURE__ */ (
|
|
1531
|
+
}), t && /* @__PURE__ */ S("select", {
|
|
1548
1532
|
className: "h-5 text-[10px] border rounded px-1 bg-background",
|
|
1549
1533
|
value: n?.aggregation || "",
|
|
1550
1534
|
onChange: (t) => o(e.value, t.target.value),
|
|
1551
1535
|
"data-testid": `field-agg-${e.value}`,
|
|
1552
|
-
children:
|
|
1536
|
+
children: re.map((e) => /* @__PURE__ */ S("option", {
|
|
1553
1537
|
value: e.value,
|
|
1554
1538
|
children: e.label
|
|
1555
1539
|
}, e.value))
|
|
@@ -1558,7 +1542,7 @@ function ae({ availableFields: e, value: t, onChange: n }) {
|
|
|
1558
1542
|
})
|
|
1559
1543
|
});
|
|
1560
1544
|
}
|
|
1561
|
-
var
|
|
1545
|
+
var ae = [
|
|
1562
1546
|
{
|
|
1563
1547
|
value: "",
|
|
1564
1548
|
label: "None"
|
|
@@ -1588,60 +1572,60 @@ var oe = [
|
|
|
1588
1572
|
label: "Scatter Plot"
|
|
1589
1573
|
}
|
|
1590
1574
|
];
|
|
1591
|
-
function
|
|
1575
|
+
function oe({ availableFields: e, value: t, onChange: n }) {
|
|
1592
1576
|
let r = t || {}, i = (e) => n({
|
|
1593
1577
|
...r,
|
|
1594
1578
|
...e
|
|
1595
1579
|
});
|
|
1596
|
-
return /* @__PURE__ */ (
|
|
1580
|
+
return /* @__PURE__ */ C("div", {
|
|
1597
1581
|
className: "space-y-2 py-1",
|
|
1598
1582
|
"data-testid": "chart-config",
|
|
1599
|
-
children: [/* @__PURE__ */ (
|
|
1583
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
1600
1584
|
className: "text-[10px] text-muted-foreground",
|
|
1601
1585
|
children: "Chart type"
|
|
1602
|
-
}), /* @__PURE__ */ (
|
|
1586
|
+
}), /* @__PURE__ */ S("select", {
|
|
1603
1587
|
className: "w-full h-7 text-xs border rounded px-2 bg-background",
|
|
1604
1588
|
value: r.chartType || "",
|
|
1605
1589
|
onChange: (e) => i({ chartType: e.target.value || void 0 }),
|
|
1606
1590
|
"data-testid": "chart-type-select",
|
|
1607
|
-
children:
|
|
1591
|
+
children: ae.map((e) => /* @__PURE__ */ S("option", {
|
|
1608
1592
|
value: e.value,
|
|
1609
1593
|
children: e.label
|
|
1610
1594
|
}, e.value))
|
|
1611
|
-
})] }), r.chartType && /* @__PURE__ */ (
|
|
1595
|
+
})] }), r.chartType && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
1612
1596
|
className: "text-[10px] text-muted-foreground",
|
|
1613
1597
|
children: "X-axis field"
|
|
1614
|
-
}), /* @__PURE__ */ (
|
|
1598
|
+
}), /* @__PURE__ */ C("select", {
|
|
1615
1599
|
className: "w-full h-7 text-xs border rounded px-2 bg-background",
|
|
1616
1600
|
value: r.xAxisField || "",
|
|
1617
1601
|
onChange: (e) => i({ xAxisField: e.target.value || void 0 }),
|
|
1618
1602
|
"data-testid": "chart-x-field",
|
|
1619
|
-
children: [/* @__PURE__ */ (
|
|
1603
|
+
children: [/* @__PURE__ */ S("option", {
|
|
1620
1604
|
value: "",
|
|
1621
1605
|
children: "Select field…"
|
|
1622
|
-
}), e.map((e) => /* @__PURE__ */ (
|
|
1606
|
+
}), e.map((e) => /* @__PURE__ */ S("option", {
|
|
1623
1607
|
value: e.value,
|
|
1624
1608
|
children: e.label
|
|
1625
1609
|
}, e.value))]
|
|
1626
|
-
})] }), /* @__PURE__ */ (
|
|
1610
|
+
})] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
1627
1611
|
className: "text-[10px] text-muted-foreground",
|
|
1628
1612
|
children: "Y-axis field"
|
|
1629
|
-
}), /* @__PURE__ */ (
|
|
1613
|
+
}), /* @__PURE__ */ C("select", {
|
|
1630
1614
|
className: "w-full h-7 text-xs border rounded px-2 bg-background",
|
|
1631
1615
|
value: r.yAxisFields?.[0] || "",
|
|
1632
1616
|
onChange: (e) => i({ yAxisFields: e.target.value ? [e.target.value] : [] }),
|
|
1633
1617
|
"data-testid": "chart-y-field",
|
|
1634
|
-
children: [/* @__PURE__ */ (
|
|
1618
|
+
children: [/* @__PURE__ */ S("option", {
|
|
1635
1619
|
value: "",
|
|
1636
1620
|
children: "Select field…"
|
|
1637
|
-
}), e.filter((e) => e.type === "number").map((e) => /* @__PURE__ */ (
|
|
1621
|
+
}), e.filter((e) => e.type === "number").map((e) => /* @__PURE__ */ S("option", {
|
|
1638
1622
|
value: e.value,
|
|
1639
1623
|
children: e.label
|
|
1640
1624
|
}, e.value))]
|
|
1641
1625
|
})] })] })]
|
|
1642
1626
|
});
|
|
1643
1627
|
}
|
|
1644
|
-
var
|
|
1628
|
+
var se = [
|
|
1645
1629
|
{
|
|
1646
1630
|
value: "equals",
|
|
1647
1631
|
label: "="
|
|
@@ -1663,7 +1647,7 @@ var ce = [
|
|
|
1663
1647
|
label: "Contains"
|
|
1664
1648
|
}
|
|
1665
1649
|
];
|
|
1666
|
-
function
|
|
1650
|
+
function ce({ availableFields: e, value: t, onChange: n }) {
|
|
1667
1651
|
let r = Array.isArray(t) ? t : [], i = () => {
|
|
1668
1652
|
n([...r, {
|
|
1669
1653
|
field: e[0]?.value || "",
|
|
@@ -1680,67 +1664,67 @@ function le({ availableFields: e, value: t, onChange: n }) {
|
|
|
1680
1664
|
...t
|
|
1681
1665
|
} : n));
|
|
1682
1666
|
};
|
|
1683
|
-
return /* @__PURE__ */ (
|
|
1667
|
+
return /* @__PURE__ */ C("div", {
|
|
1684
1668
|
className: "space-y-2 py-1",
|
|
1685
1669
|
"data-testid": "conditional-format-rules",
|
|
1686
|
-
children: [r.map((t, n) => /* @__PURE__ */ (
|
|
1670
|
+
children: [r.map((t, n) => /* @__PURE__ */ C("div", {
|
|
1687
1671
|
className: "flex items-center gap-1 text-[10px] p-1 border rounded bg-muted/20",
|
|
1688
1672
|
children: [
|
|
1689
|
-
/* @__PURE__ */ (
|
|
1673
|
+
/* @__PURE__ */ S("select", {
|
|
1690
1674
|
className: "h-5 text-[10px] border rounded px-1 bg-background flex-1",
|
|
1691
1675
|
value: t.field,
|
|
1692
1676
|
onChange: (e) => s(n, { field: e.target.value }),
|
|
1693
1677
|
"data-testid": `cf-rule-field-${n}`,
|
|
1694
|
-
children: e.map((e) => /* @__PURE__ */ (
|
|
1678
|
+
children: e.map((e) => /* @__PURE__ */ S("option", {
|
|
1695
1679
|
value: e.value,
|
|
1696
1680
|
children: e.label
|
|
1697
1681
|
}, e.value))
|
|
1698
1682
|
}),
|
|
1699
|
-
/* @__PURE__ */ (
|
|
1683
|
+
/* @__PURE__ */ S("select", {
|
|
1700
1684
|
className: "h-5 text-[10px] border rounded px-1 bg-background w-12",
|
|
1701
1685
|
value: t.operator,
|
|
1702
1686
|
onChange: (e) => s(n, { operator: e.target.value }),
|
|
1703
|
-
children:
|
|
1687
|
+
children: se.map((e) => /* @__PURE__ */ S("option", {
|
|
1704
1688
|
value: e.value,
|
|
1705
1689
|
children: e.label
|
|
1706
1690
|
}, e.value))
|
|
1707
1691
|
}),
|
|
1708
|
-
/* @__PURE__ */ (
|
|
1692
|
+
/* @__PURE__ */ S("input", {
|
|
1709
1693
|
className: "h-5 text-[10px] border rounded px-1 bg-background w-16",
|
|
1710
1694
|
value: t.value,
|
|
1711
1695
|
placeholder: "value",
|
|
1712
1696
|
onChange: (e) => s(n, { value: e.target.value }),
|
|
1713
1697
|
"data-testid": `cf-rule-value-${n}`
|
|
1714
1698
|
}),
|
|
1715
|
-
/* @__PURE__ */ (
|
|
1699
|
+
/* @__PURE__ */ S("input", {
|
|
1716
1700
|
type: "color",
|
|
1717
1701
|
className: "h-5 w-5 rounded border cursor-pointer",
|
|
1718
1702
|
value: t.backgroundColor || "#fef9c3",
|
|
1719
1703
|
onChange: (e) => s(n, { backgroundColor: e.target.value }),
|
|
1720
1704
|
title: "Background color"
|
|
1721
1705
|
}),
|
|
1722
|
-
/* @__PURE__ */ (
|
|
1706
|
+
/* @__PURE__ */ S(a, {
|
|
1723
1707
|
type: "button",
|
|
1724
1708
|
size: "sm",
|
|
1725
1709
|
variant: "ghost",
|
|
1726
1710
|
className: "h-5 w-5 p-0",
|
|
1727
1711
|
onClick: () => o(n),
|
|
1728
1712
|
"data-testid": `cf-rule-remove-${n}`,
|
|
1729
|
-
children: /* @__PURE__ */ (
|
|
1713
|
+
children: /* @__PURE__ */ S(P, { className: "h-3 w-3" })
|
|
1730
1714
|
})
|
|
1731
1715
|
]
|
|
1732
|
-
}, n)), /* @__PURE__ */ (
|
|
1716
|
+
}, n)), /* @__PURE__ */ C(a, {
|
|
1733
1717
|
type: "button",
|
|
1734
1718
|
size: "sm",
|
|
1735
1719
|
variant: "outline",
|
|
1736
1720
|
className: "h-6 text-[10px] w-full",
|
|
1737
1721
|
onClick: i,
|
|
1738
1722
|
"data-testid": "cf-add-rule",
|
|
1739
|
-
children: [/* @__PURE__ */ (
|
|
1723
|
+
children: [/* @__PURE__ */ S(A, { className: "h-3 w-3 mr-1" }), "Add Rule"]
|
|
1740
1724
|
})]
|
|
1741
1725
|
});
|
|
1742
1726
|
}
|
|
1743
|
-
var
|
|
1727
|
+
var le = [
|
|
1744
1728
|
{
|
|
1745
1729
|
value: "header",
|
|
1746
1730
|
label: "Header"
|
|
@@ -1762,7 +1746,7 @@ var ue = [
|
|
|
1762
1746
|
label: "Text"
|
|
1763
1747
|
}
|
|
1764
1748
|
];
|
|
1765
|
-
function
|
|
1749
|
+
function ue({ value: e, onChange: t }) {
|
|
1766
1750
|
let n = Array.isArray(e) ? e : [], r = (e) => {
|
|
1767
1751
|
t([...n, {
|
|
1768
1752
|
type: e,
|
|
@@ -1782,22 +1766,22 @@ function de({ value: e, onChange: t }) {
|
|
|
1782
1766
|
let a = [...n];
|
|
1783
1767
|
[a[e], a[i]] = [a[i], a[e]], t(a);
|
|
1784
1768
|
};
|
|
1785
|
-
return /* @__PURE__ */ (
|
|
1769
|
+
return /* @__PURE__ */ C("div", {
|
|
1786
1770
|
className: "space-y-2 py-1",
|
|
1787
1771
|
"data-testid": "section-manager",
|
|
1788
|
-
children: [n.map((e, t) => /* @__PURE__ */ (
|
|
1772
|
+
children: [n.map((e, t) => /* @__PURE__ */ C("div", {
|
|
1789
1773
|
className: "flex items-center gap-1 text-[10px] p-1.5 border rounded bg-muted/20",
|
|
1790
1774
|
children: [
|
|
1791
|
-
/* @__PURE__ */ (
|
|
1775
|
+
/* @__PURE__ */ C("div", {
|
|
1792
1776
|
className: "flex flex-col gap-0.5 mr-1",
|
|
1793
|
-
children: [/* @__PURE__ */ (
|
|
1777
|
+
children: [/* @__PURE__ */ S("button", {
|
|
1794
1778
|
type: "button",
|
|
1795
1779
|
className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
|
|
1796
1780
|
disabled: t === 0,
|
|
1797
1781
|
onClick: () => s(t, -1),
|
|
1798
1782
|
"data-testid": `section-up-${t}`,
|
|
1799
1783
|
children: "▲"
|
|
1800
|
-
}), /* @__PURE__ */ (
|
|
1784
|
+
}), /* @__PURE__ */ S("button", {
|
|
1801
1785
|
type: "button",
|
|
1802
1786
|
className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
|
|
1803
1787
|
disabled: t === n.length - 1,
|
|
@@ -1806,42 +1790,42 @@ function de({ value: e, onChange: t }) {
|
|
|
1806
1790
|
children: "▼"
|
|
1807
1791
|
})]
|
|
1808
1792
|
}),
|
|
1809
|
-
/* @__PURE__ */ (
|
|
1793
|
+
/* @__PURE__ */ S("span", {
|
|
1810
1794
|
className: "text-[9px] bg-muted px-1.5 py-0.5 rounded uppercase font-medium shrink-0",
|
|
1811
1795
|
children: e.type
|
|
1812
1796
|
}),
|
|
1813
|
-
/* @__PURE__ */ (
|
|
1797
|
+
/* @__PURE__ */ S("input", {
|
|
1814
1798
|
className: "h-5 text-[10px] border rounded px-1 bg-background flex-1 min-w-0",
|
|
1815
1799
|
value: e.title || "",
|
|
1816
1800
|
placeholder: "Section title",
|
|
1817
1801
|
onChange: (e) => o(t, { title: e.target.value }),
|
|
1818
1802
|
"data-testid": `section-title-${t}`
|
|
1819
1803
|
}),
|
|
1820
|
-
/* @__PURE__ */ (
|
|
1804
|
+
/* @__PURE__ */ S(a, {
|
|
1821
1805
|
type: "button",
|
|
1822
1806
|
size: "sm",
|
|
1823
1807
|
variant: "ghost",
|
|
1824
1808
|
className: "h-5 w-5 p-0 shrink-0",
|
|
1825
1809
|
onClick: () => i(t),
|
|
1826
1810
|
"data-testid": `section-remove-${t}`,
|
|
1827
|
-
children: /* @__PURE__ */ (
|
|
1811
|
+
children: /* @__PURE__ */ S(P, { className: "h-3 w-3" })
|
|
1828
1812
|
})
|
|
1829
1813
|
]
|
|
1830
|
-
}, t)), /* @__PURE__ */ (
|
|
1814
|
+
}, t)), /* @__PURE__ */ S("div", {
|
|
1831
1815
|
className: "flex gap-1 flex-wrap",
|
|
1832
|
-
children:
|
|
1816
|
+
children: le.map((e) => /* @__PURE__ */ C(a, {
|
|
1833
1817
|
type: "button",
|
|
1834
1818
|
size: "sm",
|
|
1835
1819
|
variant: "outline",
|
|
1836
1820
|
className: "h-6 text-[10px]",
|
|
1837
1821
|
onClick: () => r(e.value),
|
|
1838
1822
|
"data-testid": `section-add-${e.value}`,
|
|
1839
|
-
children: [/* @__PURE__ */ (
|
|
1823
|
+
children: [/* @__PURE__ */ S(A, { className: "h-3 w-3 mr-0.5" }), e.label]
|
|
1840
1824
|
}, e.value))
|
|
1841
1825
|
})]
|
|
1842
1826
|
});
|
|
1843
1827
|
}
|
|
1844
|
-
function
|
|
1828
|
+
function de(e = []) {
|
|
1845
1829
|
return {
|
|
1846
1830
|
breadcrumb: ["Report", "Configuration"],
|
|
1847
1831
|
sections: [
|
|
@@ -1911,7 +1895,7 @@ function fe(e = []) {
|
|
|
1911
1895
|
key: "fields",
|
|
1912
1896
|
label: "Report columns",
|
|
1913
1897
|
type: "custom",
|
|
1914
|
-
render: (t, n) => /* @__PURE__ */ (
|
|
1898
|
+
render: (t, n) => /* @__PURE__ */ S(ie, {
|
|
1915
1899
|
availableFields: e,
|
|
1916
1900
|
value: t,
|
|
1917
1901
|
onChange: n
|
|
@@ -1951,7 +1935,7 @@ function fe(e = []) {
|
|
|
1951
1935
|
key: "chartConfig",
|
|
1952
1936
|
label: "Chart",
|
|
1953
1937
|
type: "custom",
|
|
1954
|
-
render: (t, n) => /* @__PURE__ */ (
|
|
1938
|
+
render: (t, n) => /* @__PURE__ */ S(oe, {
|
|
1955
1939
|
availableFields: e,
|
|
1956
1940
|
value: t,
|
|
1957
1941
|
onChange: n
|
|
@@ -1968,7 +1952,7 @@ function fe(e = []) {
|
|
|
1968
1952
|
key: "conditionalFormatting",
|
|
1969
1953
|
label: "Rules",
|
|
1970
1954
|
type: "custom",
|
|
1971
|
-
render: (t, n) => /* @__PURE__ */ (
|
|
1955
|
+
render: (t, n) => /* @__PURE__ */ S(ce, {
|
|
1972
1956
|
availableFields: e,
|
|
1973
1957
|
value: t,
|
|
1974
1958
|
onChange: n
|
|
@@ -1985,7 +1969,7 @@ function fe(e = []) {
|
|
|
1985
1969
|
key: "sections",
|
|
1986
1970
|
label: "Report sections",
|
|
1987
1971
|
type: "custom",
|
|
1988
|
-
render: (e, t) => /* @__PURE__ */ (
|
|
1972
|
+
render: (e, t) => /* @__PURE__ */ S(ue, {
|
|
1989
1973
|
value: e,
|
|
1990
1974
|
onChange: t
|
|
1991
1975
|
})
|
|
@@ -2048,7 +2032,7 @@ function fe(e = []) {
|
|
|
2048
2032
|
key: "schedule",
|
|
2049
2033
|
label: "Schedule",
|
|
2050
2034
|
type: "custom",
|
|
2051
|
-
render: (e, t) => /* @__PURE__ */ (
|
|
2035
|
+
render: (e, t) => /* @__PURE__ */ S(Z, {
|
|
2052
2036
|
schedule: e,
|
|
2053
2037
|
onChange: t
|
|
2054
2038
|
})
|
|
@@ -2092,12 +2076,12 @@ function fe(e = []) {
|
|
|
2092
2076
|
]
|
|
2093
2077
|
};
|
|
2094
2078
|
}
|
|
2095
|
-
function
|
|
2079
|
+
function fe({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, availableFields: o }) {
|
|
2096
2080
|
let { draft: s, isDirty: c, updateField: l, discard: u, undo: d, redo: p, canUndo: m, canRedo: h } = b(r, { onUpdate: a });
|
|
2097
|
-
return /* @__PURE__ */ (
|
|
2081
|
+
return /* @__PURE__ */ S(f, {
|
|
2098
2082
|
open: e,
|
|
2099
2083
|
onClose: n,
|
|
2100
|
-
schema: t.useMemo(() =>
|
|
2084
|
+
schema: t.useMemo(() => de(o), [o]),
|
|
2101
2085
|
draft: s,
|
|
2102
2086
|
isDirty: c,
|
|
2103
2087
|
onFieldChange: l,
|
|
@@ -2111,11 +2095,11 @@ function pe({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, avail
|
|
|
2111
2095
|
}
|
|
2112
2096
|
//#endregion
|
|
2113
2097
|
//#region src/LiveReportExporter.ts
|
|
2114
|
-
async function
|
|
2098
|
+
async function $(e, t) {
|
|
2115
2099
|
let { dataSource: n, resource: r, queryParams: i, format: a, exportConfig: o } = t, s = a || e.defaultExportFormat || "pdf";
|
|
2116
2100
|
try {
|
|
2117
2101
|
let t = (await n.find(r, i)).data || [];
|
|
2118
|
-
return
|
|
2102
|
+
return V(s, e, t, {
|
|
2119
2103
|
format: s,
|
|
2120
2104
|
...e.exportConfigs?.[s],
|
|
2121
2105
|
...o
|
|
@@ -2133,7 +2117,7 @@ async function Q(e, t) {
|
|
|
2133
2117
|
};
|
|
2134
2118
|
}
|
|
2135
2119
|
}
|
|
2136
|
-
function
|
|
2120
|
+
function pe(e, t, n = {}) {
|
|
2137
2121
|
let { columns: r, filename: i, includeAggregationRow: a = !1 } = n, o = r || (e.fields || []).map(he), s = o.map((e) => e.header), c = t.map((e, t) => o.map((n) => {
|
|
2138
2122
|
if (n.formula) return n.formula.replace(/\{ROW\}/g, String(t + 2));
|
|
2139
2123
|
let r = e[n.name];
|
|
@@ -2159,13 +2143,13 @@ function me(e, t, n = {}) {
|
|
|
2159
2143
|
}
|
|
2160
2144
|
be("" + [s.join(" "), ...c.map((e) => e.join(" "))].join("\n"), i || `${e.title || "report"}.tsv`, "text/tab-separated-values");
|
|
2161
2145
|
}
|
|
2162
|
-
function
|
|
2146
|
+
function me(e, t, n, r) {
|
|
2163
2147
|
return async () => {
|
|
2164
2148
|
let i = e.schedule;
|
|
2165
2149
|
if (!i?.enabled) return [];
|
|
2166
2150
|
let a = i.formats || [e.defaultExportFormat || "pdf"], o = [];
|
|
2167
2151
|
for (let r of a) {
|
|
2168
|
-
let i = await
|
|
2152
|
+
let i = await $(e, {
|
|
2169
2153
|
dataSource: t,
|
|
2170
2154
|
resource: n,
|
|
2171
2155
|
format: r
|
|
@@ -2211,7 +2195,7 @@ function be(e, t, n) {
|
|
|
2211
2195
|
let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
2212
2196
|
a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
2213
2197
|
}
|
|
2214
|
-
e.register("report",
|
|
2198
|
+
e.register("report", F, {
|
|
2215
2199
|
namespace: "report",
|
|
2216
2200
|
label: "Report",
|
|
2217
2201
|
category: "Report",
|
|
@@ -2232,7 +2216,7 @@ e.register("report", I, {
|
|
|
2232
2216
|
label: "Chart Configuration"
|
|
2233
2217
|
}
|
|
2234
2218
|
]
|
|
2235
|
-
}), e.register("report-viewer",
|
|
2219
|
+
}), e.register("report-viewer", X, {
|
|
2236
2220
|
namespace: "report",
|
|
2237
2221
|
label: "Report Viewer",
|
|
2238
2222
|
category: "Report",
|
|
@@ -2245,7 +2229,7 @@ e.register("report", I, {
|
|
|
2245
2229
|
type: "boolean",
|
|
2246
2230
|
label: "Show Toolbar"
|
|
2247
2231
|
}]
|
|
2248
|
-
}), e.register("report-builder",
|
|
2232
|
+
}), e.register("report-builder", Q, {
|
|
2249
2233
|
namespace: "report",
|
|
2250
2234
|
label: "Report Builder",
|
|
2251
2235
|
category: "Report",
|
|
@@ -2256,4 +2240,4 @@ e.register("report", I, {
|
|
|
2256
2240
|
}]
|
|
2257
2241
|
});
|
|
2258
2242
|
//#endregion
|
|
2259
|
-
export {
|
|
2243
|
+
export { Q as ReportBuilder, fe as ReportConfigPanel, F as ReportRenderer, X as ReportViewer, Z as ScheduleConfig, me as createScheduleTrigger, I as exportAsCSV, B as exportAsExcel, R as exportAsHTML, L as exportAsJSON, z as exportAsPDF, pe as exportExcelWithFormulas, V as exportReport, $ as exportWithLiveData, q as formatValue };
|