@nice2dev/ui-bi 1.0.22 → 1.0.24
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/index.cjs +3 -3
- package/dist/index.d.ts +1 -4
- package/dist/index.mjs +558 -2017
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return { t:
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as F, createContext as b, memo as re, useState as w, useEffect as ae, useRef as ie, useCallback as x } from "react";
|
|
3
|
+
const ne = (a, r) => r, ce = b(ne);
|
|
4
|
+
function de() {
|
|
5
|
+
return { t: F(ce) };
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
b({
|
|
8
8
|
dir: "ltr",
|
|
9
9
|
isRTL: !1,
|
|
10
|
-
flip: (
|
|
11
|
-
value: (
|
|
10
|
+
flip: (a) => a,
|
|
11
|
+
value: (a) => a.ltr
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
13
|
+
b(null);
|
|
14
|
+
b(null);
|
|
15
|
+
const oe = {
|
|
16
16
|
radius: "md",
|
|
17
17
|
shadow: "md",
|
|
18
18
|
fill: "solid",
|
|
@@ -29,137 +29,137 @@ const fe = {
|
|
|
29
29
|
animation: "normal",
|
|
30
30
|
density: "normal"
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
b({
|
|
33
33
|
displayStyle: "default",
|
|
34
|
-
variantConfig:
|
|
34
|
+
variantConfig: oe,
|
|
35
35
|
setDisplayStyle: () => {
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
b({});
|
|
39
|
+
b({
|
|
40
40
|
direction: "ltr",
|
|
41
41
|
isRTL: !1,
|
|
42
|
-
flip: (
|
|
43
|
-
flipStyle: (
|
|
42
|
+
flip: (a) => a,
|
|
43
|
+
flipStyle: (a, r) => ({ [a]: r })
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
b({
|
|
46
46
|
permissions: {},
|
|
47
47
|
getAccessMode: () => "full"
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
enabled:
|
|
49
|
+
b(null);
|
|
50
|
+
const te = process.env.NODE_ENV === "development";
|
|
51
|
+
let W = {
|
|
52
|
+
enabled: te,
|
|
53
53
|
slowRenderThreshold: 16
|
|
54
54
|
};
|
|
55
|
-
const
|
|
56
|
-
function
|
|
57
|
-
|
|
55
|
+
const O = [], M = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
|
|
56
|
+
function fe() {
|
|
57
|
+
O.length = 0, M.clear(), $.clear();
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return
|
|
59
|
+
function se(a) {
|
|
60
|
+
const r = W.slowRenderThreshold;
|
|
61
|
+
return O.filter((c) => c.actualDuration > r);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
63
|
+
function H(a) {
|
|
64
|
+
return a < 1 ? `${(a * 1e3).toFixed(0)}μs` : a < 1e3 ? `${a.toFixed(2)}ms` : `${(a / 1e3).toFixed(2)}s`;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
return { stats:
|
|
66
|
+
function le() {
|
|
67
|
+
const a = Array.from(M.values()), r = se(), c = a.reduce((u, o) => u + o.renderCount, 0), t = a.length > 0 ? a.reduce((u, o) => u + o.avgRenderTime, 0) / a.length : 0, y = Array.from($.values());
|
|
68
|
+
return { stats: a, slowRenders: r, totalRenders: c, avgRenderTime: t, marks: y };
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
70
|
+
function ye() {
|
|
71
|
+
const a = le();
|
|
72
72
|
console.group(
|
|
73
73
|
"%c[Nice2Dev Performance Report]",
|
|
74
74
|
"color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
|
|
75
|
-
), console.log(`Total renders: ${
|
|
76
|
-
|
|
77
|
-
Name:
|
|
78
|
-
Renders:
|
|
79
|
-
"Avg Time":
|
|
80
|
-
"Max Time":
|
|
81
|
-
"Total Time":
|
|
82
|
-
"Slow Renders":
|
|
75
|
+
), console.log(`Total renders: ${a.totalRenders}`), console.log(`Average render time: ${H(a.avgRenderTime)}`), console.log(`Slow renders: ${a.slowRenders.length}`), console.group("Component Stats"), console.table(
|
|
76
|
+
a.stats.sort((r, c) => c.totalRenderTime - r.totalRenderTime).map((r) => ({
|
|
77
|
+
Name: r.componentName,
|
|
78
|
+
Renders: r.renderCount,
|
|
79
|
+
"Avg Time": H(r.avgRenderTime),
|
|
80
|
+
"Max Time": H(r.maxRenderTime),
|
|
81
|
+
"Total Time": H(r.totalRenderTime),
|
|
82
|
+
"Slow Renders": r.slowRenderCount
|
|
83
83
|
}))
|
|
84
|
-
), console.groupEnd(),
|
|
85
|
-
|
|
86
|
-
Component:
|
|
87
|
-
Phase:
|
|
88
|
-
Duration:
|
|
89
|
-
Time: new Date(
|
|
84
|
+
), console.groupEnd(), a.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
|
|
85
|
+
a.slowRenders.slice(-10).map((r) => ({
|
|
86
|
+
Component: r.componentName,
|
|
87
|
+
Phase: r.phase,
|
|
88
|
+
Duration: H(r.actualDuration),
|
|
89
|
+
Time: new Date(r.timestamp).toLocaleTimeString()
|
|
90
90
|
}))
|
|
91
|
-
), console.groupEnd()),
|
|
92
|
-
|
|
93
|
-
Name:
|
|
94
|
-
Duration:
|
|
91
|
+
), console.groupEnd()), a.marks.length > 0 && (console.group("Custom Marks"), console.table(
|
|
92
|
+
a.marks.filter((r) => r.duration).map((r) => ({
|
|
93
|
+
Name: r.name,
|
|
94
|
+
Duration: H(r.duration)
|
|
95
95
|
}))
|
|
96
96
|
), console.groupEnd()), console.groupEnd();
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
({ position:
|
|
100
|
-
const [
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
u(
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
used:
|
|
108
|
-
total:
|
|
98
|
+
const me = re(
|
|
99
|
+
({ position: a = "bottom-right", defaultCollapsed: r = !0 }) => {
|
|
100
|
+
const [c, t] = w(r), [y, u] = w([]), [o, p] = w({ used: 0, total: 0 });
|
|
101
|
+
if (ae(() => {
|
|
102
|
+
const f = () => {
|
|
103
|
+
const _ = Array.from(M.values());
|
|
104
|
+
u(_.sort((T, k) => k.totalRenderTime - T.totalRenderTime).slice(0, 10));
|
|
105
|
+
const C = window.performance;
|
|
106
|
+
C.memory && p({
|
|
107
|
+
used: C.memory.usedJSHeapSize / 1024 / 1024,
|
|
108
|
+
total: C.memory.totalJSHeapSize / 1024 / 1024
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
return () => clearInterval(
|
|
114
|
-
}, []), !
|
|
111
|
+
f();
|
|
112
|
+
const v = setInterval(f, 2e3);
|
|
113
|
+
return () => clearInterval(v);
|
|
114
|
+
}, []), !W.enabled)
|
|
115
115
|
return null;
|
|
116
|
-
const
|
|
116
|
+
const S = {
|
|
117
117
|
position: "fixed",
|
|
118
118
|
zIndex: 99999,
|
|
119
|
-
...
|
|
120
|
-
...
|
|
119
|
+
...a.includes("top") ? { top: 8 } : { bottom: 8 },
|
|
120
|
+
...a.includes("left") ? { left: 8 } : { right: 8 }
|
|
121
121
|
};
|
|
122
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ d(
|
|
123
123
|
"div",
|
|
124
124
|
{
|
|
125
125
|
style: {
|
|
126
|
-
...
|
|
126
|
+
...S,
|
|
127
127
|
background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
|
|
128
128
|
color: "var(--bg-primary, #fff)",
|
|
129
129
|
borderRadius: 8,
|
|
130
130
|
fontSize: 11,
|
|
131
131
|
fontFamily: "Monaco, Consolas, monospace",
|
|
132
|
-
padding:
|
|
133
|
-
maxWidth:
|
|
134
|
-
maxHeight:
|
|
132
|
+
padding: c ? "4px 8px" : 8,
|
|
133
|
+
maxWidth: c ? "auto" : 300,
|
|
134
|
+
maxHeight: c ? "auto" : 400,
|
|
135
135
|
overflow: "auto"
|
|
136
136
|
},
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ d(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
|
|
142
|
-
onClick: () =>
|
|
142
|
+
onClick: () => t((f) => !f),
|
|
143
143
|
children: [
|
|
144
144
|
/* @__PURE__ */ e("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
|
|
145
145
|
/* @__PURE__ */ e("span", { children: "Profiler" }),
|
|
146
|
-
|
|
146
|
+
o.used > 0 && /* @__PURE__ */ d(
|
|
147
147
|
"span",
|
|
148
148
|
{
|
|
149
149
|
style: {
|
|
150
|
-
color:
|
|
150
|
+
color: o.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
|
|
151
151
|
},
|
|
152
152
|
children: [
|
|
153
|
-
|
|
153
|
+
o.used.toFixed(0),
|
|
154
154
|
"MB"
|
|
155
155
|
]
|
|
156
156
|
}
|
|
157
157
|
),
|
|
158
|
-
/* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children:
|
|
158
|
+
/* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: c ? "▼" : "▲" })
|
|
159
159
|
]
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
!
|
|
162
|
+
!c && /* @__PURE__ */ d("div", { style: { marginTop: 8 }, children: [
|
|
163
163
|
/* @__PURE__ */ e(
|
|
164
164
|
"div",
|
|
165
165
|
{
|
|
@@ -171,33 +171,33 @@ const he = ce(
|
|
|
171
171
|
children: /* @__PURE__ */ e("strong", { children: "Top Components" })
|
|
172
172
|
}
|
|
173
173
|
),
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
174
|
+
y.map((f) => /* @__PURE__ */ d("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
|
|
175
|
+
/* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: f.componentName }),
|
|
176
176
|
/* @__PURE__ */ e(
|
|
177
177
|
"span",
|
|
178
178
|
{
|
|
179
179
|
style: {
|
|
180
|
-
color:
|
|
180
|
+
color: f.avgRenderTime > 16 ? "var(--color-warning, #f59e0b)" : "var(--color-success, #22c55e)"
|
|
181
181
|
},
|
|
182
|
-
children:
|
|
182
|
+
children: H(f.avgRenderTime)
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ d(
|
|
186
186
|
"span",
|
|
187
187
|
{
|
|
188
188
|
style: { color: "var(--text-muted, #64748b)", minWidth: 30, textAlign: "right" },
|
|
189
189
|
children: [
|
|
190
190
|
"x",
|
|
191
|
-
|
|
191
|
+
f.renderCount
|
|
192
192
|
]
|
|
193
193
|
}
|
|
194
194
|
)
|
|
195
|
-
] },
|
|
196
|
-
/* @__PURE__ */
|
|
195
|
+
] }, f.componentName)),
|
|
196
|
+
/* @__PURE__ */ d("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
|
|
197
197
|
/* @__PURE__ */ e(
|
|
198
198
|
"button",
|
|
199
199
|
{
|
|
200
|
-
onClick:
|
|
200
|
+
onClick: ye,
|
|
201
201
|
style: {
|
|
202
202
|
flex: 1,
|
|
203
203
|
padding: "4px 8px",
|
|
@@ -214,7 +214,7 @@ const he = ce(
|
|
|
214
214
|
/* @__PURE__ */ e(
|
|
215
215
|
"button",
|
|
216
216
|
{
|
|
217
|
-
onClick:
|
|
217
|
+
onClick: fe,
|
|
218
218
|
style: {
|
|
219
219
|
flex: 1,
|
|
220
220
|
padding: "4px 8px",
|
|
@@ -235,70 +235,70 @@ const he = ce(
|
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
|
-
|
|
238
|
+
me.displayName = "ProfilerOverlay";
|
|
239
239
|
process.env.NODE_ENV;
|
|
240
|
-
|
|
241
|
-
const
|
|
240
|
+
b(null);
|
|
241
|
+
const pe = b({
|
|
242
242
|
enabled: !0,
|
|
243
243
|
active: !1,
|
|
244
244
|
run: () => {
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
|
-
function
|
|
248
|
-
return
|
|
247
|
+
function ue() {
|
|
248
|
+
return F(pe);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
if (!
|
|
250
|
+
function be(a, r) {
|
|
251
|
+
if (!a)
|
|
252
252
|
return null;
|
|
253
|
-
if (
|
|
254
|
-
return
|
|
255
|
-
if (Array.isArray(
|
|
256
|
-
return
|
|
257
|
-
const
|
|
258
|
-
return
|
|
253
|
+
if (a === !0)
|
|
254
|
+
return r && r.length > 0 ? r : null;
|
|
255
|
+
if (Array.isArray(a))
|
|
256
|
+
return a.length > 0 ? a : null;
|
|
257
|
+
const c = a.steps ?? r;
|
|
258
|
+
return c && c.length > 0 ? c : null;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
262
|
-
target:
|
|
263
|
-
title:
|
|
264
|
-
content:
|
|
265
|
-
placement:
|
|
266
|
-
highlightPadding:
|
|
267
|
-
showArrow:
|
|
268
|
-
scrollIntoView:
|
|
269
|
-
disableInteraction:
|
|
260
|
+
function ve(a, r) {
|
|
261
|
+
return a.map((c) => ({
|
|
262
|
+
target: c.target,
|
|
263
|
+
title: c.titleKey ? r(c.titleKey, c.title ?? "") : c.title ?? "",
|
|
264
|
+
content: c.contentKey ? r(c.contentKey, c.content ?? "") : c.content ?? "",
|
|
265
|
+
placement: c.placement,
|
|
266
|
+
highlightPadding: c.highlightPadding,
|
|
267
|
+
showArrow: c.showArrow,
|
|
268
|
+
scrollIntoView: c.scrollIntoView,
|
|
269
|
+
disableInteraction: c.disableInteraction
|
|
270
270
|
}));
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
steps:
|
|
274
|
-
autoStart:
|
|
275
|
-
label:
|
|
276
|
-
size:
|
|
277
|
-
className:
|
|
272
|
+
const he = ({
|
|
273
|
+
steps: a,
|
|
274
|
+
autoStart: r,
|
|
275
|
+
label: c,
|
|
276
|
+
size: t = "md",
|
|
277
|
+
className: y,
|
|
278
278
|
style: u,
|
|
279
|
-
"data-testid":
|
|
279
|
+
"data-testid": o
|
|
280
280
|
}) => {
|
|
281
|
-
const { enabled:
|
|
282
|
-
if (!
|
|
281
|
+
const { enabled: p, run: S } = ue(), { t: f } = de();
|
|
282
|
+
if (!p || !a || a.length === 0)
|
|
283
283
|
return null;
|
|
284
|
-
const
|
|
284
|
+
const v = c ?? f("tutorial.startAria", "Start tutorial");
|
|
285
285
|
return /* @__PURE__ */ e(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
288
288
|
type: "button",
|
|
289
|
-
className: `nice-tutorial-button nice-tutorial-button--${
|
|
289
|
+
className: `nice-tutorial-button nice-tutorial-button--${t}` + (y ? ` ${y}` : ""),
|
|
290
290
|
style: u,
|
|
291
|
-
"data-testid":
|
|
292
|
-
"aria-label":
|
|
293
|
-
title:
|
|
294
|
-
onClick: () =>
|
|
291
|
+
"data-testid": o,
|
|
292
|
+
"aria-label": v,
|
|
293
|
+
title: v,
|
|
294
|
+
onClick: () => S(ve(a, f), { autoStart: r }),
|
|
295
295
|
children: "?"
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
|
-
},
|
|
299
|
-
if (typeof document < "u" && !document.getElementById(
|
|
300
|
-
const
|
|
301
|
-
|
|
298
|
+
}, U = "nice-tutorial-button-styles";
|
|
299
|
+
if (typeof document < "u" && !document.getElementById(U)) {
|
|
300
|
+
const a = document.createElement("style");
|
|
301
|
+
a.id = U, a.textContent = `
|
|
302
302
|
.nice-tutorial-button {
|
|
303
303
|
display: inline-flex;
|
|
304
304
|
align-items: center;
|
|
@@ -324,12 +324,12 @@ if (typeof document < "u" && !document.getElementById(j)) {
|
|
|
324
324
|
}
|
|
325
325
|
.nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
|
|
326
326
|
.nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
|
|
327
|
-
`, document.head.appendChild(
|
|
327
|
+
`, document.head.appendChild(a);
|
|
328
328
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const
|
|
329
|
+
b(null);
|
|
330
|
+
b(null);
|
|
331
|
+
b(null);
|
|
332
|
+
const B = {
|
|
333
333
|
space1: "4px",
|
|
334
334
|
space2: "8px",
|
|
335
335
|
space3: "12px",
|
|
@@ -337,7 +337,7 @@ const ae = {
|
|
|
337
337
|
space5: "20px",
|
|
338
338
|
space6: "24px",
|
|
339
339
|
space8: "32px"
|
|
340
|
-
},
|
|
340
|
+
}, V = {
|
|
341
341
|
fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
|
|
342
342
|
fontSizeXs: "0.75rem",
|
|
343
343
|
fontSizeSm: "0.8125rem",
|
|
@@ -349,71 +349,71 @@ const ae = {
|
|
|
349
349
|
fontWeightSemibold: 600,
|
|
350
350
|
fontWeightBold: 700,
|
|
351
351
|
lineHeight: 1.5
|
|
352
|
-
},
|
|
353
|
-
color:
|
|
352
|
+
}, K = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, j = (a) => ({
|
|
353
|
+
color: a,
|
|
354
354
|
radiusSm: "4px",
|
|
355
355
|
radiusMd: "6px",
|
|
356
356
|
radiusLg: "8px",
|
|
357
357
|
radiusXl: "12px",
|
|
358
358
|
radiusFull: "9999px"
|
|
359
|
-
}),
|
|
359
|
+
}), ge = {
|
|
360
360
|
sm: "0 1px 2px rgba(0,0,0,0.05)",
|
|
361
361
|
md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
|
|
362
362
|
lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
|
|
363
363
|
xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
|
|
364
|
-
},
|
|
364
|
+
}, we = {
|
|
365
365
|
sm: "0 1px 2px rgba(0,0,0,0.3)",
|
|
366
366
|
md: "0 4px 6px -1px rgba(0,0,0,0.4)",
|
|
367
367
|
lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
|
|
368
368
|
xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
|
|
369
369
|
};
|
|
370
|
-
function
|
|
370
|
+
function i(a, r, c, t, y) {
|
|
371
371
|
return {
|
|
372
|
-
name:
|
|
372
|
+
name: a,
|
|
373
373
|
darkMode: "light",
|
|
374
374
|
colors: {
|
|
375
|
-
...
|
|
376
|
-
surface:
|
|
377
|
-
surfaceHover:
|
|
375
|
+
...r,
|
|
376
|
+
surface: r.surface ?? c.primary,
|
|
377
|
+
surfaceHover: r.surfaceHover ?? c.secondary
|
|
378
378
|
},
|
|
379
379
|
backgrounds: {
|
|
380
|
-
...
|
|
381
|
-
elevated:
|
|
382
|
-
inset:
|
|
383
|
-
canvas:
|
|
380
|
+
...c,
|
|
381
|
+
elevated: c.elevated ?? c.primary,
|
|
382
|
+
inset: c.inset ?? c.tertiary,
|
|
383
|
+
canvas: c.canvas ?? c.primary
|
|
384
384
|
},
|
|
385
|
-
text: { ...
|
|
386
|
-
borders:
|
|
387
|
-
shadows:
|
|
388
|
-
spacing:
|
|
389
|
-
typography:
|
|
390
|
-
transitions:
|
|
385
|
+
text: { ...t, inverse: t.inverse ?? "#ffffff" },
|
|
386
|
+
borders: j(y),
|
|
387
|
+
shadows: ge,
|
|
388
|
+
spacing: B,
|
|
389
|
+
typography: V,
|
|
390
|
+
transitions: K
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function m(a, r, c, t, y) {
|
|
394
394
|
return {
|
|
395
|
-
name:
|
|
395
|
+
name: a,
|
|
396
396
|
darkMode: "dark",
|
|
397
397
|
colors: {
|
|
398
|
-
...
|
|
399
|
-
surface:
|
|
400
|
-
surfaceHover:
|
|
398
|
+
...r,
|
|
399
|
+
surface: r.surface ?? c.secondary,
|
|
400
|
+
surfaceHover: r.surfaceHover ?? c.tertiary
|
|
401
401
|
},
|
|
402
402
|
backgrounds: {
|
|
403
|
-
...
|
|
404
|
-
elevated:
|
|
405
|
-
inset:
|
|
406
|
-
canvas:
|
|
403
|
+
...c,
|
|
404
|
+
elevated: c.elevated ?? c.secondary,
|
|
405
|
+
inset: c.inset ?? c.primary,
|
|
406
|
+
canvas: c.canvas ?? c.primary
|
|
407
407
|
},
|
|
408
|
-
text: { ...
|
|
409
|
-
borders:
|
|
410
|
-
shadows:
|
|
411
|
-
spacing:
|
|
412
|
-
typography:
|
|
413
|
-
transitions:
|
|
408
|
+
text: { ...t, inverse: t.inverse ?? "#0f172a" },
|
|
409
|
+
borders: j(y),
|
|
410
|
+
shadows: we,
|
|
411
|
+
spacing: B,
|
|
412
|
+
typography: V,
|
|
413
|
+
transitions: K
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
|
|
416
|
+
i(
|
|
417
417
|
"Slate",
|
|
418
418
|
{
|
|
419
419
|
primary: "#64748b",
|
|
@@ -427,7 +427,7 @@ f(
|
|
|
427
427
|
{ primary: "#1e293b", secondary: "#475569", muted: "#94a3b8" },
|
|
428
428
|
"#cbd5e1"
|
|
429
429
|
);
|
|
430
|
-
|
|
430
|
+
i(
|
|
431
431
|
"Zinc",
|
|
432
432
|
{
|
|
433
433
|
primary: "#71717a",
|
|
@@ -441,7 +441,7 @@ f(
|
|
|
441
441
|
{ primary: "#18181b", secondary: "#3f3f46", muted: "#a1a1aa" },
|
|
442
442
|
"#d4d4d8"
|
|
443
443
|
);
|
|
444
|
-
|
|
444
|
+
i(
|
|
445
445
|
"Stone",
|
|
446
446
|
{
|
|
447
447
|
primary: "#78716c",
|
|
@@ -455,7 +455,7 @@ f(
|
|
|
455
455
|
{ primary: "#1c1917", secondary: "#44403c", muted: "#a8a29e" },
|
|
456
456
|
"#d6d3d1"
|
|
457
457
|
);
|
|
458
|
-
|
|
458
|
+
i(
|
|
459
459
|
"Cool Gray",
|
|
460
460
|
{
|
|
461
461
|
primary: "#6b7280",
|
|
@@ -469,7 +469,7 @@ f(
|
|
|
469
469
|
{ primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
|
|
470
470
|
"#d1d5db"
|
|
471
471
|
);
|
|
472
|
-
|
|
472
|
+
i(
|
|
473
473
|
"Warm Gray",
|
|
474
474
|
{
|
|
475
475
|
primary: "#7c7568",
|
|
@@ -483,7 +483,7 @@ f(
|
|
|
483
483
|
{ primary: "#1f1d19", secondary: "#4a463d", muted: "#a09888" },
|
|
484
484
|
"#d4d0c8"
|
|
485
485
|
);
|
|
486
|
-
|
|
486
|
+
i(
|
|
487
487
|
"Silver",
|
|
488
488
|
{
|
|
489
489
|
primary: "#94a3b8",
|
|
@@ -497,7 +497,7 @@ f(
|
|
|
497
497
|
{ primary: "#334155", secondary: "#64748b", muted: "#94a3b8" },
|
|
498
498
|
"#cbd5e1"
|
|
499
499
|
);
|
|
500
|
-
|
|
500
|
+
i(
|
|
501
501
|
"Charcoal",
|
|
502
502
|
{
|
|
503
503
|
primary: "#374151",
|
|
@@ -511,7 +511,7 @@ f(
|
|
|
511
511
|
{ primary: "#111827", secondary: "#374151", muted: "#6b7280" },
|
|
512
512
|
"#d1d5db"
|
|
513
513
|
);
|
|
514
|
-
|
|
514
|
+
i(
|
|
515
515
|
"Ivory",
|
|
516
516
|
{
|
|
517
517
|
primary: "#92876d",
|
|
@@ -525,7 +525,7 @@ f(
|
|
|
525
525
|
{ primary: "#2b2517", secondary: "#5c5340", muted: "#9c9280" },
|
|
526
526
|
"#ddd8c4"
|
|
527
527
|
);
|
|
528
|
-
|
|
528
|
+
i(
|
|
529
529
|
"Rose",
|
|
530
530
|
{
|
|
531
531
|
primary: "#e11d48",
|
|
@@ -539,7 +539,7 @@ f(
|
|
|
539
539
|
{ primary: "#4c0519", secondary: "#881337", muted: "#f43f5e" },
|
|
540
540
|
"#fda4af"
|
|
541
541
|
);
|
|
542
|
-
|
|
542
|
+
i(
|
|
543
543
|
"Emerald",
|
|
544
544
|
{
|
|
545
545
|
primary: "#059669",
|
|
@@ -553,7 +553,7 @@ f(
|
|
|
553
553
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#34d399" },
|
|
554
554
|
"#6ee7b7"
|
|
555
555
|
);
|
|
556
|
-
|
|
556
|
+
i(
|
|
557
557
|
"Amber",
|
|
558
558
|
{
|
|
559
559
|
primary: "#d97706",
|
|
@@ -567,7 +567,7 @@ f(
|
|
|
567
567
|
{ primary: "#451a03", secondary: "#78350f", muted: "#f59e0b" },
|
|
568
568
|
"#fcd34d"
|
|
569
569
|
);
|
|
570
|
-
|
|
570
|
+
i(
|
|
571
571
|
"Violet",
|
|
572
572
|
{
|
|
573
573
|
primary: "#7c3aed",
|
|
@@ -581,7 +581,7 @@ f(
|
|
|
581
581
|
{ primary: "#2e1065", secondary: "#4c1d95", muted: "#a78bfa" },
|
|
582
582
|
"#c4b5fd"
|
|
583
583
|
);
|
|
584
|
-
|
|
584
|
+
i(
|
|
585
585
|
"Teal",
|
|
586
586
|
{
|
|
587
587
|
primary: "#0d9488",
|
|
@@ -595,7 +595,7 @@ f(
|
|
|
595
595
|
{ primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
|
|
596
596
|
"#5eead4"
|
|
597
597
|
);
|
|
598
|
-
|
|
598
|
+
i(
|
|
599
599
|
"Indigo",
|
|
600
600
|
{
|
|
601
601
|
primary: "#4f46e5",
|
|
@@ -609,7 +609,7 @@ f(
|
|
|
609
609
|
{ primary: "#1e1b4b", secondary: "#312e81", muted: "#818cf8" },
|
|
610
610
|
"#a5b4fc"
|
|
611
611
|
);
|
|
612
|
-
|
|
612
|
+
i(
|
|
613
613
|
"Cyan",
|
|
614
614
|
{
|
|
615
615
|
primary: "#0891b2",
|
|
@@ -623,7 +623,7 @@ f(
|
|
|
623
623
|
{ primary: "#164e63", secondary: "#155e75", muted: "#22d3ee" },
|
|
624
624
|
"#67e8f9"
|
|
625
625
|
);
|
|
626
|
-
|
|
626
|
+
i(
|
|
627
627
|
"Lime",
|
|
628
628
|
{
|
|
629
629
|
primary: "#65a30d",
|
|
@@ -637,7 +637,7 @@ f(
|
|
|
637
637
|
{ primary: "#1a2e05", secondary: "#365314", muted: "#84cc16" },
|
|
638
638
|
"#bef264"
|
|
639
639
|
);
|
|
640
|
-
|
|
640
|
+
i(
|
|
641
641
|
"Pink",
|
|
642
642
|
{
|
|
643
643
|
primary: "#db2777",
|
|
@@ -651,7 +651,7 @@ f(
|
|
|
651
651
|
{ primary: "#500724", secondary: "#831843", muted: "#f472b6" },
|
|
652
652
|
"#f9a8d4"
|
|
653
653
|
);
|
|
654
|
-
|
|
654
|
+
i(
|
|
655
655
|
"Orange",
|
|
656
656
|
{
|
|
657
657
|
primary: "#ea580c",
|
|
@@ -665,7 +665,7 @@ f(
|
|
|
665
665
|
{ primary: "#431407", secondary: "#7c2d12", muted: "#fb923c" },
|
|
666
666
|
"#fdba74"
|
|
667
667
|
);
|
|
668
|
-
|
|
668
|
+
i(
|
|
669
669
|
"Fuchsia",
|
|
670
670
|
{
|
|
671
671
|
primary: "#c026d3",
|
|
@@ -679,7 +679,7 @@ f(
|
|
|
679
679
|
{ primary: "#4a044e", secondary: "#701a75", muted: "#d946ef" },
|
|
680
680
|
"#e879f9"
|
|
681
681
|
);
|
|
682
|
-
|
|
682
|
+
i(
|
|
683
683
|
"Sky",
|
|
684
684
|
{
|
|
685
685
|
primary: "#0284c7",
|
|
@@ -693,7 +693,7 @@ f(
|
|
|
693
693
|
{ primary: "#0c4a6e", secondary: "#075985", muted: "#38bdf8" },
|
|
694
694
|
"#7dd3fc"
|
|
695
695
|
);
|
|
696
|
-
|
|
696
|
+
i(
|
|
697
697
|
"Ruby",
|
|
698
698
|
{
|
|
699
699
|
primary: "#be123c",
|
|
@@ -707,7 +707,7 @@ f(
|
|
|
707
707
|
{ primary: "#4c0519", secondary: "#881337", muted: "#fb7185" },
|
|
708
708
|
"#fda4af"
|
|
709
709
|
);
|
|
710
|
-
|
|
710
|
+
i(
|
|
711
711
|
"Coral",
|
|
712
712
|
{
|
|
713
713
|
primary: "#f97316",
|
|
@@ -721,7 +721,7 @@ f(
|
|
|
721
721
|
{ primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
|
|
722
722
|
"#fdba74"
|
|
723
723
|
);
|
|
724
|
-
|
|
724
|
+
m(
|
|
725
725
|
"Midnight",
|
|
726
726
|
{
|
|
727
727
|
primary: "#818cf8",
|
|
@@ -735,7 +735,7 @@ H(
|
|
|
735
735
|
{ primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
|
|
736
736
|
"#1e293b"
|
|
737
737
|
);
|
|
738
|
-
|
|
738
|
+
m(
|
|
739
739
|
"Obsidian",
|
|
740
740
|
{
|
|
741
741
|
primary: "#a78bfa",
|
|
@@ -749,7 +749,7 @@ H(
|
|
|
749
749
|
{ primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
|
|
750
750
|
"#3f3f46"
|
|
751
751
|
);
|
|
752
|
-
|
|
752
|
+
m(
|
|
753
753
|
"Eclipse",
|
|
754
754
|
{
|
|
755
755
|
primary: "#c084fc",
|
|
@@ -763,7 +763,7 @@ H(
|
|
|
763
763
|
{ primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
|
|
764
764
|
"#3b3266"
|
|
765
765
|
);
|
|
766
|
-
|
|
766
|
+
m(
|
|
767
767
|
"Onyx",
|
|
768
768
|
{
|
|
769
769
|
primary: "#60a5fa",
|
|
@@ -777,7 +777,7 @@ H(
|
|
|
777
777
|
{ primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
|
|
778
778
|
"#262626"
|
|
779
779
|
);
|
|
780
|
-
|
|
780
|
+
m(
|
|
781
781
|
"Carbon",
|
|
782
782
|
{
|
|
783
783
|
primary: "#38bdf8",
|
|
@@ -791,7 +791,7 @@ H(
|
|
|
791
791
|
{ primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
|
|
792
792
|
"#525252"
|
|
793
793
|
);
|
|
794
|
-
|
|
794
|
+
m(
|
|
795
795
|
"Cosmos",
|
|
796
796
|
{
|
|
797
797
|
primary: "#6366f1",
|
|
@@ -805,7 +805,7 @@ H(
|
|
|
805
805
|
{ primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
|
|
806
806
|
"#374151"
|
|
807
807
|
);
|
|
808
|
-
|
|
808
|
+
m(
|
|
809
809
|
"Nebula",
|
|
810
810
|
{
|
|
811
811
|
primary: "#e879f9",
|
|
@@ -819,7 +819,7 @@ H(
|
|
|
819
819
|
{ primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
|
|
820
820
|
"#581c87"
|
|
821
821
|
);
|
|
822
|
-
|
|
822
|
+
m(
|
|
823
823
|
"Abyss",
|
|
824
824
|
{
|
|
825
825
|
primary: "#22d3ee",
|
|
@@ -833,7 +833,7 @@ H(
|
|
|
833
833
|
{ primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
|
|
834
834
|
"#075985"
|
|
835
835
|
);
|
|
836
|
-
|
|
836
|
+
m(
|
|
837
837
|
"Shadow",
|
|
838
838
|
{
|
|
839
839
|
primary: "#a3a3a3",
|
|
@@ -847,7 +847,7 @@ H(
|
|
|
847
847
|
{ primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
|
|
848
848
|
"#404040"
|
|
849
849
|
);
|
|
850
|
-
|
|
850
|
+
m(
|
|
851
851
|
"Emerald Dark",
|
|
852
852
|
{
|
|
853
853
|
primary: "#34d399",
|
|
@@ -861,7 +861,7 @@ H(
|
|
|
861
861
|
{ primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
|
|
862
862
|
"#047857"
|
|
863
863
|
);
|
|
864
|
-
|
|
864
|
+
i(
|
|
865
865
|
"Forest",
|
|
866
866
|
{
|
|
867
867
|
primary: "#166534",
|
|
@@ -875,7 +875,7 @@ f(
|
|
|
875
875
|
{ primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
|
|
876
876
|
"#86efac"
|
|
877
877
|
);
|
|
878
|
-
|
|
878
|
+
i(
|
|
879
879
|
"Ocean",
|
|
880
880
|
{
|
|
881
881
|
primary: "#0369a1",
|
|
@@ -889,7 +889,7 @@ f(
|
|
|
889
889
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
|
|
890
890
|
"#7dd3fc"
|
|
891
891
|
);
|
|
892
|
-
|
|
892
|
+
i(
|
|
893
893
|
"Desert",
|
|
894
894
|
{
|
|
895
895
|
primary: "#b45309",
|
|
@@ -903,7 +903,7 @@ f(
|
|
|
903
903
|
{ primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
|
|
904
904
|
"#fde047"
|
|
905
905
|
);
|
|
906
|
-
|
|
906
|
+
i(
|
|
907
907
|
"Sunset",
|
|
908
908
|
{
|
|
909
909
|
primary: "#ea580c",
|
|
@@ -917,7 +917,7 @@ f(
|
|
|
917
917
|
{ primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
|
|
918
918
|
"#fdba74"
|
|
919
919
|
);
|
|
920
|
-
|
|
920
|
+
i(
|
|
921
921
|
"Aurora",
|
|
922
922
|
{
|
|
923
923
|
primary: "#0d9488",
|
|
@@ -931,7 +931,7 @@ f(
|
|
|
931
931
|
{ primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
|
|
932
932
|
"#5eead4"
|
|
933
933
|
);
|
|
934
|
-
|
|
934
|
+
i(
|
|
935
935
|
"Lavender",
|
|
936
936
|
{
|
|
937
937
|
primary: "#7e22ce",
|
|
@@ -945,7 +945,7 @@ f(
|
|
|
945
945
|
{ primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
|
|
946
946
|
"#d8b4fe"
|
|
947
947
|
);
|
|
948
|
-
|
|
948
|
+
i(
|
|
949
949
|
"Autumn",
|
|
950
950
|
{
|
|
951
951
|
primary: "#c2410c",
|
|
@@ -959,7 +959,7 @@ f(
|
|
|
959
959
|
{ primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
|
|
960
960
|
"#fca5a5"
|
|
961
961
|
);
|
|
962
|
-
|
|
962
|
+
i(
|
|
963
963
|
"Spring",
|
|
964
964
|
{
|
|
965
965
|
primary: "#16a34a",
|
|
@@ -973,7 +973,7 @@ f(
|
|
|
973
973
|
{ primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
|
|
974
974
|
"#86efac"
|
|
975
975
|
);
|
|
976
|
-
|
|
976
|
+
i(
|
|
977
977
|
"Arctic",
|
|
978
978
|
{
|
|
979
979
|
primary: "#0ea5e9",
|
|
@@ -987,7 +987,7 @@ f(
|
|
|
987
987
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
988
988
|
"#bae6fd"
|
|
989
989
|
);
|
|
990
|
-
|
|
990
|
+
i(
|
|
991
991
|
"Tropical",
|
|
992
992
|
{
|
|
993
993
|
primary: "#0d9488",
|
|
@@ -1001,7 +1001,7 @@ f(
|
|
|
1001
1001
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
|
|
1002
1002
|
"#a7f3d0"
|
|
1003
1003
|
);
|
|
1004
|
-
|
|
1004
|
+
i(
|
|
1005
1005
|
"Pastel Rose",
|
|
1006
1006
|
{
|
|
1007
1007
|
primary: "#f472b6",
|
|
@@ -1015,7 +1015,7 @@ f(
|
|
|
1015
1015
|
{ primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
|
|
1016
1016
|
"#f9a8d4"
|
|
1017
1017
|
);
|
|
1018
|
-
|
|
1018
|
+
i(
|
|
1019
1019
|
"Pastel Sky",
|
|
1020
1020
|
{
|
|
1021
1021
|
primary: "#38bdf8",
|
|
@@ -1029,7 +1029,7 @@ f(
|
|
|
1029
1029
|
{ primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
1030
1030
|
"#bae6fd"
|
|
1031
1031
|
);
|
|
1032
|
-
|
|
1032
|
+
i(
|
|
1033
1033
|
"Pastel Mint",
|
|
1034
1034
|
{
|
|
1035
1035
|
primary: "#34d399",
|
|
@@ -1043,7 +1043,7 @@ f(
|
|
|
1043
1043
|
{ primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
|
|
1044
1044
|
"#a7f3d0"
|
|
1045
1045
|
);
|
|
1046
|
-
|
|
1046
|
+
i(
|
|
1047
1047
|
"Pastel Peach",
|
|
1048
1048
|
{
|
|
1049
1049
|
primary: "#fb923c",
|
|
@@ -1057,7 +1057,7 @@ f(
|
|
|
1057
1057
|
{ primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
|
|
1058
1058
|
"#fed7aa"
|
|
1059
1059
|
);
|
|
1060
|
-
|
|
1060
|
+
i(
|
|
1061
1061
|
"Pastel Lavender",
|
|
1062
1062
|
{
|
|
1063
1063
|
primary: "#a78bfa",
|
|
@@ -1071,7 +1071,7 @@ f(
|
|
|
1071
1071
|
{ primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
|
|
1072
1072
|
"#ddd6fe"
|
|
1073
1073
|
);
|
|
1074
|
-
|
|
1074
|
+
i(
|
|
1075
1075
|
"Pastel Lemon",
|
|
1076
1076
|
{
|
|
1077
1077
|
primary: "#facc15",
|
|
@@ -1085,7 +1085,7 @@ f(
|
|
|
1085
1085
|
{ primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
|
|
1086
1086
|
"#fef08a"
|
|
1087
1087
|
);
|
|
1088
|
-
|
|
1088
|
+
i(
|
|
1089
1089
|
"Pastel Sage",
|
|
1090
1090
|
{
|
|
1091
1091
|
primary: "#86efac",
|
|
@@ -1099,7 +1099,7 @@ f(
|
|
|
1099
1099
|
{ primary: "#166534", secondary: "#15803d", muted: "#86efac" },
|
|
1100
1100
|
"#bbf7d0"
|
|
1101
1101
|
);
|
|
1102
|
-
|
|
1102
|
+
i(
|
|
1103
1103
|
"Pastel Coral",
|
|
1104
1104
|
{
|
|
1105
1105
|
primary: "#fb7185",
|
|
@@ -1113,7 +1113,7 @@ f(
|
|
|
1113
1113
|
{ primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
|
|
1114
1114
|
"#fecdd3"
|
|
1115
1115
|
);
|
|
1116
|
-
|
|
1116
|
+
i(
|
|
1117
1117
|
"Banking",
|
|
1118
1118
|
{
|
|
1119
1119
|
primary: "#1e3a5f",
|
|
@@ -1127,7 +1127,7 @@ f(
|
|
|
1127
1127
|
{ primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
|
|
1128
1128
|
"#cbd5e1"
|
|
1129
1129
|
);
|
|
1130
|
-
|
|
1130
|
+
i(
|
|
1131
1131
|
"Healthcare",
|
|
1132
1132
|
{
|
|
1133
1133
|
primary: "#0891b2",
|
|
@@ -1141,7 +1141,7 @@ f(
|
|
|
1141
1141
|
{ primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
|
|
1142
1142
|
"#b2dfdb"
|
|
1143
1143
|
);
|
|
1144
|
-
|
|
1144
|
+
i(
|
|
1145
1145
|
"Legal",
|
|
1146
1146
|
{
|
|
1147
1147
|
primary: "#1e293b",
|
|
@@ -1155,7 +1155,7 @@ f(
|
|
|
1155
1155
|
{ primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
|
|
1156
1156
|
"#d6d3d1"
|
|
1157
1157
|
);
|
|
1158
|
-
|
|
1158
|
+
i(
|
|
1159
1159
|
"Tech Startup",
|
|
1160
1160
|
{
|
|
1161
1161
|
primary: "#7c3aed",
|
|
@@ -1169,7 +1169,7 @@ f(
|
|
|
1169
1169
|
{ primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
|
|
1170
1170
|
"#c4b5fd"
|
|
1171
1171
|
);
|
|
1172
|
-
|
|
1172
|
+
i(
|
|
1173
1173
|
"Enterprise",
|
|
1174
1174
|
{
|
|
1175
1175
|
primary: "#1e40af",
|
|
@@ -1183,7 +1183,7 @@ f(
|
|
|
1183
1183
|
{ primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
|
|
1184
1184
|
"#93c5fd"
|
|
1185
1185
|
);
|
|
1186
|
-
|
|
1186
|
+
i(
|
|
1187
1187
|
"Government",
|
|
1188
1188
|
{
|
|
1189
1189
|
primary: "#1d4ed8",
|
|
@@ -1197,7 +1197,7 @@ f(
|
|
|
1197
1197
|
{ primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
|
|
1198
1198
|
"#cbd5e1"
|
|
1199
1199
|
);
|
|
1200
|
-
|
|
1200
|
+
i(
|
|
1201
1201
|
"Education",
|
|
1202
1202
|
{
|
|
1203
1203
|
primary: "#059669",
|
|
@@ -1211,7 +1211,7 @@ f(
|
|
|
1211
1211
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
|
|
1212
1212
|
"#a7f3d0"
|
|
1213
1213
|
);
|
|
1214
|
-
|
|
1214
|
+
i(
|
|
1215
1215
|
"Real Estate",
|
|
1216
1216
|
{
|
|
1217
1217
|
primary: "#92400e",
|
|
@@ -1225,7 +1225,7 @@ f(
|
|
|
1225
1225
|
{ primary: "#422006", secondary: "#713f12", muted: "#d97706" },
|
|
1226
1226
|
"#fcd34d"
|
|
1227
1227
|
);
|
|
1228
|
-
|
|
1228
|
+
i(
|
|
1229
1229
|
"Nord",
|
|
1230
1230
|
{
|
|
1231
1231
|
primary: "#5e81ac",
|
|
@@ -1239,7 +1239,7 @@ f(
|
|
|
1239
1239
|
{ primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
|
|
1240
1240
|
"#d8dee9"
|
|
1241
1241
|
);
|
|
1242
|
-
|
|
1242
|
+
m(
|
|
1243
1243
|
"Dracula",
|
|
1244
1244
|
{
|
|
1245
1245
|
primary: "#bd93f9",
|
|
@@ -1253,7 +1253,7 @@ H(
|
|
|
1253
1253
|
{ primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
|
|
1254
1254
|
"#44475a"
|
|
1255
1255
|
);
|
|
1256
|
-
|
|
1256
|
+
i(
|
|
1257
1257
|
"Solarized Light",
|
|
1258
1258
|
{
|
|
1259
1259
|
primary: "#268bd2",
|
|
@@ -1267,7 +1267,7 @@ f(
|
|
|
1267
1267
|
{ primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
|
|
1268
1268
|
"#eee8d5"
|
|
1269
1269
|
);
|
|
1270
|
-
|
|
1270
|
+
m(
|
|
1271
1271
|
"Solarized Dark",
|
|
1272
1272
|
{
|
|
1273
1273
|
primary: "#268bd2",
|
|
@@ -1281,7 +1281,7 @@ H(
|
|
|
1281
1281
|
{ primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
|
|
1282
1282
|
"#073642"
|
|
1283
1283
|
);
|
|
1284
|
-
|
|
1284
|
+
m(
|
|
1285
1285
|
"Monokai",
|
|
1286
1286
|
{
|
|
1287
1287
|
primary: "#66d9ef",
|
|
@@ -1295,7 +1295,7 @@ H(
|
|
|
1295
1295
|
{ primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
|
|
1296
1296
|
"#3e3d32"
|
|
1297
1297
|
);
|
|
1298
|
-
|
|
1298
|
+
m(
|
|
1299
1299
|
"One Dark",
|
|
1300
1300
|
{
|
|
1301
1301
|
primary: "#61afef",
|
|
@@ -1309,7 +1309,7 @@ H(
|
|
|
1309
1309
|
{ primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
|
|
1310
1310
|
"#3e4452"
|
|
1311
1311
|
);
|
|
1312
|
-
|
|
1312
|
+
m(
|
|
1313
1313
|
"Synthwave",
|
|
1314
1314
|
{
|
|
1315
1315
|
primary: "#ff7edb",
|
|
@@ -1323,7 +1323,7 @@ H(
|
|
|
1323
1323
|
{ primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
|
|
1324
1324
|
"#4a3866"
|
|
1325
1325
|
);
|
|
1326
|
-
|
|
1326
|
+
i(
|
|
1327
1327
|
"Vaporwave",
|
|
1328
1328
|
{
|
|
1329
1329
|
primary: "#ff71ce",
|
|
@@ -1337,7 +1337,7 @@ f(
|
|
|
1337
1337
|
{ primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
|
|
1338
1338
|
"#d8a8e8"
|
|
1339
1339
|
);
|
|
1340
|
-
|
|
1340
|
+
m(
|
|
1341
1341
|
"Terminal Green",
|
|
1342
1342
|
{
|
|
1343
1343
|
primary: "#00ff41",
|
|
@@ -1351,7 +1351,7 @@ H(
|
|
|
1351
1351
|
{ primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
|
|
1352
1352
|
"#003300"
|
|
1353
1353
|
);
|
|
1354
|
-
|
|
1354
|
+
i(
|
|
1355
1355
|
"Sepia",
|
|
1356
1356
|
{
|
|
1357
1357
|
primary: "#8b6914",
|
|
@@ -1365,7 +1365,7 @@ f(
|
|
|
1365
1365
|
{ primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
|
|
1366
1366
|
"#d7ccc8"
|
|
1367
1367
|
);
|
|
1368
|
-
|
|
1368
|
+
i(
|
|
1369
1369
|
"Vintage",
|
|
1370
1370
|
{
|
|
1371
1371
|
primary: "#8d6e63",
|
|
@@ -1379,7 +1379,7 @@ f(
|
|
|
1379
1379
|
{ primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
|
|
1380
1380
|
"#bcaaa4"
|
|
1381
1381
|
);
|
|
1382
|
-
|
|
1382
|
+
m(
|
|
1383
1383
|
"Cyberpunk",
|
|
1384
1384
|
{
|
|
1385
1385
|
primary: "#00f0ff",
|
|
@@ -1393,7 +1393,7 @@ H(
|
|
|
1393
1393
|
{ primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
|
|
1394
1394
|
"#1c3a44"
|
|
1395
1395
|
);
|
|
1396
|
-
|
|
1396
|
+
m(
|
|
1397
1397
|
"Neon",
|
|
1398
1398
|
{
|
|
1399
1399
|
primary: "#ff00ff",
|
|
@@ -1407,7 +1407,7 @@ H(
|
|
|
1407
1407
|
{ primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
|
|
1408
1408
|
"#333333"
|
|
1409
1409
|
);
|
|
1410
|
-
|
|
1410
|
+
m(
|
|
1411
1411
|
"Retrowave",
|
|
1412
1412
|
{
|
|
1413
1413
|
primary: "#f77fbe",
|
|
@@ -1421,7 +1421,7 @@ H(
|
|
|
1421
1421
|
{ primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
|
|
1422
1422
|
"#4a2d66"
|
|
1423
1423
|
);
|
|
1424
|
-
|
|
1424
|
+
i(
|
|
1425
1425
|
"Christmas",
|
|
1426
1426
|
{
|
|
1427
1427
|
primary: "#c41e3a",
|
|
@@ -1435,7 +1435,7 @@ f(
|
|
|
1435
1435
|
{ primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
|
|
1436
1436
|
"#e8a0a0"
|
|
1437
1437
|
);
|
|
1438
|
-
|
|
1438
|
+
m(
|
|
1439
1439
|
"Halloween",
|
|
1440
1440
|
{
|
|
1441
1441
|
primary: "#ff6600",
|
|
@@ -1449,7 +1449,7 @@ H(
|
|
|
1449
1449
|
{ primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28" },
|
|
1450
1450
|
"#5c3400"
|
|
1451
1451
|
);
|
|
1452
|
-
|
|
1452
|
+
i(
|
|
1453
1453
|
"Valentine",
|
|
1454
1454
|
{
|
|
1455
1455
|
primary: "#e11d48",
|
|
@@ -1463,7 +1463,7 @@ f(
|
|
|
1463
1463
|
{ primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
|
|
1464
1464
|
"#fda4af"
|
|
1465
1465
|
);
|
|
1466
|
-
|
|
1466
|
+
i(
|
|
1467
1467
|
"Easter",
|
|
1468
1468
|
{
|
|
1469
1469
|
primary: "#a78bfa",
|
|
@@ -1477,7 +1477,7 @@ f(
|
|
|
1477
1477
|
{ primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
|
|
1478
1478
|
"#ddd6fe"
|
|
1479
1479
|
);
|
|
1480
|
-
|
|
1480
|
+
i(
|
|
1481
1481
|
"Summer Beach",
|
|
1482
1482
|
{
|
|
1483
1483
|
primary: "#0ea5e9",
|
|
@@ -1491,7 +1491,7 @@ f(
|
|
|
1491
1491
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
1492
1492
|
"#fcd34d"
|
|
1493
1493
|
);
|
|
1494
|
-
|
|
1494
|
+
i(
|
|
1495
1495
|
"Winter Frost",
|
|
1496
1496
|
{
|
|
1497
1497
|
primary: "#3b82f6",
|
|
@@ -1505,7 +1505,7 @@ f(
|
|
|
1505
1505
|
{ primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
|
|
1506
1506
|
"#bfdbfe"
|
|
1507
1507
|
);
|
|
1508
|
-
|
|
1508
|
+
i(
|
|
1509
1509
|
"Cherry Blossom",
|
|
1510
1510
|
{
|
|
1511
1511
|
primary: "#ec4899",
|
|
@@ -1519,7 +1519,7 @@ f(
|
|
|
1519
1519
|
{ primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
|
|
1520
1520
|
"#fbcfe8"
|
|
1521
1521
|
);
|
|
1522
|
-
|
|
1522
|
+
i(
|
|
1523
1523
|
"Harvest",
|
|
1524
1524
|
{
|
|
1525
1525
|
primary: "#b45309",
|
|
@@ -1533,7 +1533,7 @@ f(
|
|
|
1533
1533
|
{ primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
|
|
1534
1534
|
"#fcd34d"
|
|
1535
1535
|
);
|
|
1536
|
-
|
|
1536
|
+
i(
|
|
1537
1537
|
"Japanese Zen",
|
|
1538
1538
|
{
|
|
1539
1539
|
primary: "#6b7280",
|
|
@@ -1547,7 +1547,7 @@ f(
|
|
|
1547
1547
|
{ primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
|
|
1548
1548
|
"#d5cec0"
|
|
1549
1549
|
);
|
|
1550
|
-
|
|
1550
|
+
i(
|
|
1551
1551
|
"Moroccan",
|
|
1552
1552
|
{
|
|
1553
1553
|
primary: "#c2410c",
|
|
@@ -1561,7 +1561,7 @@ f(
|
|
|
1561
1561
|
{ primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
|
|
1562
1562
|
"#f5d0a0"
|
|
1563
1563
|
);
|
|
1564
|
-
|
|
1564
|
+
i(
|
|
1565
1565
|
"Scandinavian",
|
|
1566
1566
|
{
|
|
1567
1567
|
primary: "#4b5563",
|
|
@@ -1575,7 +1575,7 @@ f(
|
|
|
1575
1575
|
{ primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
|
|
1576
1576
|
"#e5e7eb"
|
|
1577
1577
|
);
|
|
1578
|
-
|
|
1578
|
+
i(
|
|
1579
1579
|
"Mediterranean",
|
|
1580
1580
|
{
|
|
1581
1581
|
primary: "#1e40af",
|
|
@@ -1589,7 +1589,7 @@ f(
|
|
|
1589
1589
|
{ primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
|
|
1590
1590
|
"#bfdbfe"
|
|
1591
1591
|
);
|
|
1592
|
-
|
|
1592
|
+
i(
|
|
1593
1593
|
"Chinese New Year",
|
|
1594
1594
|
{
|
|
1595
1595
|
primary: "#dc2626",
|
|
@@ -1603,7 +1603,7 @@ f(
|
|
|
1603
1603
|
{ primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
|
|
1604
1604
|
"#fca5a5"
|
|
1605
1605
|
);
|
|
1606
|
-
|
|
1606
|
+
i(
|
|
1607
1607
|
"Indian Festive",
|
|
1608
1608
|
{
|
|
1609
1609
|
primary: "#d97706",
|
|
@@ -1617,7 +1617,7 @@ f(
|
|
|
1617
1617
|
{ primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
|
|
1618
1618
|
"#fcd34d"
|
|
1619
1619
|
);
|
|
1620
|
-
|
|
1620
|
+
i(
|
|
1621
1621
|
"Brazilian Carnival",
|
|
1622
1622
|
{
|
|
1623
1623
|
primary: "#16a34a",
|
|
@@ -1631,7 +1631,7 @@ f(
|
|
|
1631
1631
|
{ primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
|
|
1632
1632
|
"#86efac"
|
|
1633
1633
|
);
|
|
1634
|
-
|
|
1634
|
+
i(
|
|
1635
1635
|
"African Earth",
|
|
1636
1636
|
{
|
|
1637
1637
|
primary: "#92400e",
|
|
@@ -1645,7 +1645,7 @@ f(
|
|
|
1645
1645
|
{ primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
|
|
1646
1646
|
"#d4b896"
|
|
1647
1647
|
);
|
|
1648
|
-
|
|
1648
|
+
m(
|
|
1649
1649
|
"High Contrast Dark",
|
|
1650
1650
|
{
|
|
1651
1651
|
primary: "#ffff00",
|
|
@@ -1659,7 +1659,7 @@ H(
|
|
|
1659
1659
|
{ primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
|
|
1660
1660
|
"#ffffff"
|
|
1661
1661
|
);
|
|
1662
|
-
|
|
1662
|
+
i(
|
|
1663
1663
|
"Monochrome",
|
|
1664
1664
|
{
|
|
1665
1665
|
primary: "#404040",
|
|
@@ -1673,7 +1673,7 @@ f(
|
|
|
1673
1673
|
{ primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
|
|
1674
1674
|
"#c0c0c0"
|
|
1675
1675
|
);
|
|
1676
|
-
|
|
1676
|
+
i(
|
|
1677
1677
|
"Enhanced Contrast",
|
|
1678
1678
|
{
|
|
1679
1679
|
primary: "#0050b3",
|
|
@@ -1687,7 +1687,7 @@ f(
|
|
|
1687
1687
|
{ primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
|
|
1688
1688
|
"#8c8c8c"
|
|
1689
1689
|
);
|
|
1690
|
-
|
|
1690
|
+
i(
|
|
1691
1691
|
"Minimalist",
|
|
1692
1692
|
{
|
|
1693
1693
|
primary: "#18181b",
|
|
@@ -1701,7 +1701,7 @@ f(
|
|
|
1701
1701
|
{ primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
|
|
1702
1702
|
"#e5e5e5"
|
|
1703
1703
|
);
|
|
1704
|
-
|
|
1704
|
+
m(
|
|
1705
1705
|
"Warm Dark",
|
|
1706
1706
|
{
|
|
1707
1707
|
primary: "#f59e0b",
|
|
@@ -1715,7 +1715,7 @@ H(
|
|
|
1715
1715
|
{ primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
|
|
1716
1716
|
"#57534e"
|
|
1717
1717
|
);
|
|
1718
|
-
|
|
1718
|
+
m(
|
|
1719
1719
|
"Soft Dark",
|
|
1720
1720
|
{
|
|
1721
1721
|
primary: "#a78bfa",
|
|
@@ -1729,7 +1729,7 @@ H(
|
|
|
1729
1729
|
{ primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
|
|
1730
1730
|
"#3e3e58"
|
|
1731
1731
|
);
|
|
1732
|
-
|
|
1732
|
+
i(
|
|
1733
1733
|
"Coffee",
|
|
1734
1734
|
{
|
|
1735
1735
|
primary: "#6f4e37",
|
|
@@ -1743,7 +1743,7 @@ f(
|
|
|
1743
1743
|
{ primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
|
|
1744
1744
|
"#d4c4a8"
|
|
1745
1745
|
);
|
|
1746
|
-
|
|
1746
|
+
i(
|
|
1747
1747
|
"Wine",
|
|
1748
1748
|
{
|
|
1749
1749
|
primary: "#7f1d1d",
|
|
@@ -1757,1416 +1757,8 @@ f(
|
|
|
1757
1757
|
{ primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
|
|
1758
1758
|
"#e8a0a0"
|
|
1759
1759
|
);
|
|
1760
|
-
|
|
1761
|
-
const
|
|
1762
|
-
{
|
|
1763
|
-
target: ".nice-report-builder",
|
|
1764
|
-
titleKey: "tutorial.biReportBuilder.intro.title",
|
|
1765
|
-
title: "Report builder",
|
|
1766
|
-
contentKey: "tutorial.biReportBuilder.intro.content",
|
|
1767
|
-
content: "Drag elements from the palette onto the report, bind them to data sources, switch design/preview, then export to PDF or Excel.",
|
|
1768
|
-
placement: "auto"
|
|
1769
|
-
}
|
|
1770
|
-
], Se = {
|
|
1771
|
-
id: "",
|
|
1772
|
-
name: "New Report",
|
|
1773
|
-
dataSource: "",
|
|
1774
|
-
layout: {
|
|
1775
|
-
type: "table",
|
|
1776
|
-
elements: [],
|
|
1777
|
-
pageSize: "A4",
|
|
1778
|
-
orientation: "portrait"
|
|
1779
|
-
},
|
|
1780
|
-
parameters: [],
|
|
1781
|
-
filters: [],
|
|
1782
|
-
sorting: [],
|
|
1783
|
-
grouping: [],
|
|
1784
|
-
calculations: [],
|
|
1785
|
-
formatting: {
|
|
1786
|
-
conditionalFormats: [],
|
|
1787
|
-
alternateRowColors: !0,
|
|
1788
|
-
gridLines: !0
|
|
1789
|
-
}
|
|
1790
|
-
}, G = [
|
|
1791
|
-
{ type: "table", label: "Table", icon: "📊" },
|
|
1792
|
-
{ type: "chart", label: "Chart", icon: "📈" },
|
|
1793
|
-
{ type: "text", label: "Text", icon: "📝" },
|
|
1794
|
-
{ type: "image", label: "Image", icon: "🖼️" },
|
|
1795
|
-
{ type: "shape", label: "Shape", icon: "⬜" },
|
|
1796
|
-
{ type: "barcode", label: "Barcode", icon: "▮▯▮" },
|
|
1797
|
-
{ type: "qrcode", label: "QR Code", icon: "⊞" },
|
|
1798
|
-
{ type: "subreport", label: "Subreport", icon: "📋" },
|
|
1799
|
-
{ type: "page-break", label: "Page Break", icon: "📄" }
|
|
1800
|
-
];
|
|
1801
|
-
function Qe({
|
|
1802
|
-
report: r,
|
|
1803
|
-
dataSources: i = [],
|
|
1804
|
-
onChange: n,
|
|
1805
|
-
onPreview: s,
|
|
1806
|
-
onExport: c,
|
|
1807
|
-
className: u = "",
|
|
1808
|
-
tutorial: m
|
|
1809
|
-
}) {
|
|
1810
|
-
const [o, v] = D(
|
|
1811
|
-
r || { ...Se, id: crypto.randomUUID() }
|
|
1812
|
-
), [d, h] = D(null), [l, g] = D("design"), [E, T] = D(null), [M, N] = D(100), C = k(
|
|
1813
|
-
(t) => {
|
|
1814
|
-
v((b) => {
|
|
1815
|
-
const _ = t(b);
|
|
1816
|
-
return n == null || n(_), _;
|
|
1817
|
-
});
|
|
1818
|
-
},
|
|
1819
|
-
[n]
|
|
1820
|
-
), P = k(
|
|
1821
|
-
(t, b) => {
|
|
1822
|
-
const _ = {
|
|
1823
|
-
id: crypto.randomUUID(),
|
|
1824
|
-
type: t,
|
|
1825
|
-
position: {
|
|
1826
|
-
x: b.x,
|
|
1827
|
-
y: b.y,
|
|
1828
|
-
width: 200,
|
|
1829
|
-
height: t === "page-break" ? 20 : 100
|
|
1830
|
-
},
|
|
1831
|
-
config: Ce(t),
|
|
1832
|
-
style: {}
|
|
1833
|
-
};
|
|
1834
|
-
C((R) => ({
|
|
1835
|
-
...R,
|
|
1836
|
-
layout: {
|
|
1837
|
-
...R.layout,
|
|
1838
|
-
elements: [...R.layout.elements, _]
|
|
1839
|
-
}
|
|
1840
|
-
})), h(_);
|
|
1841
|
-
},
|
|
1842
|
-
[C]
|
|
1843
|
-
), I = k(
|
|
1844
|
-
(t, b) => {
|
|
1845
|
-
C((_) => ({
|
|
1846
|
-
..._,
|
|
1847
|
-
layout: {
|
|
1848
|
-
..._.layout,
|
|
1849
|
-
elements: _.layout.elements.map(
|
|
1850
|
-
(R) => R.id === t ? { ...R, ...b } : R
|
|
1851
|
-
)
|
|
1852
|
-
}
|
|
1853
|
-
})), (d == null ? void 0 : d.id) === t && h((_) => _ ? { ..._, ...b } : null);
|
|
1854
|
-
},
|
|
1855
|
-
[C, d]
|
|
1856
|
-
), S = k(
|
|
1857
|
-
(t) => {
|
|
1858
|
-
C((b) => ({
|
|
1859
|
-
...b,
|
|
1860
|
-
layout: {
|
|
1861
|
-
...b.layout,
|
|
1862
|
-
elements: b.layout.elements.filter((_) => _.id !== t)
|
|
1863
|
-
}
|
|
1864
|
-
})), h(null);
|
|
1865
|
-
},
|
|
1866
|
-
[C]
|
|
1867
|
-
), z = k(
|
|
1868
|
-
(t) => {
|
|
1869
|
-
if (t.preventDefault(), !E)
|
|
1870
|
-
return;
|
|
1871
|
-
const b = t.currentTarget.getBoundingClientRect(), _ = (t.clientX - b.left) * (100 / M), R = (t.clientY - b.top) * (100 / M);
|
|
1872
|
-
P(E, { x: _, y: R }), T(null);
|
|
1873
|
-
},
|
|
1874
|
-
[E, P, M]
|
|
1875
|
-
), A = k(() => {
|
|
1876
|
-
s == null || s(o);
|
|
1877
|
-
}, [o, s]), U = k(
|
|
1878
|
-
(t) => {
|
|
1879
|
-
c == null || c(o, t);
|
|
1880
|
-
},
|
|
1881
|
-
[o, c]
|
|
1882
|
-
), y = i.find((t) => t.id === o.dataSource);
|
|
1883
|
-
return /* @__PURE__ */ a("div", { className: `nice-report-builder ${u}`, children: [
|
|
1884
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__toolbar", children: [
|
|
1885
|
-
/* @__PURE__ */ e(
|
|
1886
|
-
"input",
|
|
1887
|
-
{
|
|
1888
|
-
type: "text",
|
|
1889
|
-
value: o.name,
|
|
1890
|
-
onChange: (t) => C((b) => ({ ...b, name: t.target.value })),
|
|
1891
|
-
className: "nice-report-builder__name-input"
|
|
1892
|
-
}
|
|
1893
|
-
),
|
|
1894
|
-
/* @__PURE__ */ e("div", { className: "nice-report-builder__tabs", children: ["design", "data", "parameters", "formatting"].map((t) => /* @__PURE__ */ e(
|
|
1895
|
-
"button",
|
|
1896
|
-
{
|
|
1897
|
-
className: `nice-report-builder__tab ${l === t ? "nice-report-builder__tab--active" : ""}`,
|
|
1898
|
-
onClick: () => g(t),
|
|
1899
|
-
children: t.charAt(0).toUpperCase() + t.slice(1)
|
|
1900
|
-
},
|
|
1901
|
-
t
|
|
1902
|
-
)) }),
|
|
1903
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__zoom", children: [
|
|
1904
|
-
/* @__PURE__ */ e("button", { onClick: () => N((t) => Math.max(25, t - 25)), children: "−" }),
|
|
1905
|
-
/* @__PURE__ */ a("span", { children: [
|
|
1906
|
-
M,
|
|
1907
|
-
"%"
|
|
1908
|
-
] }),
|
|
1909
|
-
/* @__PURE__ */ e("button", { onClick: () => N((t) => Math.min(200, t + 25)), children: "+" })
|
|
1910
|
-
] }),
|
|
1911
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__actions", children: [
|
|
1912
|
-
/* @__PURE__ */ e("button", { onClick: A, children: "👁 Preview" }),
|
|
1913
|
-
/* @__PURE__ */ e("button", { onClick: () => U("pdf"), children: "📄 PDF" }),
|
|
1914
|
-
/* @__PURE__ */ e("button", { onClick: () => U("excel"), children: "📊 Excel" }),
|
|
1915
|
-
/* @__PURE__ */ e(K, { steps: X(m, Ne) })
|
|
1916
|
-
] })
|
|
1917
|
-
] }),
|
|
1918
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__main", children: [
|
|
1919
|
-
l === "design" && /* @__PURE__ */ a("div", { className: "nice-report-builder__palette", children: [
|
|
1920
|
-
/* @__PURE__ */ e("h4", { children: "Elements" }),
|
|
1921
|
-
G.map((t) => /* @__PURE__ */ a(
|
|
1922
|
-
"div",
|
|
1923
|
-
{
|
|
1924
|
-
className: "nice-report-builder__palette-item",
|
|
1925
|
-
draggable: !0,
|
|
1926
|
-
onDragStart: () => T(t.type),
|
|
1927
|
-
onDragEnd: () => T(null),
|
|
1928
|
-
children: [
|
|
1929
|
-
/* @__PURE__ */ e("span", { className: "nice-report-builder__palette-icon", children: t.icon }),
|
|
1930
|
-
/* @__PURE__ */ e("span", { children: t.label })
|
|
1931
|
-
]
|
|
1932
|
-
},
|
|
1933
|
-
t.type
|
|
1934
|
-
)),
|
|
1935
|
-
/* @__PURE__ */ e("h4", { children: "Data Source" }),
|
|
1936
|
-
/* @__PURE__ */ a(
|
|
1937
|
-
"select",
|
|
1938
|
-
{
|
|
1939
|
-
value: o.dataSource,
|
|
1940
|
-
onChange: (t) => C((b) => ({ ...b, dataSource: t.target.value })),
|
|
1941
|
-
children: [
|
|
1942
|
-
/* @__PURE__ */ e("option", { value: "", children: "Select data source..." }),
|
|
1943
|
-
i.map((t) => /* @__PURE__ */ e("option", { value: t.id, children: t.name }, t.id))
|
|
1944
|
-
]
|
|
1945
|
-
}
|
|
1946
|
-
),
|
|
1947
|
-
(y == null ? void 0 : y.schema) && /* @__PURE__ */ a("div", { className: "nice-report-builder__fields", children: [
|
|
1948
|
-
/* @__PURE__ */ e("h5", { children: "Fields" }),
|
|
1949
|
-
y.schema.tables.map((t) => /* @__PURE__ */ a("div", { className: "nice-report-builder__table-fields", children: [
|
|
1950
|
-
/* @__PURE__ */ e("strong", { children: t.name }),
|
|
1951
|
-
t.columns.map((b) => /* @__PURE__ */ a(
|
|
1952
|
-
"div",
|
|
1953
|
-
{
|
|
1954
|
-
className: "nice-report-builder__field",
|
|
1955
|
-
draggable: !0,
|
|
1956
|
-
onDragStart: () => {
|
|
1957
|
-
},
|
|
1958
|
-
children: [
|
|
1959
|
-
b.name,
|
|
1960
|
-
" ",
|
|
1961
|
-
/* @__PURE__ */ a("small", { children: [
|
|
1962
|
-
"(",
|
|
1963
|
-
b.type,
|
|
1964
|
-
")"
|
|
1965
|
-
] })
|
|
1966
|
-
]
|
|
1967
|
-
},
|
|
1968
|
-
b.name
|
|
1969
|
-
))
|
|
1970
|
-
] }, t.name))
|
|
1971
|
-
] })
|
|
1972
|
-
] }),
|
|
1973
|
-
l === "design" && /* @__PURE__ */ e("div", { className: "nice-report-builder__canvas-container", children: /* @__PURE__ */ a(
|
|
1974
|
-
"div",
|
|
1975
|
-
{
|
|
1976
|
-
className: "nice-report-builder__canvas",
|
|
1977
|
-
style: {
|
|
1978
|
-
transform: `scale(${M / 100})`,
|
|
1979
|
-
transformOrigin: "top left",
|
|
1980
|
-
width: o.layout.orientation === "landscape" ? "297mm" : "210mm",
|
|
1981
|
-
height: o.layout.orientation === "landscape" ? "210mm" : "297mm"
|
|
1982
|
-
},
|
|
1983
|
-
onDragOver: (t) => t.preventDefault(),
|
|
1984
|
-
onDrop: z,
|
|
1985
|
-
onClick: () => h(null),
|
|
1986
|
-
children: [
|
|
1987
|
-
o.layout.elements.map((t) => /* @__PURE__ */ e(
|
|
1988
|
-
De,
|
|
1989
|
-
{
|
|
1990
|
-
element: t,
|
|
1991
|
-
isSelected: (d == null ? void 0 : d.id) === t.id,
|
|
1992
|
-
onSelect: () => h(t),
|
|
1993
|
-
onUpdate: (b) => I(t.id, b),
|
|
1994
|
-
onDelete: () => S(t.id)
|
|
1995
|
-
},
|
|
1996
|
-
t.id
|
|
1997
|
-
)),
|
|
1998
|
-
o.layout.elements.length === 0 && /* @__PURE__ */ e("div", { className: "nice-report-builder__canvas-empty", children: "Drag elements here to build your report" })
|
|
1999
|
-
]
|
|
2000
|
-
}
|
|
2001
|
-
) }),
|
|
2002
|
-
l === "data" && /* @__PURE__ */ e(
|
|
2003
|
-
He,
|
|
2004
|
-
{
|
|
2005
|
-
report: o,
|
|
2006
|
-
dataSource: y,
|
|
2007
|
-
onChange: (t) => C((b) => ({ ...b, query: t }))
|
|
2008
|
-
}
|
|
2009
|
-
),
|
|
2010
|
-
l === "parameters" && /* @__PURE__ */ e(
|
|
2011
|
-
ke,
|
|
2012
|
-
{
|
|
2013
|
-
parameters: o.parameters,
|
|
2014
|
-
calculations: o.calculations,
|
|
2015
|
-
onChange: (t, b) => C((_) => ({ ..._, parameters: t, calculations: b }))
|
|
2016
|
-
}
|
|
2017
|
-
),
|
|
2018
|
-
l === "formatting" && /* @__PURE__ */ e(
|
|
2019
|
-
Te,
|
|
2020
|
-
{
|
|
2021
|
-
formatting: o.formatting,
|
|
2022
|
-
grouping: o.grouping,
|
|
2023
|
-
sorting: o.sorting,
|
|
2024
|
-
onChange: (t, b, _) => C((R) => ({ ...R, formatting: t, grouping: b, sorting: _ }))
|
|
2025
|
-
}
|
|
2026
|
-
),
|
|
2027
|
-
d && l === "design" && /* @__PURE__ */ e(
|
|
2028
|
-
Re,
|
|
2029
|
-
{
|
|
2030
|
-
element: d,
|
|
2031
|
-
dataSource: y,
|
|
2032
|
-
onChange: (t) => I(d.id, t),
|
|
2033
|
-
onClose: () => h(null)
|
|
2034
|
-
}
|
|
2035
|
-
)
|
|
2036
|
-
] })
|
|
2037
|
-
] });
|
|
2038
|
-
}
|
|
2039
|
-
function Ce(r) {
|
|
2040
|
-
switch (r) {
|
|
2041
|
-
case "table":
|
|
2042
|
-
return { columns: [], showHeader: !0, showFooter: !1 };
|
|
2043
|
-
case "chart":
|
|
2044
|
-
return { chartType: "bar", series: [], axes: [] };
|
|
2045
|
-
case "text":
|
|
2046
|
-
return { content: "Text", fontSize: 12 };
|
|
2047
|
-
case "image":
|
|
2048
|
-
return { src: "", fit: "contain" };
|
|
2049
|
-
case "shape":
|
|
2050
|
-
return {
|
|
2051
|
-
shape: "rectangle",
|
|
2052
|
-
fill: "var(--nice-border, #e0e0e0)",
|
|
2053
|
-
stroke: "var(--nice-text, #333)"
|
|
2054
|
-
};
|
|
2055
|
-
case "barcode":
|
|
2056
|
-
return { format: "CODE128", value: "" };
|
|
2057
|
-
case "qrcode":
|
|
2058
|
-
return { value: "" };
|
|
2059
|
-
case "subreport":
|
|
2060
|
-
return { reportId: "" };
|
|
2061
|
-
case "page-break":
|
|
2062
|
-
return {};
|
|
2063
|
-
default:
|
|
2064
|
-
return {};
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
function De({
|
|
2068
|
-
element: r,
|
|
2069
|
-
isSelected: i,
|
|
2070
|
-
onSelect: n,
|
|
2071
|
-
onUpdate: s,
|
|
2072
|
-
onDelete: c
|
|
2073
|
-
}) {
|
|
2074
|
-
var M;
|
|
2075
|
-
const [u, m] = D(!1), [o, v] = D(!1), d = (N) => {
|
|
2076
|
-
if (N.button !== 0)
|
|
2077
|
-
return;
|
|
2078
|
-
N.stopPropagation(), n(), m(!0);
|
|
2079
|
-
const C = N.clientX, P = N.clientY, I = { ...r.position }, S = (A) => {
|
|
2080
|
-
const U = A.clientX - C, y = A.clientY - P;
|
|
2081
|
-
s({
|
|
2082
|
-
position: {
|
|
2083
|
-
...I,
|
|
2084
|
-
x: Math.max(0, I.x + U),
|
|
2085
|
-
y: Math.max(0, I.y + y)
|
|
2086
|
-
}
|
|
2087
|
-
});
|
|
2088
|
-
}, z = () => {
|
|
2089
|
-
m(!1), window.removeEventListener("mousemove", S), window.removeEventListener("mouseup", z);
|
|
2090
|
-
};
|
|
2091
|
-
window.addEventListener("mousemove", S), window.addEventListener("mouseup", z);
|
|
2092
|
-
}, h = (N, C) => {
|
|
2093
|
-
N.stopPropagation(), v(!0);
|
|
2094
|
-
const P = N.clientX, I = N.clientY, S = { ...r.position }, z = (U) => {
|
|
2095
|
-
const y = U.clientX - P, t = U.clientY - I, b = { ...S };
|
|
2096
|
-
C.includes("e") && (b.width = Math.max(50, S.width + y)), C.includes("s") && (b.height = Math.max(30, S.height + t)), C.includes("w") && (b.x = S.x + y, b.width = Math.max(50, S.width - y)), C.includes("n") && (b.y = S.y + t, b.height = Math.max(30, S.height - t)), s({ position: b });
|
|
2097
|
-
}, A = () => {
|
|
2098
|
-
v(!1), window.removeEventListener("mousemove", z), window.removeEventListener("mouseup", A);
|
|
2099
|
-
};
|
|
2100
|
-
window.addEventListener("mousemove", z), window.addEventListener("mouseup", A);
|
|
2101
|
-
}, l = G.find((N) => N.type === r.type), { padding: g, ...E } = r.style ?? {}, T = typeof g == "object" && g !== null ? `${g.top}px ${g.right}px ${g.bottom}px ${g.left}px` : g;
|
|
2102
|
-
return /* @__PURE__ */ a(
|
|
2103
|
-
"div",
|
|
2104
|
-
{
|
|
2105
|
-
className: `nice-report-builder__element nice-report-builder__element--${r.type} ${i ? "nice-report-builder__element--selected" : ""}`,
|
|
2106
|
-
style: {
|
|
2107
|
-
left: r.position.x,
|
|
2108
|
-
top: r.position.y,
|
|
2109
|
-
width: r.position.width,
|
|
2110
|
-
height: r.position.height,
|
|
2111
|
-
...E,
|
|
2112
|
-
padding: T
|
|
2113
|
-
},
|
|
2114
|
-
onMouseDown: d,
|
|
2115
|
-
children: [
|
|
2116
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__element-content", children: [
|
|
2117
|
-
/* @__PURE__ */ e("span", { className: "nice-report-builder__element-icon", children: l == null ? void 0 : l.icon }),
|
|
2118
|
-
/* @__PURE__ */ e("span", { className: "nice-report-builder__element-label", children: ((M = r.binding) == null ? void 0 : M.field) || (l == null ? void 0 : l.label) })
|
|
2119
|
-
] }),
|
|
2120
|
-
i && /* @__PURE__ */ a($, { children: [
|
|
2121
|
-
/* @__PURE__ */ e(
|
|
2122
|
-
"button",
|
|
2123
|
-
{
|
|
2124
|
-
className: "nice-report-builder__element-delete",
|
|
2125
|
-
onClick: (N) => {
|
|
2126
|
-
N.stopPropagation(), c();
|
|
2127
|
-
},
|
|
2128
|
-
children: "×"
|
|
2129
|
-
}
|
|
2130
|
-
),
|
|
2131
|
-
/* @__PURE__ */ e(
|
|
2132
|
-
"div",
|
|
2133
|
-
{
|
|
2134
|
-
className: "nice-report-builder__resize-handle nice-report-builder__resize-handle--se",
|
|
2135
|
-
onMouseDown: (N) => h(N, "se")
|
|
2136
|
-
}
|
|
2137
|
-
),
|
|
2138
|
-
/* @__PURE__ */ e(
|
|
2139
|
-
"div",
|
|
2140
|
-
{
|
|
2141
|
-
className: "nice-report-builder__resize-handle nice-report-builder__resize-handle--e",
|
|
2142
|
-
onMouseDown: (N) => h(N, "e")
|
|
2143
|
-
}
|
|
2144
|
-
),
|
|
2145
|
-
/* @__PURE__ */ e(
|
|
2146
|
-
"div",
|
|
2147
|
-
{
|
|
2148
|
-
className: "nice-report-builder__resize-handle nice-report-builder__resize-handle--s",
|
|
2149
|
-
onMouseDown: (N) => h(N, "s")
|
|
2150
|
-
}
|
|
2151
|
-
)
|
|
2152
|
-
] })
|
|
2153
|
-
]
|
|
2154
|
-
}
|
|
2155
|
-
);
|
|
2156
|
-
}
|
|
2157
|
-
function He({
|
|
2158
|
-
report: r,
|
|
2159
|
-
dataSource: i,
|
|
2160
|
-
onChange: n
|
|
2161
|
-
}) {
|
|
2162
|
-
var u, m, o, v;
|
|
2163
|
-
const [s, c] = D("builder");
|
|
2164
|
-
return /* @__PURE__ */ a("div", { className: "nice-report-builder__query-builder", children: [
|
|
2165
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__query-tabs", children: [
|
|
2166
|
-
/* @__PURE__ */ e("button", { className: s === "builder" ? "active" : "", onClick: () => c("builder"), children: "Query Builder" }),
|
|
2167
|
-
/* @__PURE__ */ e("button", { className: s === "sql" ? "active" : "", onClick: () => c("sql"), children: "SQL" })
|
|
2168
|
-
] }),
|
|
2169
|
-
s === "builder" ? /* @__PURE__ */ a("div", { className: "nice-report-builder__visual-query", children: [
|
|
2170
|
-
/* @__PURE__ */ e("h4", { children: "Tables" }),
|
|
2171
|
-
(u = i == null ? void 0 : i.schema) == null ? void 0 : u.tables.map((d) => {
|
|
2172
|
-
var h, l;
|
|
2173
|
-
return /* @__PURE__ */ e("div", { className: "nice-report-builder__query-table", children: /* @__PURE__ */ a("label", { children: [
|
|
2174
|
-
/* @__PURE__ */ e(
|
|
2175
|
-
"input",
|
|
2176
|
-
{
|
|
2177
|
-
type: "checkbox",
|
|
2178
|
-
checked: ((l = (h = r.query) == null ? void 0 : h.tables) == null ? void 0 : l.includes(d.name)) || !1,
|
|
2179
|
-
onChange: (g) => {
|
|
2180
|
-
var T, M;
|
|
2181
|
-
const E = g.target.checked ? [...((T = r.query) == null ? void 0 : T.tables) || [], d.name] : (((M = r.query) == null ? void 0 : M.tables) || []).filter((N) => N !== d.name);
|
|
2182
|
-
n({ ...r.query, type: "builder", tables: E });
|
|
2183
|
-
}
|
|
2184
|
-
}
|
|
2185
|
-
),
|
|
2186
|
-
d.name
|
|
2187
|
-
] }) }, d.name);
|
|
2188
|
-
}),
|
|
2189
|
-
/* @__PURE__ */ e("h4", { children: "Columns" }),
|
|
2190
|
-
/* @__PURE__ */ e("div", { className: "nice-report-builder__column-list", children: (o = (m = r.query) == null ? void 0 : m.tables) == null ? void 0 : o.map((d) => {
|
|
2191
|
-
var l;
|
|
2192
|
-
const h = (l = i == null ? void 0 : i.schema) == null ? void 0 : l.tables.find((g) => g.name === d);
|
|
2193
|
-
return h == null ? void 0 : h.columns.map((g) => /* @__PURE__ */ a("div", { className: "nice-report-builder__column-item", children: [
|
|
2194
|
-
/* @__PURE__ */ e("input", { type: "checkbox" }),
|
|
2195
|
-
/* @__PURE__ */ a("span", { children: [
|
|
2196
|
-
d,
|
|
2197
|
-
".",
|
|
2198
|
-
g.name
|
|
2199
|
-
] }),
|
|
2200
|
-
/* @__PURE__ */ a("select", { children: [
|
|
2201
|
-
/* @__PURE__ */ e("option", { value: "", children: "No aggregate" }),
|
|
2202
|
-
/* @__PURE__ */ e("option", { value: "sum", children: "SUM" }),
|
|
2203
|
-
/* @__PURE__ */ e("option", { value: "avg", children: "AVG" }),
|
|
2204
|
-
/* @__PURE__ */ e("option", { value: "count", children: "COUNT" }),
|
|
2205
|
-
/* @__PURE__ */ e("option", { value: "min", children: "MIN" }),
|
|
2206
|
-
/* @__PURE__ */ e("option", { value: "max", children: "MAX" })
|
|
2207
|
-
] })
|
|
2208
|
-
] }, `${d}.${g.name}`));
|
|
2209
|
-
}) })
|
|
2210
|
-
] }) : /* @__PURE__ */ e("div", { className: "nice-report-builder__sql-editor", children: /* @__PURE__ */ e(
|
|
2211
|
-
"textarea",
|
|
2212
|
-
{
|
|
2213
|
-
value: ((v = r.query) == null ? void 0 : v.text) || "",
|
|
2214
|
-
onChange: (d) => n({ ...r.query, type: "sql", text: d.target.value }),
|
|
2215
|
-
placeholder: "SELECT * FROM table_name",
|
|
2216
|
-
rows: 15
|
|
2217
|
-
}
|
|
2218
|
-
) })
|
|
2219
|
-
] });
|
|
2220
|
-
}
|
|
2221
|
-
function ke({
|
|
2222
|
-
parameters: r,
|
|
2223
|
-
calculations: i,
|
|
2224
|
-
onChange: n
|
|
2225
|
-
}) {
|
|
2226
|
-
const s = () => {
|
|
2227
|
-
const u = {
|
|
2228
|
-
id: crypto.randomUUID(),
|
|
2229
|
-
name: "param" + (r.length + 1),
|
|
2230
|
-
label: "Parameter " + (r.length + 1),
|
|
2231
|
-
type: "text"
|
|
2232
|
-
};
|
|
2233
|
-
n([...r, u], i);
|
|
2234
|
-
}, c = () => {
|
|
2235
|
-
const u = {
|
|
2236
|
-
id: crypto.randomUUID(),
|
|
2237
|
-
name: "calc" + (i.length + 1),
|
|
2238
|
-
expression: ""
|
|
2239
|
-
};
|
|
2240
|
-
n(r, [...i, u]);
|
|
2241
|
-
};
|
|
2242
|
-
return /* @__PURE__ */ a("div", { className: "nice-report-builder__parameters-editor", children: [
|
|
2243
|
-
/* @__PURE__ */ a("section", { children: [
|
|
2244
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__section-header", children: [
|
|
2245
|
-
/* @__PURE__ */ e("h4", { children: "Parameters" }),
|
|
2246
|
-
/* @__PURE__ */ e("button", { onClick: s, children: "+ Add" })
|
|
2247
|
-
] }),
|
|
2248
|
-
r.map((u, m) => /* @__PURE__ */ a("div", { className: "nice-report-builder__param-row", children: [
|
|
2249
|
-
/* @__PURE__ */ e(
|
|
2250
|
-
"input",
|
|
2251
|
-
{
|
|
2252
|
-
type: "text",
|
|
2253
|
-
value: u.name,
|
|
2254
|
-
placeholder: "Name",
|
|
2255
|
-
onChange: (o) => {
|
|
2256
|
-
const v = [...r];
|
|
2257
|
-
v[m] = { ...u, name: o.target.value }, n(v, i);
|
|
2258
|
-
}
|
|
2259
|
-
}
|
|
2260
|
-
),
|
|
2261
|
-
/* @__PURE__ */ e(
|
|
2262
|
-
"input",
|
|
2263
|
-
{
|
|
2264
|
-
type: "text",
|
|
2265
|
-
value: u.label,
|
|
2266
|
-
placeholder: "Label",
|
|
2267
|
-
onChange: (o) => {
|
|
2268
|
-
const v = [...r];
|
|
2269
|
-
v[m] = { ...u, label: o.target.value }, n(v, i);
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
),
|
|
2273
|
-
/* @__PURE__ */ a(
|
|
2274
|
-
"select",
|
|
2275
|
-
{
|
|
2276
|
-
value: u.type,
|
|
2277
|
-
onChange: (o) => {
|
|
2278
|
-
const v = [...r];
|
|
2279
|
-
v[m] = { ...u, type: o.target.value }, n(v, i);
|
|
2280
|
-
},
|
|
2281
|
-
children: [
|
|
2282
|
-
/* @__PURE__ */ e("option", { value: "text", children: "Text" }),
|
|
2283
|
-
/* @__PURE__ */ e("option", { value: "number", children: "Number" }),
|
|
2284
|
-
/* @__PURE__ */ e("option", { value: "date", children: "Date" }),
|
|
2285
|
-
/* @__PURE__ */ e("option", { value: "daterange", children: "Date Range" }),
|
|
2286
|
-
/* @__PURE__ */ e("option", { value: "select", children: "Select" }),
|
|
2287
|
-
/* @__PURE__ */ e("option", { value: "multiselect", children: "Multi-select" })
|
|
2288
|
-
]
|
|
2289
|
-
}
|
|
2290
|
-
),
|
|
2291
|
-
/* @__PURE__ */ e(
|
|
2292
|
-
"button",
|
|
2293
|
-
{
|
|
2294
|
-
onClick: () => {
|
|
2295
|
-
n(
|
|
2296
|
-
r.filter((o) => o.id !== u.id),
|
|
2297
|
-
i
|
|
2298
|
-
);
|
|
2299
|
-
},
|
|
2300
|
-
children: "×"
|
|
2301
|
-
}
|
|
2302
|
-
)
|
|
2303
|
-
] }, u.id))
|
|
2304
|
-
] }),
|
|
2305
|
-
/* @__PURE__ */ a("section", { children: [
|
|
2306
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__section-header", children: [
|
|
2307
|
-
/* @__PURE__ */ e("h4", { children: "Calculated Fields" }),
|
|
2308
|
-
/* @__PURE__ */ e("button", { onClick: c, children: "+ Add" })
|
|
2309
|
-
] }),
|
|
2310
|
-
i.map((u, m) => /* @__PURE__ */ a("div", { className: "nice-report-builder__calc-row", children: [
|
|
2311
|
-
/* @__PURE__ */ e(
|
|
2312
|
-
"input",
|
|
2313
|
-
{
|
|
2314
|
-
type: "text",
|
|
2315
|
-
value: u.name,
|
|
2316
|
-
placeholder: "Name",
|
|
2317
|
-
onChange: (o) => {
|
|
2318
|
-
const v = [...i];
|
|
2319
|
-
v[m] = { ...u, name: o.target.value }, n(r, v);
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
),
|
|
2323
|
-
/* @__PURE__ */ e(
|
|
2324
|
-
"input",
|
|
2325
|
-
{
|
|
2326
|
-
type: "text",
|
|
2327
|
-
value: u.expression,
|
|
2328
|
-
placeholder: "Expression (e.g., [Sales] * [Quantity])",
|
|
2329
|
-
onChange: (o) => {
|
|
2330
|
-
const v = [...i];
|
|
2331
|
-
v[m] = { ...u, expression: o.target.value }, n(r, v);
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
),
|
|
2335
|
-
/* @__PURE__ */ e(
|
|
2336
|
-
"button",
|
|
2337
|
-
{
|
|
2338
|
-
onClick: () => {
|
|
2339
|
-
n(
|
|
2340
|
-
r,
|
|
2341
|
-
i.filter((o) => o.id !== u.id)
|
|
2342
|
-
);
|
|
2343
|
-
},
|
|
2344
|
-
children: "×"
|
|
2345
|
-
}
|
|
2346
|
-
)
|
|
2347
|
-
] }, u.id))
|
|
2348
|
-
] })
|
|
2349
|
-
] });
|
|
2350
|
-
}
|
|
2351
|
-
function Te({
|
|
2352
|
-
formatting: r,
|
|
2353
|
-
grouping: i,
|
|
2354
|
-
sorting: n,
|
|
2355
|
-
onChange: s
|
|
2356
|
-
}) {
|
|
2357
|
-
return /* @__PURE__ */ a("div", { className: "nice-report-builder__formatting-editor", children: [
|
|
2358
|
-
/* @__PURE__ */ a("section", { children: [
|
|
2359
|
-
/* @__PURE__ */ e("h4", { children: "General" }),
|
|
2360
|
-
/* @__PURE__ */ a("label", { children: [
|
|
2361
|
-
/* @__PURE__ */ e(
|
|
2362
|
-
"input",
|
|
2363
|
-
{
|
|
2364
|
-
type: "checkbox",
|
|
2365
|
-
checked: r.alternateRowColors,
|
|
2366
|
-
onChange: (c) => s({ ...r, alternateRowColors: c.target.checked }, i, n)
|
|
2367
|
-
}
|
|
2368
|
-
),
|
|
2369
|
-
"Alternate row colors"
|
|
2370
|
-
] }),
|
|
2371
|
-
/* @__PURE__ */ a("label", { children: [
|
|
2372
|
-
/* @__PURE__ */ e(
|
|
2373
|
-
"input",
|
|
2374
|
-
{
|
|
2375
|
-
type: "checkbox",
|
|
2376
|
-
checked: r.gridLines,
|
|
2377
|
-
onChange: (c) => s({ ...r, gridLines: c.target.checked }, i, n)
|
|
2378
|
-
}
|
|
2379
|
-
),
|
|
2380
|
-
"Show grid lines"
|
|
2381
|
-
] })
|
|
2382
|
-
] }),
|
|
2383
|
-
/* @__PURE__ */ a("section", { children: [
|
|
2384
|
-
/* @__PURE__ */ e("h4", { children: "Conditional Formatting" }),
|
|
2385
|
-
/* @__PURE__ */ e(
|
|
2386
|
-
"button",
|
|
2387
|
-
{
|
|
2388
|
-
onClick: () => {
|
|
2389
|
-
const c = {
|
|
2390
|
-
id: crypto.randomUUID(),
|
|
2391
|
-
condition: { column: "", operator: "gt", value: 0 },
|
|
2392
|
-
style: { backgroundColor: "#ffcccc" },
|
|
2393
|
-
scope: "cell"
|
|
2394
|
-
};
|
|
2395
|
-
s(
|
|
2396
|
-
{
|
|
2397
|
-
...r,
|
|
2398
|
-
conditionalFormats: [...r.conditionalFormats, c]
|
|
2399
|
-
},
|
|
2400
|
-
i,
|
|
2401
|
-
n
|
|
2402
|
-
);
|
|
2403
|
-
},
|
|
2404
|
-
children: "+ Add Rule"
|
|
2405
|
-
}
|
|
2406
|
-
),
|
|
2407
|
-
r.conditionalFormats.map((c) => /* @__PURE__ */ a("div", { className: "nice-report-builder__format-rule", children: [
|
|
2408
|
-
/* @__PURE__ */ a("span", { children: [
|
|
2409
|
-
"If column ",
|
|
2410
|
-
c.condition.operator,
|
|
2411
|
-
" ",
|
|
2412
|
-
String(c.condition.value)
|
|
2413
|
-
] }),
|
|
2414
|
-
/* @__PURE__ */ e(
|
|
2415
|
-
"input",
|
|
2416
|
-
{
|
|
2417
|
-
type: "color",
|
|
2418
|
-
value: c.style.backgroundColor || "var(--nice-bg, #fff)",
|
|
2419
|
-
onChange: (u) => {
|
|
2420
|
-
s(
|
|
2421
|
-
{
|
|
2422
|
-
...r,
|
|
2423
|
-
conditionalFormats: r.conditionalFormats.map(
|
|
2424
|
-
(m) => m.id === c.id ? { ...m, style: { ...m.style, backgroundColor: u.target.value } } : m
|
|
2425
|
-
)
|
|
2426
|
-
},
|
|
2427
|
-
i,
|
|
2428
|
-
n
|
|
2429
|
-
);
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
)
|
|
2433
|
-
] }, c.id))
|
|
2434
|
-
] })
|
|
2435
|
-
] });
|
|
2436
|
-
}
|
|
2437
|
-
function Re({
|
|
2438
|
-
element: r,
|
|
2439
|
-
dataSource: i,
|
|
2440
|
-
onChange: n,
|
|
2441
|
-
onClose: s
|
|
2442
|
-
}) {
|
|
2443
|
-
var c, u, m, o, v, d, h;
|
|
2444
|
-
return /* @__PURE__ */ a("div", { className: "nice-report-builder__properties", children: [
|
|
2445
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__properties-header", children: [
|
|
2446
|
-
/* @__PURE__ */ a("h4", { children: [
|
|
2447
|
-
(c = G.find((l) => l.type === r.type)) == null ? void 0 : c.label,
|
|
2448
|
-
" Properties"
|
|
2449
|
-
] }),
|
|
2450
|
-
/* @__PURE__ */ e("button", { onClick: s, children: "×" })
|
|
2451
|
-
] }),
|
|
2452
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__properties-content", children: [
|
|
2453
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2454
|
-
/* @__PURE__ */ e("label", { children: "Data Binding" }),
|
|
2455
|
-
/* @__PURE__ */ a(
|
|
2456
|
-
"select",
|
|
2457
|
-
{
|
|
2458
|
-
value: ((u = r.binding) == null ? void 0 : u.field) || "",
|
|
2459
|
-
onChange: (l) => n({ binding: { ...r.binding, field: l.target.value } }),
|
|
2460
|
-
children: [
|
|
2461
|
-
/* @__PURE__ */ e("option", { value: "", children: "None" }),
|
|
2462
|
-
(m = i == null ? void 0 : i.schema) == null ? void 0 : m.tables.flatMap(
|
|
2463
|
-
(l) => l.columns.map((g) => /* @__PURE__ */ a("option", { value: `${l.name}.${g.name}`, children: [
|
|
2464
|
-
l.name,
|
|
2465
|
-
".",
|
|
2466
|
-
g.name
|
|
2467
|
-
] }, `${l.name}.${g.name}`))
|
|
2468
|
-
)
|
|
2469
|
-
]
|
|
2470
|
-
}
|
|
2471
|
-
)
|
|
2472
|
-
] }),
|
|
2473
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2474
|
-
/* @__PURE__ */ e("label", { children: "Position" }),
|
|
2475
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__position-inputs", children: [
|
|
2476
|
-
/* @__PURE__ */ e(
|
|
2477
|
-
"input",
|
|
2478
|
-
{
|
|
2479
|
-
type: "number",
|
|
2480
|
-
value: r.position.x,
|
|
2481
|
-
onChange: (l) => n({
|
|
2482
|
-
position: { ...r.position, x: parseInt(l.target.value, 10) || 0 }
|
|
2483
|
-
}),
|
|
2484
|
-
placeholder: "X"
|
|
2485
|
-
}
|
|
2486
|
-
),
|
|
2487
|
-
/* @__PURE__ */ e(
|
|
2488
|
-
"input",
|
|
2489
|
-
{
|
|
2490
|
-
type: "number",
|
|
2491
|
-
value: r.position.y,
|
|
2492
|
-
onChange: (l) => n({
|
|
2493
|
-
position: { ...r.position, y: parseInt(l.target.value, 10) || 0 }
|
|
2494
|
-
}),
|
|
2495
|
-
placeholder: "Y"
|
|
2496
|
-
}
|
|
2497
|
-
),
|
|
2498
|
-
/* @__PURE__ */ e(
|
|
2499
|
-
"input",
|
|
2500
|
-
{
|
|
2501
|
-
type: "number",
|
|
2502
|
-
value: r.position.width,
|
|
2503
|
-
onChange: (l) => n({
|
|
2504
|
-
position: { ...r.position, width: parseInt(l.target.value, 10) || 50 }
|
|
2505
|
-
}),
|
|
2506
|
-
placeholder: "W"
|
|
2507
|
-
}
|
|
2508
|
-
),
|
|
2509
|
-
/* @__PURE__ */ e(
|
|
2510
|
-
"input",
|
|
2511
|
-
{
|
|
2512
|
-
type: "number",
|
|
2513
|
-
value: r.position.height,
|
|
2514
|
-
onChange: (l) => n({
|
|
2515
|
-
position: { ...r.position, height: parseInt(l.target.value, 10) || 30 }
|
|
2516
|
-
}),
|
|
2517
|
-
placeholder: "H"
|
|
2518
|
-
}
|
|
2519
|
-
)
|
|
2520
|
-
] })
|
|
2521
|
-
] }),
|
|
2522
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2523
|
-
/* @__PURE__ */ e("label", { children: "Background Color" }),
|
|
2524
|
-
/* @__PURE__ */ e(
|
|
2525
|
-
"input",
|
|
2526
|
-
{
|
|
2527
|
-
type: "color",
|
|
2528
|
-
value: ((o = r.style) == null ? void 0 : o.backgroundColor) || "var(--nice-bg, #fff)",
|
|
2529
|
-
onChange: (l) => n({ style: { ...r.style, backgroundColor: l.target.value } })
|
|
2530
|
-
}
|
|
2531
|
-
)
|
|
2532
|
-
] }),
|
|
2533
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2534
|
-
/* @__PURE__ */ e("label", { children: "Border" }),
|
|
2535
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__border-inputs", children: [
|
|
2536
|
-
/* @__PURE__ */ e(
|
|
2537
|
-
"input",
|
|
2538
|
-
{
|
|
2539
|
-
type: "color",
|
|
2540
|
-
value: ((v = r.style) == null ? void 0 : v.borderColor) || "var(--nice-text, #000000)",
|
|
2541
|
-
onChange: (l) => n({ style: { ...r.style, borderColor: l.target.value } })
|
|
2542
|
-
}
|
|
2543
|
-
),
|
|
2544
|
-
/* @__PURE__ */ e(
|
|
2545
|
-
"input",
|
|
2546
|
-
{
|
|
2547
|
-
type: "number",
|
|
2548
|
-
value: ((d = r.style) == null ? void 0 : d.borderWidth) || 0,
|
|
2549
|
-
onChange: (l) => n({
|
|
2550
|
-
style: { ...r.style, borderWidth: parseInt(l.target.value, 10) || 0 }
|
|
2551
|
-
}),
|
|
2552
|
-
placeholder: "Width",
|
|
2553
|
-
min: 0,
|
|
2554
|
-
max: 10
|
|
2555
|
-
}
|
|
2556
|
-
)
|
|
2557
|
-
] })
|
|
2558
|
-
] }),
|
|
2559
|
-
r.type === "text" && /* @__PURE__ */ a($, { children: [
|
|
2560
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2561
|
-
/* @__PURE__ */ e("label", { children: "Content" }),
|
|
2562
|
-
/* @__PURE__ */ e(
|
|
2563
|
-
"textarea",
|
|
2564
|
-
{
|
|
2565
|
-
value: r.config.content || "",
|
|
2566
|
-
onChange: (l) => n({ config: { ...r.config, content: l.target.value } }),
|
|
2567
|
-
rows: 3
|
|
2568
|
-
}
|
|
2569
|
-
)
|
|
2570
|
-
] }),
|
|
2571
|
-
/* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2572
|
-
/* @__PURE__ */ e("label", { children: "Font Size" }),
|
|
2573
|
-
/* @__PURE__ */ e(
|
|
2574
|
-
"input",
|
|
2575
|
-
{
|
|
2576
|
-
type: "number",
|
|
2577
|
-
value: ((h = r.style) == null ? void 0 : h.fontSize) || 12,
|
|
2578
|
-
onChange: (l) => n({
|
|
2579
|
-
style: { ...r.style, fontSize: parseInt(l.target.value, 10) || 12 }
|
|
2580
|
-
}),
|
|
2581
|
-
min: 8,
|
|
2582
|
-
max: 72
|
|
2583
|
-
}
|
|
2584
|
-
)
|
|
2585
|
-
] })
|
|
2586
|
-
] }),
|
|
2587
|
-
r.type === "chart" && /* @__PURE__ */ a("div", { className: "nice-report-builder__field", children: [
|
|
2588
|
-
/* @__PURE__ */ e("label", { children: "Chart Type" }),
|
|
2589
|
-
/* @__PURE__ */ a(
|
|
2590
|
-
"select",
|
|
2591
|
-
{
|
|
2592
|
-
value: r.config.chartType || "bar",
|
|
2593
|
-
onChange: (l) => n({ config: { ...r.config, chartType: l.target.value } }),
|
|
2594
|
-
children: [
|
|
2595
|
-
/* @__PURE__ */ e("option", { value: "bar", children: "Bar" }),
|
|
2596
|
-
/* @__PURE__ */ e("option", { value: "line", children: "Line" }),
|
|
2597
|
-
/* @__PURE__ */ e("option", { value: "pie", children: "Pie" }),
|
|
2598
|
-
/* @__PURE__ */ e("option", { value: "area", children: "Area" }),
|
|
2599
|
-
/* @__PURE__ */ e("option", { value: "scatter", children: "Scatter" })
|
|
2600
|
-
]
|
|
2601
|
-
}
|
|
2602
|
-
)
|
|
2603
|
-
] })
|
|
2604
|
-
] })
|
|
2605
|
-
] });
|
|
2606
|
-
}
|
|
2607
|
-
const Ee = [
|
|
2608
|
-
{
|
|
2609
|
-
target: ".nice-dashboard-studio",
|
|
2610
|
-
titleKey: "tutorial.dashboardStudio.intro.title",
|
|
2611
|
-
title: "Dashboard studio",
|
|
2612
|
-
contentKey: "tutorial.dashboardStudio.intro.content",
|
|
2613
|
-
content: "Drag widgets from the palette onto the grid, bind them to data sources, add filters, then toggle Edit/View, refresh and save.",
|
|
2614
|
-
placement: "auto"
|
|
2615
|
-
}
|
|
2616
|
-
], Me = {
|
|
2617
|
-
id: "",
|
|
2618
|
-
name: "New Dashboard",
|
|
2619
|
-
layout: {
|
|
2620
|
-
type: "grid",
|
|
2621
|
-
columns: 12,
|
|
2622
|
-
rowHeight: 50,
|
|
2623
|
-
gap: 8
|
|
2624
|
-
},
|
|
2625
|
-
widgets: [],
|
|
2626
|
-
filters: []
|
|
2627
|
-
}, q = [
|
|
2628
|
-
{ type: "chart", label: "Chart", icon: "📈", category: "Visualization" },
|
|
2629
|
-
{ type: "table", label: "Table", icon: "📊", category: "Visualization" },
|
|
2630
|
-
{ type: "card", label: "KPI Card", icon: "🎯", category: "Visualization" },
|
|
2631
|
-
{ type: "gauge", label: "Gauge", icon: "⏱️", category: "Visualization" },
|
|
2632
|
-
{ type: "map", label: "Map", icon: "🗺️", category: "Visualization" },
|
|
2633
|
-
{ type: "treemap", label: "Treemap", icon: "🌳", category: "Visualization" },
|
|
2634
|
-
{ type: "funnel", label: "Funnel", icon: "🔻", category: "Visualization" },
|
|
2635
|
-
{ type: "heatmap", label: "Heatmap", icon: "🌡️", category: "Visualization" },
|
|
2636
|
-
{ type: "timeline", label: "Timeline", icon: "📅", category: "Visualization" },
|
|
2637
|
-
{ type: "sankey", label: "Sankey", icon: "〰️", category: "Visualization" },
|
|
2638
|
-
{ type: "filter", label: "Filter", icon: "🔍", category: "Controls" },
|
|
2639
|
-
{ type: "slicer", label: "Slicer", icon: "📋", category: "Controls" },
|
|
2640
|
-
{ type: "text", label: "Text", icon: "📝", category: "Layout" },
|
|
2641
|
-
{ type: "image", label: "Image", icon: "🖼️", category: "Layout" }
|
|
2642
|
-
];
|
|
2643
|
-
function Ze({
|
|
2644
|
-
dashboard: r,
|
|
2645
|
-
dataSources: i = [],
|
|
2646
|
-
onChange: n,
|
|
2647
|
-
onWidgetAdd: s,
|
|
2648
|
-
onRefresh: c,
|
|
2649
|
-
className: u = "",
|
|
2650
|
-
tutorial: m
|
|
2651
|
-
}) {
|
|
2652
|
-
const [o, v] = D(
|
|
2653
|
-
r || { ...Me, id: crypto.randomUUID() }
|
|
2654
|
-
), [d, h] = D(null), [l, g] = D(!0), [E, T] = D(null), [M, N] = D(!0), C = Q(null), P = k(
|
|
2655
|
-
(y) => {
|
|
2656
|
-
v((t) => {
|
|
2657
|
-
const b = y(t);
|
|
2658
|
-
return n == null || n(b), b;
|
|
2659
|
-
});
|
|
2660
|
-
},
|
|
2661
|
-
[n]
|
|
2662
|
-
), I = k(
|
|
2663
|
-
(y, t) => {
|
|
2664
|
-
var _;
|
|
2665
|
-
const b = {
|
|
2666
|
-
id: crypto.randomUUID(),
|
|
2667
|
-
type: y,
|
|
2668
|
-
title: ((_ = q.find((R) => R.type === y)) == null ? void 0 : _.label) || y,
|
|
2669
|
-
position: {
|
|
2670
|
-
x: (t == null ? void 0 : t.x) ?? 0,
|
|
2671
|
-
y: (t == null ? void 0 : t.y) ?? Pe(o.widgets),
|
|
2672
|
-
width: (t == null ? void 0 : t.width) ?? Le(y),
|
|
2673
|
-
height: (t == null ? void 0 : t.height) ?? Ie(y)
|
|
2674
|
-
},
|
|
2675
|
-
config: ze(y)
|
|
2676
|
-
};
|
|
2677
|
-
P((R) => ({
|
|
2678
|
-
...R,
|
|
2679
|
-
widgets: [...R.widgets, b]
|
|
2680
|
-
})), h(b), s == null || s(y);
|
|
2681
|
-
},
|
|
2682
|
-
[o.widgets, P, s]
|
|
2683
|
-
), S = k(
|
|
2684
|
-
(y, t) => {
|
|
2685
|
-
P((b) => ({
|
|
2686
|
-
...b,
|
|
2687
|
-
widgets: b.widgets.map((_) => _.id === y ? { ..._, ...t } : _)
|
|
2688
|
-
})), (d == null ? void 0 : d.id) === y && h((b) => b ? { ...b, ...t } : null);
|
|
2689
|
-
},
|
|
2690
|
-
[P, d]
|
|
2691
|
-
), z = k(
|
|
2692
|
-
(y) => {
|
|
2693
|
-
P((t) => ({
|
|
2694
|
-
...t,
|
|
2695
|
-
widgets: t.widgets.filter((b) => b.id !== y)
|
|
2696
|
-
})), h(null);
|
|
2697
|
-
},
|
|
2698
|
-
[P]
|
|
2699
|
-
), A = k(
|
|
2700
|
-
(y) => {
|
|
2701
|
-
if (y.preventDefault(), !E || !C.current)
|
|
2702
|
-
return;
|
|
2703
|
-
const t = C.current.getBoundingClientRect(), b = t.width / (o.layout.columns || 12), _ = Math.floor((y.clientX - t.left) / b), R = Math.floor((y.clientY - t.top) / (o.layout.rowHeight || 50));
|
|
2704
|
-
I(E, { x: _, y: R }), T(null);
|
|
2705
|
-
},
|
|
2706
|
-
[E, o.layout, I]
|
|
2707
|
-
), U = k(() => {
|
|
2708
|
-
c == null || c();
|
|
2709
|
-
}, [c]);
|
|
2710
|
-
return /* @__PURE__ */ a("div", { className: `nice-dashboard-studio ${u}`, children: [
|
|
2711
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__toolbar", children: [
|
|
2712
|
-
/* @__PURE__ */ e(
|
|
2713
|
-
"input",
|
|
2714
|
-
{
|
|
2715
|
-
type: "text",
|
|
2716
|
-
value: o.name,
|
|
2717
|
-
onChange: (y) => P((t) => ({ ...t, name: y.target.value })),
|
|
2718
|
-
className: "nice-dashboard-studio__name-input",
|
|
2719
|
-
disabled: !l
|
|
2720
|
-
}
|
|
2721
|
-
),
|
|
2722
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__actions", children: [
|
|
2723
|
-
/* @__PURE__ */ e(
|
|
2724
|
-
"button",
|
|
2725
|
-
{
|
|
2726
|
-
className: `nice-dashboard-studio__action ${l ? "active" : ""}`,
|
|
2727
|
-
onClick: () => g(!l),
|
|
2728
|
-
children: l ? "✏️ Editing" : "👁 Viewing"
|
|
2729
|
-
}
|
|
2730
|
-
),
|
|
2731
|
-
/* @__PURE__ */ a("button", { onClick: () => N(!M), children: [
|
|
2732
|
-
"🔍 Filters ",
|
|
2733
|
-
M ? "▲" : "▼"
|
|
2734
|
-
] }),
|
|
2735
|
-
/* @__PURE__ */ e("button", { onClick: U, children: "🔄 Refresh" }),
|
|
2736
|
-
/* @__PURE__ */ e("button", { children: "📤 Share" }),
|
|
2737
|
-
/* @__PURE__ */ e("button", { children: "💾 Save" }),
|
|
2738
|
-
/* @__PURE__ */ e(K, { steps: X(m, Ee) })
|
|
2739
|
-
] })
|
|
2740
|
-
] }),
|
|
2741
|
-
M && o.filters.length > 0 && /* @__PURE__ */ e("div", { className: "nice-dashboard-studio__filters-bar", children: o.filters.map((y) => /* @__PURE__ */ e(Fe, { filter: y }, y.id)) }),
|
|
2742
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__main", children: [
|
|
2743
|
-
l && /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__palette", children: [
|
|
2744
|
-
/* @__PURE__ */ e("h4", { children: "Widgets" }),
|
|
2745
|
-
["Visualization", "Controls", "Layout"].map((y) => /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__category", children: [
|
|
2746
|
-
/* @__PURE__ */ e("h5", { children: y }),
|
|
2747
|
-
q.filter((t) => t.category === y).map((t) => /* @__PURE__ */ a(
|
|
2748
|
-
"div",
|
|
2749
|
-
{
|
|
2750
|
-
className: "nice-dashboard-studio__palette-item",
|
|
2751
|
-
draggable: !0,
|
|
2752
|
-
onDragStart: () => T(t.type),
|
|
2753
|
-
onDragEnd: () => T(null),
|
|
2754
|
-
children: [
|
|
2755
|
-
/* @__PURE__ */ e("span", { className: "nice-dashboard-studio__palette-icon", children: t.icon }),
|
|
2756
|
-
/* @__PURE__ */ e("span", { children: t.label })
|
|
2757
|
-
]
|
|
2758
|
-
},
|
|
2759
|
-
t.type
|
|
2760
|
-
))
|
|
2761
|
-
] }, y)),
|
|
2762
|
-
/* @__PURE__ */ e("h4", { children: "Data Sources" }),
|
|
2763
|
-
i.map((y) => /* @__PURE__ */ e("div", { className: "nice-dashboard-studio__datasource", children: /* @__PURE__ */ a("span", { children: [
|
|
2764
|
-
"🗄️ ",
|
|
2765
|
-
y.name
|
|
2766
|
-
] }) }, y.id))
|
|
2767
|
-
] }),
|
|
2768
|
-
/* @__PURE__ */ a(
|
|
2769
|
-
"div",
|
|
2770
|
-
{
|
|
2771
|
-
ref: C,
|
|
2772
|
-
className: `nice-dashboard-studio__grid ${l ? "nice-dashboard-studio__grid--editing" : ""}`,
|
|
2773
|
-
style: {
|
|
2774
|
-
"--columns": o.layout.columns || 12,
|
|
2775
|
-
"--row-height": `${o.layout.rowHeight || 50}px`,
|
|
2776
|
-
"--gap": `${o.layout.gap || 8}px`
|
|
2777
|
-
},
|
|
2778
|
-
onDragOver: (y) => y.preventDefault(),
|
|
2779
|
-
onDrop: A,
|
|
2780
|
-
onClick: () => h(null),
|
|
2781
|
-
children: [
|
|
2782
|
-
o.widgets.map((y) => /* @__PURE__ */ e(
|
|
2783
|
-
Ae,
|
|
2784
|
-
{
|
|
2785
|
-
widget: y,
|
|
2786
|
-
isSelected: (d == null ? void 0 : d.id) === y.id,
|
|
2787
|
-
isEditing: l,
|
|
2788
|
-
onSelect: () => h(y),
|
|
2789
|
-
onUpdate: (t) => S(y.id, t),
|
|
2790
|
-
onDelete: () => z(y.id)
|
|
2791
|
-
},
|
|
2792
|
-
y.id
|
|
2793
|
-
)),
|
|
2794
|
-
o.widgets.length === 0 && l && /* @__PURE__ */ e("div", { className: "nice-dashboard-studio__empty", children: "Drag widgets from the palette to build your dashboard" })
|
|
2795
|
-
]
|
|
2796
|
-
}
|
|
2797
|
-
),
|
|
2798
|
-
d && l && /* @__PURE__ */ e(
|
|
2799
|
-
$e,
|
|
2800
|
-
{
|
|
2801
|
-
widget: d,
|
|
2802
|
-
dataSources: i,
|
|
2803
|
-
onChange: (y) => S(d.id, y),
|
|
2804
|
-
onClose: () => h(null)
|
|
2805
|
-
}
|
|
2806
|
-
)
|
|
2807
|
-
] })
|
|
2808
|
-
] });
|
|
2809
|
-
}
|
|
2810
|
-
function Pe(r) {
|
|
2811
|
-
return r.length === 0 ? 0 : Math.max(...r.map((i) => i.position.y + i.position.height));
|
|
2812
|
-
}
|
|
2813
|
-
function Le(r) {
|
|
2814
|
-
switch (r) {
|
|
2815
|
-
case "card":
|
|
2816
|
-
return 3;
|
|
2817
|
-
case "gauge":
|
|
2818
|
-
return 3;
|
|
2819
|
-
case "filter":
|
|
2820
|
-
case "slicer":
|
|
2821
|
-
return 3;
|
|
2822
|
-
case "text":
|
|
2823
|
-
return 4;
|
|
2824
|
-
case "chart":
|
|
2825
|
-
case "table":
|
|
2826
|
-
return 6;
|
|
2827
|
-
case "map":
|
|
2828
|
-
return 8;
|
|
2829
|
-
default:
|
|
2830
|
-
return 4;
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
function Ie(r) {
|
|
2834
|
-
switch (r) {
|
|
2835
|
-
case "card":
|
|
2836
|
-
return 2;
|
|
2837
|
-
case "gauge":
|
|
2838
|
-
return 3;
|
|
2839
|
-
case "filter":
|
|
2840
|
-
case "slicer":
|
|
2841
|
-
return 1;
|
|
2842
|
-
case "text":
|
|
2843
|
-
return 2;
|
|
2844
|
-
case "chart":
|
|
2845
|
-
case "table":
|
|
2846
|
-
return 5;
|
|
2847
|
-
case "map":
|
|
2848
|
-
return 8;
|
|
2849
|
-
default:
|
|
2850
|
-
return 4;
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
function ze(r) {
|
|
2854
|
-
switch (r) {
|
|
2855
|
-
case "chart":
|
|
2856
|
-
return { chartType: "bar", series: [], axes: [], legend: { show: !0, position: "bottom" } };
|
|
2857
|
-
case "table":
|
|
2858
|
-
return { columns: [], pageSize: 10 };
|
|
2859
|
-
case "card":
|
|
2860
|
-
return { value: "", label: "", format: "number", icon: "📊" };
|
|
2861
|
-
case "gauge":
|
|
2862
|
-
return { value: "0", min: 0, max: 100, target: 75, format: "percent" };
|
|
2863
|
-
case "map":
|
|
2864
|
-
return { type: "choropleth", geoField: "", valueField: "" };
|
|
2865
|
-
case "filter":
|
|
2866
|
-
return { field: "", type: "dropdown" };
|
|
2867
|
-
case "slicer":
|
|
2868
|
-
return { field: "", multiSelect: !0 };
|
|
2869
|
-
case "text":
|
|
2870
|
-
return { content: "Text content", fontSize: 14 };
|
|
2871
|
-
case "image":
|
|
2872
|
-
return { src: "", fit: "contain" };
|
|
2873
|
-
default:
|
|
2874
|
-
return {};
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
function Ae({
|
|
2878
|
-
widget: r,
|
|
2879
|
-
isSelected: i,
|
|
2880
|
-
isEditing: n,
|
|
2881
|
-
onSelect: s,
|
|
2882
|
-
onUpdate: c,
|
|
2883
|
-
onDelete: u
|
|
2884
|
-
}) {
|
|
2885
|
-
const m = (v) => {
|
|
2886
|
-
if (!n || v.button !== 0)
|
|
2887
|
-
return;
|
|
2888
|
-
v.stopPropagation(), s();
|
|
2889
|
-
const d = v.clientX, h = v.clientY, l = { ...r.position }, g = (T) => {
|
|
2890
|
-
const M = Math.round((T.clientX - d) / 50), N = Math.round((T.clientY - h) / 50);
|
|
2891
|
-
c({
|
|
2892
|
-
position: {
|
|
2893
|
-
...l,
|
|
2894
|
-
x: Math.max(0, l.x + M),
|
|
2895
|
-
y: Math.max(0, l.y + N)
|
|
2896
|
-
}
|
|
2897
|
-
});
|
|
2898
|
-
}, E = () => {
|
|
2899
|
-
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", E);
|
|
2900
|
-
};
|
|
2901
|
-
window.addEventListener("mousemove", g), window.addEventListener("mouseup", E);
|
|
2902
|
-
}, o = q.find((v) => v.type === r.type);
|
|
2903
|
-
return /* @__PURE__ */ a(
|
|
2904
|
-
"div",
|
|
2905
|
-
{
|
|
2906
|
-
className: `nice-dashboard-studio__widget nice-dashboard-studio__widget--${r.type} ${i ? "nice-dashboard-studio__widget--selected" : ""}`,
|
|
2907
|
-
style: {
|
|
2908
|
-
gridColumn: `${r.position.x + 1} / span ${r.position.width}`,
|
|
2909
|
-
gridRow: `${r.position.y + 1} / span ${r.position.height}`
|
|
2910
|
-
},
|
|
2911
|
-
onMouseDown: m,
|
|
2912
|
-
children: [
|
|
2913
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__widget-header", children: [
|
|
2914
|
-
/* @__PURE__ */ e("span", { className: "nice-dashboard-studio__widget-icon", children: o == null ? void 0 : o.icon }),
|
|
2915
|
-
/* @__PURE__ */ e("span", { className: "nice-dashboard-studio__widget-title", children: r.title }),
|
|
2916
|
-
n && /* @__PURE__ */ e(
|
|
2917
|
-
"button",
|
|
2918
|
-
{
|
|
2919
|
-
className: "nice-dashboard-studio__widget-delete",
|
|
2920
|
-
onClick: (v) => {
|
|
2921
|
-
v.stopPropagation(), u();
|
|
2922
|
-
},
|
|
2923
|
-
children: "×"
|
|
2924
|
-
}
|
|
2925
|
-
)
|
|
2926
|
-
] }),
|
|
2927
|
-
/* @__PURE__ */ e("div", { className: "nice-dashboard-studio__widget-content", children: /* @__PURE__ */ e(Ue, { widget: r }) })
|
|
2928
|
-
]
|
|
2929
|
-
}
|
|
2930
|
-
);
|
|
2931
|
-
}
|
|
2932
|
-
function Ue({ widget: r }) {
|
|
2933
|
-
switch (r.type) {
|
|
2934
|
-
case "card":
|
|
2935
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__card", children: [
|
|
2936
|
-
/* @__PURE__ */ e("div", { className: "nice-dashboard-studio__card-value", children: String(r.config.value || "0") }),
|
|
2937
|
-
/* @__PURE__ */ e("div", { className: "nice-dashboard-studio__card-label", children: String(r.config.label || "Label") })
|
|
2938
|
-
] });
|
|
2939
|
-
case "gauge": {
|
|
2940
|
-
const i = Number(r.config.value) || 0, n = Number(r.config.max) || 100, s = i / n * 100;
|
|
2941
|
-
return /* @__PURE__ */ e("div", { className: "nice-dashboard-studio__gauge", children: /* @__PURE__ */ a("svg", { viewBox: "0 0 100 60", children: [
|
|
2942
|
-
/* @__PURE__ */ e(
|
|
2943
|
-
"path",
|
|
2944
|
-
{
|
|
2945
|
-
d: "M 10 55 A 40 40 0 0 1 90 55",
|
|
2946
|
-
fill: "none",
|
|
2947
|
-
stroke: "var(--nice-border, #e0e0e0)",
|
|
2948
|
-
strokeWidth: "8"
|
|
2949
|
-
}
|
|
2950
|
-
),
|
|
2951
|
-
/* @__PURE__ */ e(
|
|
2952
|
-
"path",
|
|
2953
|
-
{
|
|
2954
|
-
d: "M 10 55 A 40 40 0 0 1 90 55",
|
|
2955
|
-
fill: "none",
|
|
2956
|
-
stroke: "var(--nice-primary, #0066cc)",
|
|
2957
|
-
strokeWidth: "8",
|
|
2958
|
-
strokeDasharray: `${s * 1.26} 126`
|
|
2959
|
-
}
|
|
2960
|
-
),
|
|
2961
|
-
/* @__PURE__ */ a("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "16", fontWeight: "bold", children: [
|
|
2962
|
-
i,
|
|
2963
|
-
"%"
|
|
2964
|
-
] })
|
|
2965
|
-
] }) });
|
|
2966
|
-
}
|
|
2967
|
-
case "chart":
|
|
2968
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__chart-placeholder", children: [
|
|
2969
|
-
/* @__PURE__ */ e("span", { children: "📊" }),
|
|
2970
|
-
/* @__PURE__ */ a("span", { children: [
|
|
2971
|
-
String(r.config.chartType || "bar"),
|
|
2972
|
-
" chart"
|
|
2973
|
-
] })
|
|
2974
|
-
] });
|
|
2975
|
-
case "table":
|
|
2976
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__table-placeholder", children: [
|
|
2977
|
-
/* @__PURE__ */ e("span", { children: "📋" }),
|
|
2978
|
-
/* @__PURE__ */ e("span", { children: "Data table" })
|
|
2979
|
-
] });
|
|
2980
|
-
case "map":
|
|
2981
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__map-placeholder", children: [
|
|
2982
|
-
/* @__PURE__ */ e("span", { children: "🗺️" }),
|
|
2983
|
-
/* @__PURE__ */ e("span", { children: "Map visualization" })
|
|
2984
|
-
] });
|
|
2985
|
-
case "text":
|
|
2986
|
-
return /* @__PURE__ */ e(
|
|
2987
|
-
"div",
|
|
2988
|
-
{
|
|
2989
|
-
className: "nice-dashboard-studio__text",
|
|
2990
|
-
style: { fontSize: Number(r.config.fontSize) || 14 },
|
|
2991
|
-
children: String(r.config.content || "")
|
|
2992
|
-
}
|
|
2993
|
-
);
|
|
2994
|
-
default:
|
|
2995
|
-
return /* @__PURE__ */ e("div", { className: "nice-dashboard-studio__widget-placeholder", children: r.type });
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
function Fe({ filter: r }) {
|
|
2999
|
-
const [i, n] = D(r.defaultValue);
|
|
3000
|
-
switch (r.type) {
|
|
3001
|
-
case "dropdown":
|
|
3002
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__filter", children: [
|
|
3003
|
-
/* @__PURE__ */ e("label", { children: r.label }),
|
|
3004
|
-
/* @__PURE__ */ e("select", { value: String(i || ""), onChange: (s) => n(s.target.value), children: /* @__PURE__ */ e("option", { value: "", children: "All" }) })
|
|
3005
|
-
] });
|
|
3006
|
-
case "daterange":
|
|
3007
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__filter", children: [
|
|
3008
|
-
/* @__PURE__ */ e("label", { children: r.label }),
|
|
3009
|
-
/* @__PURE__ */ e("input", { type: "date" }),
|
|
3010
|
-
/* @__PURE__ */ e("span", { children: "to" }),
|
|
3011
|
-
/* @__PURE__ */ e("input", { type: "date" })
|
|
3012
|
-
] });
|
|
3013
|
-
case "slider":
|
|
3014
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__filter", children: [
|
|
3015
|
-
/* @__PURE__ */ e("label", { children: r.label }),
|
|
3016
|
-
/* @__PURE__ */ e("input", { type: "range" })
|
|
3017
|
-
] });
|
|
3018
|
-
default:
|
|
3019
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__filter", children: [
|
|
3020
|
-
/* @__PURE__ */ e("label", { children: r.label }),
|
|
3021
|
-
/* @__PURE__ */ e(
|
|
3022
|
-
"input",
|
|
3023
|
-
{
|
|
3024
|
-
type: "text",
|
|
3025
|
-
value: String(i || ""),
|
|
3026
|
-
onChange: (s) => n(s.target.value)
|
|
3027
|
-
}
|
|
3028
|
-
)
|
|
3029
|
-
] });
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
function $e({
|
|
3033
|
-
widget: r,
|
|
3034
|
-
dataSources: i,
|
|
3035
|
-
onChange: n,
|
|
3036
|
-
onClose: s
|
|
3037
|
-
}) {
|
|
3038
|
-
return /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__properties", children: [
|
|
3039
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__properties-header", children: [
|
|
3040
|
-
/* @__PURE__ */ e("h4", { children: "Widget Properties" }),
|
|
3041
|
-
/* @__PURE__ */ e("button", { onClick: s, children: "×" })
|
|
3042
|
-
] }),
|
|
3043
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__properties-content", children: [
|
|
3044
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3045
|
-
/* @__PURE__ */ e("label", { children: "Title" }),
|
|
3046
|
-
/* @__PURE__ */ e(
|
|
3047
|
-
"input",
|
|
3048
|
-
{
|
|
3049
|
-
type: "text",
|
|
3050
|
-
value: r.title || "",
|
|
3051
|
-
onChange: (c) => n({ title: c.target.value })
|
|
3052
|
-
}
|
|
3053
|
-
)
|
|
3054
|
-
] }),
|
|
3055
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3056
|
-
/* @__PURE__ */ e("label", { children: "Data Source" }),
|
|
3057
|
-
/* @__PURE__ */ a(
|
|
3058
|
-
"select",
|
|
3059
|
-
{
|
|
3060
|
-
value: r.dataSource || "",
|
|
3061
|
-
onChange: (c) => n({ dataSource: c.target.value }),
|
|
3062
|
-
children: [
|
|
3063
|
-
/* @__PURE__ */ e("option", { value: "", children: "Select..." }),
|
|
3064
|
-
i.map((c) => /* @__PURE__ */ e("option", { value: c.id, children: c.name }, c.id))
|
|
3065
|
-
]
|
|
3066
|
-
}
|
|
3067
|
-
)
|
|
3068
|
-
] }),
|
|
3069
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3070
|
-
/* @__PURE__ */ e("label", { children: "Size" }),
|
|
3071
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__size-inputs", children: [
|
|
3072
|
-
/* @__PURE__ */ e(
|
|
3073
|
-
"input",
|
|
3074
|
-
{
|
|
3075
|
-
type: "number",
|
|
3076
|
-
value: r.position.width,
|
|
3077
|
-
onChange: (c) => n({
|
|
3078
|
-
position: { ...r.position, width: parseInt(c.target.value, 10) || 1 }
|
|
3079
|
-
}),
|
|
3080
|
-
min: 1,
|
|
3081
|
-
max: 12
|
|
3082
|
-
}
|
|
3083
|
-
),
|
|
3084
|
-
/* @__PURE__ */ e("span", { children: "×" }),
|
|
3085
|
-
/* @__PURE__ */ e(
|
|
3086
|
-
"input",
|
|
3087
|
-
{
|
|
3088
|
-
type: "number",
|
|
3089
|
-
value: r.position.height,
|
|
3090
|
-
onChange: (c) => n({
|
|
3091
|
-
position: { ...r.position, height: parseInt(c.target.value, 10) || 1 }
|
|
3092
|
-
}),
|
|
3093
|
-
min: 1,
|
|
3094
|
-
max: 20
|
|
3095
|
-
}
|
|
3096
|
-
)
|
|
3097
|
-
] })
|
|
3098
|
-
] }),
|
|
3099
|
-
r.type === "chart" && /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3100
|
-
/* @__PURE__ */ e("label", { children: "Chart Type" }),
|
|
3101
|
-
/* @__PURE__ */ a(
|
|
3102
|
-
"select",
|
|
3103
|
-
{
|
|
3104
|
-
value: String(r.config.chartType || "bar"),
|
|
3105
|
-
onChange: (c) => n({ config: { ...r.config, chartType: c.target.value } }),
|
|
3106
|
-
children: [
|
|
3107
|
-
/* @__PURE__ */ e("option", { value: "bar", children: "Bar" }),
|
|
3108
|
-
/* @__PURE__ */ e("option", { value: "line", children: "Line" }),
|
|
3109
|
-
/* @__PURE__ */ e("option", { value: "pie", children: "Pie" }),
|
|
3110
|
-
/* @__PURE__ */ e("option", { value: "area", children: "Area" }),
|
|
3111
|
-
/* @__PURE__ */ e("option", { value: "scatter", children: "Scatter" }),
|
|
3112
|
-
/* @__PURE__ */ e("option", { value: "donut", children: "Donut" })
|
|
3113
|
-
]
|
|
3114
|
-
}
|
|
3115
|
-
)
|
|
3116
|
-
] }),
|
|
3117
|
-
r.type === "card" && /* @__PURE__ */ a($, { children: [
|
|
3118
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3119
|
-
/* @__PURE__ */ e("label", { children: "Value Field" }),
|
|
3120
|
-
/* @__PURE__ */ e(
|
|
3121
|
-
"input",
|
|
3122
|
-
{
|
|
3123
|
-
type: "text",
|
|
3124
|
-
value: String(r.config.value || ""),
|
|
3125
|
-
onChange: (c) => n({ config: { ...r.config, value: c.target.value } }),
|
|
3126
|
-
placeholder: "e.g., SUM(Sales)"
|
|
3127
|
-
}
|
|
3128
|
-
)
|
|
3129
|
-
] }),
|
|
3130
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3131
|
-
/* @__PURE__ */ e("label", { children: "Label" }),
|
|
3132
|
-
/* @__PURE__ */ e(
|
|
3133
|
-
"input",
|
|
3134
|
-
{
|
|
3135
|
-
type: "text",
|
|
3136
|
-
value: String(r.config.label || ""),
|
|
3137
|
-
onChange: (c) => n({ config: { ...r.config, label: c.target.value } })
|
|
3138
|
-
}
|
|
3139
|
-
)
|
|
3140
|
-
] })
|
|
3141
|
-
] }),
|
|
3142
|
-
r.type === "text" && /* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3143
|
-
/* @__PURE__ */ e("label", { children: "Content" }),
|
|
3144
|
-
/* @__PURE__ */ e(
|
|
3145
|
-
"textarea",
|
|
3146
|
-
{
|
|
3147
|
-
value: String(r.config.content || ""),
|
|
3148
|
-
onChange: (c) => n({ config: { ...r.config, content: c.target.value } }),
|
|
3149
|
-
rows: 4
|
|
3150
|
-
}
|
|
3151
|
-
)
|
|
3152
|
-
] }),
|
|
3153
|
-
/* @__PURE__ */ a("div", { className: "nice-dashboard-studio__field", children: [
|
|
3154
|
-
/* @__PURE__ */ e("label", { children: "Refresh Interval (seconds)" }),
|
|
3155
|
-
/* @__PURE__ */ e(
|
|
3156
|
-
"input",
|
|
3157
|
-
{
|
|
3158
|
-
type: "number",
|
|
3159
|
-
value: r.refreshInterval || 0,
|
|
3160
|
-
onChange: (c) => n({ refreshInterval: parseInt(c.target.value, 10) || 0 }),
|
|
3161
|
-
min: 0,
|
|
3162
|
-
placeholder: "0 = manual"
|
|
3163
|
-
}
|
|
3164
|
-
)
|
|
3165
|
-
] })
|
|
3166
|
-
] })
|
|
3167
|
-
] });
|
|
3168
|
-
}
|
|
3169
|
-
const Be = [
|
|
1760
|
+
b(null);
|
|
1761
|
+
const _e = [
|
|
3170
1762
|
{
|
|
3171
1763
|
target: ".nice-etl-builder",
|
|
3172
1764
|
titleKey: "tutorial.etlBuilder.intro.title",
|
|
@@ -3175,14 +1767,14 @@ const Be = [
|
|
|
3175
1767
|
content: "Wire sources → transformations → destinations into a pipeline, switch the views, then run it and save the configuration.",
|
|
3176
1768
|
placement: "auto"
|
|
3177
1769
|
}
|
|
3178
|
-
],
|
|
1770
|
+
], xe = {
|
|
3179
1771
|
id: "",
|
|
3180
1772
|
name: "New Pipeline",
|
|
3181
1773
|
sources: [],
|
|
3182
1774
|
transformations: [],
|
|
3183
1775
|
destinations: [],
|
|
3184
1776
|
version: 1
|
|
3185
|
-
},
|
|
1777
|
+
}, P = [
|
|
3186
1778
|
{ type: "filter", label: "Filter", icon: "🔍" },
|
|
3187
1779
|
{ type: "map", label: "Map", icon: "🔄" },
|
|
3188
1780
|
{ type: "aggregate", label: "Aggregate", icon: "∑" },
|
|
@@ -3200,311 +1792,311 @@ const Be = [
|
|
|
3200
1792
|
{ type: "cleanse", label: "Cleanse", icon: "🧹" },
|
|
3201
1793
|
{ type: "custom", label: "Custom", icon: "ƒ" }
|
|
3202
1794
|
];
|
|
3203
|
-
function
|
|
3204
|
-
pipeline:
|
|
3205
|
-
dataSources:
|
|
3206
|
-
onChange:
|
|
3207
|
-
onRun:
|
|
3208
|
-
onSchedule:
|
|
1795
|
+
function De({
|
|
1796
|
+
pipeline: a,
|
|
1797
|
+
dataSources: r = [],
|
|
1798
|
+
onChange: c,
|
|
1799
|
+
onRun: t,
|
|
1800
|
+
onSchedule: y,
|
|
3209
1801
|
className: u = "",
|
|
3210
|
-
tutorial:
|
|
1802
|
+
tutorial: o
|
|
3211
1803
|
}) {
|
|
3212
|
-
const [
|
|
3213
|
-
|
|
3214
|
-
), [
|
|
3215
|
-
(
|
|
3216
|
-
|
|
3217
|
-
const
|
|
3218
|
-
return
|
|
1804
|
+
const [p, S] = w(
|
|
1805
|
+
a || { ...xe, id: crypto.randomUUID() }
|
|
1806
|
+
), [f, v] = w(null), [_, C] = w("design"), [T, k] = w(!1), [J, G] = w([]), [D, E] = w(null), Z = ie(null), h = x(
|
|
1807
|
+
(n) => {
|
|
1808
|
+
S((s) => {
|
|
1809
|
+
const l = n(s);
|
|
1810
|
+
return c == null || c(l), l;
|
|
3219
1811
|
});
|
|
3220
1812
|
},
|
|
3221
|
-
[
|
|
3222
|
-
),
|
|
3223
|
-
(
|
|
3224
|
-
var
|
|
3225
|
-
const
|
|
1813
|
+
[c]
|
|
1814
|
+
), I = x(
|
|
1815
|
+
(n) => {
|
|
1816
|
+
var l;
|
|
1817
|
+
const s = {
|
|
3226
1818
|
id: crypto.randomUUID(),
|
|
3227
|
-
type:
|
|
3228
|
-
name:
|
|
3229
|
-
config:
|
|
3230
|
-
schema: (
|
|
1819
|
+
type: n.type,
|
|
1820
|
+
name: n.name,
|
|
1821
|
+
config: n.config,
|
|
1822
|
+
schema: (l = n.schema) == null ? void 0 : l.tables[0]
|
|
3231
1823
|
};
|
|
3232
|
-
|
|
3233
|
-
...
|
|
3234
|
-
sources: [...
|
|
1824
|
+
h((g) => ({
|
|
1825
|
+
...g,
|
|
1826
|
+
sources: [...g.sources, s]
|
|
3235
1827
|
}));
|
|
3236
1828
|
},
|
|
3237
|
-
[
|
|
3238
|
-
),
|
|
3239
|
-
(
|
|
3240
|
-
var
|
|
3241
|
-
const
|
|
1829
|
+
[h]
|
|
1830
|
+
), z = x(
|
|
1831
|
+
(n, s) => {
|
|
1832
|
+
var g;
|
|
1833
|
+
const l = {
|
|
3242
1834
|
id: crypto.randomUUID(),
|
|
3243
|
-
type:
|
|
3244
|
-
name: ((
|
|
1835
|
+
type: n,
|
|
1836
|
+
name: ((g = P.find((R) => R.type === n)) == null ? void 0 : g.label) || n,
|
|
3245
1837
|
input: [],
|
|
3246
1838
|
output: crypto.randomUUID(),
|
|
3247
|
-
config:
|
|
1839
|
+
config: He(n)
|
|
3248
1840
|
};
|
|
3249
|
-
|
|
3250
|
-
...
|
|
3251
|
-
transformations: [...
|
|
3252
|
-
})),
|
|
1841
|
+
h((R) => ({
|
|
1842
|
+
...R,
|
|
1843
|
+
transformations: [...R.transformations, l]
|
|
1844
|
+
})), v({ type: "transformation", id: l.id });
|
|
3253
1845
|
},
|
|
3254
|
-
[
|
|
3255
|
-
),
|
|
3256
|
-
const
|
|
1846
|
+
[h]
|
|
1847
|
+
), X = x(() => {
|
|
1848
|
+
const n = {
|
|
3257
1849
|
id: crypto.randomUUID(),
|
|
3258
1850
|
type: "database",
|
|
3259
1851
|
name: "New Destination",
|
|
3260
1852
|
config: {},
|
|
3261
1853
|
writeMode: "append"
|
|
3262
1854
|
};
|
|
3263
|
-
|
|
3264
|
-
...
|
|
3265
|
-
destinations: [...
|
|
3266
|
-
})),
|
|
3267
|
-
}, [
|
|
3268
|
-
(
|
|
3269
|
-
|
|
3270
|
-
switch (
|
|
1855
|
+
h((s) => ({
|
|
1856
|
+
...s,
|
|
1857
|
+
destinations: [...s.destinations, n]
|
|
1858
|
+
})), v({ type: "destination", id: n.id });
|
|
1859
|
+
}, [h]), A = x(
|
|
1860
|
+
(n, s) => {
|
|
1861
|
+
h((l) => {
|
|
1862
|
+
switch (n) {
|
|
3271
1863
|
case "source":
|
|
3272
|
-
return { ...
|
|
1864
|
+
return { ...l, sources: l.sources.filter((g) => g.id !== s) };
|
|
3273
1865
|
case "transformation":
|
|
3274
1866
|
return {
|
|
3275
|
-
...
|
|
3276
|
-
transformations:
|
|
1867
|
+
...l,
|
|
1868
|
+
transformations: l.transformations.filter((g) => g.id !== s)
|
|
3277
1869
|
};
|
|
3278
1870
|
case "destination":
|
|
3279
|
-
return { ...
|
|
1871
|
+
return { ...l, destinations: l.destinations.filter((g) => g.id !== s) };
|
|
3280
1872
|
default:
|
|
3281
|
-
return
|
|
1873
|
+
return l;
|
|
3282
1874
|
}
|
|
3283
|
-
}),
|
|
1875
|
+
}), v(null);
|
|
3284
1876
|
},
|
|
3285
|
-
[
|
|
3286
|
-
),
|
|
3287
|
-
if (
|
|
3288
|
-
|
|
1877
|
+
[h]
|
|
1878
|
+
), Y = x(async () => {
|
|
1879
|
+
if (t) {
|
|
1880
|
+
k(!0);
|
|
3289
1881
|
try {
|
|
3290
|
-
const
|
|
3291
|
-
|
|
1882
|
+
const n = await t(p);
|
|
1883
|
+
G((s) => [n, ...s].slice(0, 50));
|
|
3292
1884
|
} finally {
|
|
3293
|
-
|
|
1885
|
+
k(!1);
|
|
3294
1886
|
}
|
|
3295
1887
|
}
|
|
3296
|
-
}, [
|
|
3297
|
-
(
|
|
3298
|
-
|
|
1888
|
+
}, [p, t]), q = x(
|
|
1889
|
+
(n) => {
|
|
1890
|
+
h((s) => ({ ...s, schedule: n })), y == null || y(p, n);
|
|
3299
1891
|
},
|
|
3300
|
-
[
|
|
3301
|
-
),
|
|
3302
|
-
(
|
|
3303
|
-
if (
|
|
3304
|
-
if (
|
|
3305
|
-
const
|
|
3306
|
-
|
|
1892
|
+
[p, h, y]
|
|
1893
|
+
), Q = x(
|
|
1894
|
+
(n) => {
|
|
1895
|
+
if (n.preventDefault(), !!D) {
|
|
1896
|
+
if (D.startsWith("transform:")) {
|
|
1897
|
+
const s = D.replace("transform:", "");
|
|
1898
|
+
z(s);
|
|
3307
1899
|
}
|
|
3308
|
-
|
|
1900
|
+
E(null);
|
|
3309
1901
|
}
|
|
3310
1902
|
},
|
|
3311
|
-
[
|
|
3312
|
-
),
|
|
3313
|
-
if (!
|
|
1903
|
+
[D, z]
|
|
1904
|
+
), ee = () => {
|
|
1905
|
+
if (!f)
|
|
3314
1906
|
return null;
|
|
3315
|
-
switch (
|
|
1907
|
+
switch (f.type) {
|
|
3316
1908
|
case "source":
|
|
3317
|
-
return
|
|
1909
|
+
return p.sources.find((n) => n.id === f.id);
|
|
3318
1910
|
case "transformation":
|
|
3319
|
-
return
|
|
1911
|
+
return p.transformations.find((n) => n.id === f.id);
|
|
3320
1912
|
case "destination":
|
|
3321
|
-
return
|
|
1913
|
+
return p.destinations.find((n) => n.id === f.id);
|
|
3322
1914
|
default:
|
|
3323
1915
|
return null;
|
|
3324
1916
|
}
|
|
3325
1917
|
};
|
|
3326
|
-
return /* @__PURE__ */
|
|
3327
|
-
/* @__PURE__ */
|
|
1918
|
+
return /* @__PURE__ */ d("div", { className: `nice-etl-builder ${u}`, children: [
|
|
1919
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__toolbar", children: [
|
|
3328
1920
|
/* @__PURE__ */ e(
|
|
3329
1921
|
"input",
|
|
3330
1922
|
{
|
|
3331
1923
|
type: "text",
|
|
3332
|
-
value:
|
|
3333
|
-
onChange: (
|
|
1924
|
+
value: p.name,
|
|
1925
|
+
onChange: (n) => h((s) => ({ ...s, name: n.target.value })),
|
|
3334
1926
|
className: "nice-etl-builder__name-input"
|
|
3335
1927
|
}
|
|
3336
1928
|
),
|
|
3337
|
-
/* @__PURE__ */ e("div", { className: "nice-etl-builder__tabs", children: ["design", "code", "schedule", "history"].map((
|
|
1929
|
+
/* @__PURE__ */ e("div", { className: "nice-etl-builder__tabs", children: ["design", "code", "schedule", "history"].map((n) => /* @__PURE__ */ e(
|
|
3338
1930
|
"button",
|
|
3339
1931
|
{
|
|
3340
|
-
className: `nice-etl-builder__tab ${
|
|
3341
|
-
onClick: () =>
|
|
3342
|
-
children:
|
|
1932
|
+
className: `nice-etl-builder__tab ${_ === n ? "nice-etl-builder__tab--active" : ""}`,
|
|
1933
|
+
onClick: () => C(n),
|
|
1934
|
+
children: n.charAt(0).toUpperCase() + n.slice(1)
|
|
3343
1935
|
},
|
|
3344
|
-
|
|
1936
|
+
n
|
|
3345
1937
|
)) }),
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1938
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__actions", children: [
|
|
1939
|
+
/* @__PURE__ */ e("button", { onClick: Y, disabled: T, className: "nice-etl-builder__run-btn", children: T ? "⏳ Running..." : "▶ Run" }),
|
|
3348
1940
|
/* @__PURE__ */ e("button", { className: "nice-etl-builder__save-btn", children: "💾 Save" }),
|
|
3349
|
-
/* @__PURE__ */ e(
|
|
1941
|
+
/* @__PURE__ */ e(he, { steps: be(o, _e) })
|
|
3350
1942
|
] })
|
|
3351
1943
|
] }),
|
|
3352
|
-
/* @__PURE__ */
|
|
3353
|
-
|
|
1944
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__main", children: [
|
|
1945
|
+
_ === "design" && /* @__PURE__ */ d("div", { className: "nice-etl-builder__palette", children: [
|
|
3354
1946
|
/* @__PURE__ */ e("h4", { children: "Sources" }),
|
|
3355
|
-
|
|
1947
|
+
r.map((n) => /* @__PURE__ */ d(
|
|
3356
1948
|
"div",
|
|
3357
1949
|
{
|
|
3358
1950
|
className: "nice-etl-builder__palette-item",
|
|
3359
|
-
onClick: () =>
|
|
1951
|
+
onClick: () => I(n),
|
|
3360
1952
|
children: [
|
|
3361
1953
|
/* @__PURE__ */ e("span", { className: "nice-etl-builder__palette-icon", children: "🗄️" }),
|
|
3362
|
-
/* @__PURE__ */ e("span", { children:
|
|
1954
|
+
/* @__PURE__ */ e("span", { children: n.name })
|
|
3363
1955
|
]
|
|
3364
1956
|
},
|
|
3365
|
-
|
|
1957
|
+
n.id
|
|
3366
1958
|
)),
|
|
3367
1959
|
/* @__PURE__ */ e(
|
|
3368
1960
|
"button",
|
|
3369
1961
|
{
|
|
3370
|
-
onClick: () =>
|
|
1962
|
+
onClick: () => I({ id: "", name: "New Source", type: "database", config: {} }),
|
|
3371
1963
|
children: "+ Add Source"
|
|
3372
1964
|
}
|
|
3373
1965
|
),
|
|
3374
1966
|
/* @__PURE__ */ e("h4", { children: "Transformations" }),
|
|
3375
|
-
|
|
1967
|
+
P.map((n) => /* @__PURE__ */ d(
|
|
3376
1968
|
"div",
|
|
3377
1969
|
{
|
|
3378
1970
|
className: "nice-etl-builder__palette-item",
|
|
3379
1971
|
draggable: !0,
|
|
3380
|
-
onDragStart: () =>
|
|
3381
|
-
onDragEnd: () =>
|
|
1972
|
+
onDragStart: () => E(`transform:${n.type}`),
|
|
1973
|
+
onDragEnd: () => E(null),
|
|
3382
1974
|
children: [
|
|
3383
|
-
/* @__PURE__ */ e("span", { className: "nice-etl-builder__palette-icon", children:
|
|
3384
|
-
/* @__PURE__ */ e("span", { children:
|
|
1975
|
+
/* @__PURE__ */ e("span", { className: "nice-etl-builder__palette-icon", children: n.icon }),
|
|
1976
|
+
/* @__PURE__ */ e("span", { children: n.label })
|
|
3385
1977
|
]
|
|
3386
1978
|
},
|
|
3387
|
-
|
|
1979
|
+
n.type
|
|
3388
1980
|
)),
|
|
3389
1981
|
/* @__PURE__ */ e("h4", { children: "Destinations" }),
|
|
3390
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1982
|
+
/* @__PURE__ */ e("button", { onClick: X, children: "+ Add Destination" })
|
|
3391
1983
|
] }),
|
|
3392
|
-
|
|
1984
|
+
_ === "design" && /* @__PURE__ */ e(
|
|
3393
1985
|
"div",
|
|
3394
1986
|
{
|
|
3395
|
-
ref:
|
|
1987
|
+
ref: Z,
|
|
3396
1988
|
className: "nice-etl-builder__canvas",
|
|
3397
|
-
onDragOver: (
|
|
3398
|
-
onDrop:
|
|
3399
|
-
onClick: () =>
|
|
3400
|
-
children: /* @__PURE__ */
|
|
3401
|
-
/* @__PURE__ */
|
|
1989
|
+
onDragOver: (n) => n.preventDefault(),
|
|
1990
|
+
onDrop: Q,
|
|
1991
|
+
onClick: () => v(null),
|
|
1992
|
+
children: /* @__PURE__ */ d("div", { className: "nice-etl-builder__flow", children: [
|
|
1993
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__column", children: [
|
|
3402
1994
|
/* @__PURE__ */ e("h5", { children: "Sources" }),
|
|
3403
|
-
|
|
3404
|
-
|
|
1995
|
+
p.sources.map((n) => /* @__PURE__ */ e(
|
|
1996
|
+
L,
|
|
3405
1997
|
{
|
|
3406
|
-
node:
|
|
1998
|
+
node: n,
|
|
3407
1999
|
nodeType: "source",
|
|
3408
2000
|
icon: "🗄️",
|
|
3409
|
-
isSelected: (
|
|
3410
|
-
onSelect: () =>
|
|
3411
|
-
onDelete: () =>
|
|
2001
|
+
isSelected: (f == null ? void 0 : f.id) === n.id,
|
|
2002
|
+
onSelect: () => v({ type: "source", id: n.id }),
|
|
2003
|
+
onDelete: () => A("source", n.id)
|
|
3412
2004
|
},
|
|
3413
|
-
|
|
2005
|
+
n.id
|
|
3414
2006
|
))
|
|
3415
2007
|
] }),
|
|
3416
2008
|
/* @__PURE__ */ e("div", { className: "nice-etl-builder__arrow", children: "→" }),
|
|
3417
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__column nice-etl-builder__column--transforms", children: [
|
|
3418
2010
|
/* @__PURE__ */ e("h5", { children: "Transformations" }),
|
|
3419
|
-
|
|
3420
|
-
const
|
|
2011
|
+
p.transformations.map((n) => {
|
|
2012
|
+
const s = P.find((l) => l.type === n.type);
|
|
3421
2013
|
return /* @__PURE__ */ e(
|
|
3422
|
-
|
|
2014
|
+
L,
|
|
3423
2015
|
{
|
|
3424
|
-
node:
|
|
2016
|
+
node: n,
|
|
3425
2017
|
nodeType: "transformation",
|
|
3426
|
-
icon: (
|
|
3427
|
-
isSelected: (
|
|
3428
|
-
onSelect: () =>
|
|
3429
|
-
onDelete: () =>
|
|
2018
|
+
icon: (s == null ? void 0 : s.icon) || "🔄",
|
|
2019
|
+
isSelected: (f == null ? void 0 : f.id) === n.id,
|
|
2020
|
+
onSelect: () => v({ type: "transformation", id: n.id }),
|
|
2021
|
+
onDelete: () => A("transformation", n.id)
|
|
3430
2022
|
},
|
|
3431
|
-
|
|
2023
|
+
n.id
|
|
3432
2024
|
);
|
|
3433
2025
|
}),
|
|
3434
|
-
|
|
2026
|
+
p.transformations.length === 0 && /* @__PURE__ */ e("div", { className: "nice-etl-builder__empty-column", children: "Drag transformations here" })
|
|
3435
2027
|
] }),
|
|
3436
2028
|
/* @__PURE__ */ e("div", { className: "nice-etl-builder__arrow", children: "→" }),
|
|
3437
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__column", children: [
|
|
3438
2030
|
/* @__PURE__ */ e("h5", { children: "Destinations" }),
|
|
3439
|
-
|
|
3440
|
-
|
|
2031
|
+
p.destinations.map((n) => /* @__PURE__ */ e(
|
|
2032
|
+
L,
|
|
3441
2033
|
{
|
|
3442
|
-
node:
|
|
2034
|
+
node: n,
|
|
3443
2035
|
nodeType: "destination",
|
|
3444
2036
|
icon: "📥",
|
|
3445
|
-
isSelected: (
|
|
3446
|
-
onSelect: () =>
|
|
3447
|
-
onDelete: () =>
|
|
2037
|
+
isSelected: (f == null ? void 0 : f.id) === n.id,
|
|
2038
|
+
onSelect: () => v({ type: "destination", id: n.id }),
|
|
2039
|
+
onDelete: () => A("destination", n.id)
|
|
3448
2040
|
},
|
|
3449
|
-
|
|
2041
|
+
n.id
|
|
3450
2042
|
))
|
|
3451
2043
|
] })
|
|
3452
2044
|
] })
|
|
3453
2045
|
}
|
|
3454
2046
|
),
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
2047
|
+
_ === "code" && /* @__PURE__ */ e("div", { className: "nice-etl-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(p, null, 2) }) }),
|
|
2048
|
+
_ === "schedule" && /* @__PURE__ */ e(
|
|
2049
|
+
Se,
|
|
3458
2050
|
{
|
|
3459
|
-
schedule:
|
|
3460
|
-
monitoring:
|
|
3461
|
-
onChange:
|
|
2051
|
+
schedule: p.schedule,
|
|
2052
|
+
monitoring: p.monitoring,
|
|
2053
|
+
onChange: q
|
|
3462
2054
|
}
|
|
3463
2055
|
),
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
2056
|
+
_ === "history" && /* @__PURE__ */ e(Ce, { runs: J }),
|
|
2057
|
+
f && _ === "design" && /* @__PURE__ */ e(
|
|
2058
|
+
Ne,
|
|
3467
2059
|
{
|
|
3468
|
-
nodeType:
|
|
3469
|
-
node:
|
|
3470
|
-
dataSources:
|
|
3471
|
-
onChange: (
|
|
3472
|
-
|
|
3473
|
-
switch (
|
|
2060
|
+
nodeType: f.type,
|
|
2061
|
+
node: ee() ?? null,
|
|
2062
|
+
dataSources: r,
|
|
2063
|
+
onChange: (n) => {
|
|
2064
|
+
h((s) => {
|
|
2065
|
+
switch (f.type) {
|
|
3474
2066
|
case "source":
|
|
3475
2067
|
return {
|
|
3476
|
-
...
|
|
3477
|
-
sources:
|
|
3478
|
-
(
|
|
2068
|
+
...s,
|
|
2069
|
+
sources: s.sources.map(
|
|
2070
|
+
(l) => l.id === f.id ? { ...l, ...n } : l
|
|
3479
2071
|
)
|
|
3480
2072
|
};
|
|
3481
2073
|
case "transformation":
|
|
3482
2074
|
return {
|
|
3483
|
-
...
|
|
3484
|
-
transformations:
|
|
3485
|
-
(
|
|
2075
|
+
...s,
|
|
2076
|
+
transformations: s.transformations.map(
|
|
2077
|
+
(l) => l.id === f.id ? { ...l, ...n } : l
|
|
3486
2078
|
)
|
|
3487
2079
|
};
|
|
3488
2080
|
case "destination":
|
|
3489
2081
|
return {
|
|
3490
|
-
...
|
|
3491
|
-
destinations:
|
|
3492
|
-
(
|
|
2082
|
+
...s,
|
|
2083
|
+
destinations: s.destinations.map(
|
|
2084
|
+
(l) => l.id === f.id ? { ...l, ...n } : l
|
|
3493
2085
|
)
|
|
3494
2086
|
};
|
|
3495
2087
|
default:
|
|
3496
|
-
return
|
|
2088
|
+
return s;
|
|
3497
2089
|
}
|
|
3498
2090
|
});
|
|
3499
2091
|
},
|
|
3500
|
-
onClose: () =>
|
|
2092
|
+
onClose: () => v(null)
|
|
3501
2093
|
}
|
|
3502
2094
|
)
|
|
3503
2095
|
] })
|
|
3504
2096
|
] });
|
|
3505
2097
|
}
|
|
3506
|
-
function
|
|
3507
|
-
switch (
|
|
2098
|
+
function He(a) {
|
|
2099
|
+
switch (a) {
|
|
3508
2100
|
case "filter":
|
|
3509
2101
|
return { condition: "" };
|
|
3510
2102
|
case "map":
|
|
@@ -3536,30 +2128,30 @@ return data;` };
|
|
|
3536
2128
|
return {};
|
|
3537
2129
|
}
|
|
3538
2130
|
}
|
|
3539
|
-
function
|
|
3540
|
-
node:
|
|
3541
|
-
nodeType:
|
|
3542
|
-
icon:
|
|
3543
|
-
isSelected:
|
|
3544
|
-
onSelect:
|
|
2131
|
+
function L({
|
|
2132
|
+
node: a,
|
|
2133
|
+
nodeType: r,
|
|
2134
|
+
icon: c,
|
|
2135
|
+
isSelected: t,
|
|
2136
|
+
onSelect: y,
|
|
3545
2137
|
onDelete: u
|
|
3546
2138
|
}) {
|
|
3547
|
-
return /* @__PURE__ */
|
|
2139
|
+
return /* @__PURE__ */ d(
|
|
3548
2140
|
"div",
|
|
3549
2141
|
{
|
|
3550
|
-
className: `nice-etl-builder__node nice-etl-builder__node--${
|
|
3551
|
-
onClick: (
|
|
3552
|
-
|
|
2142
|
+
className: `nice-etl-builder__node nice-etl-builder__node--${r} ${t ? "nice-etl-builder__node--selected" : ""}`,
|
|
2143
|
+
onClick: (o) => {
|
|
2144
|
+
o.stopPropagation(), y();
|
|
3553
2145
|
},
|
|
3554
2146
|
children: [
|
|
3555
|
-
/* @__PURE__ */ e("span", { className: "nice-etl-builder__node-icon", children:
|
|
3556
|
-
/* @__PURE__ */ e("span", { className: "nice-etl-builder__node-name", children:
|
|
2147
|
+
/* @__PURE__ */ e("span", { className: "nice-etl-builder__node-icon", children: c }),
|
|
2148
|
+
/* @__PURE__ */ e("span", { className: "nice-etl-builder__node-name", children: a.name }),
|
|
3557
2149
|
/* @__PURE__ */ e(
|
|
3558
2150
|
"button",
|
|
3559
2151
|
{
|
|
3560
2152
|
className: "nice-etl-builder__node-delete",
|
|
3561
|
-
onClick: (
|
|
3562
|
-
|
|
2153
|
+
onClick: (o) => {
|
|
2154
|
+
o.stopPropagation(), u();
|
|
3563
2155
|
},
|
|
3564
2156
|
children: "×"
|
|
3565
2157
|
}
|
|
@@ -3568,42 +2160,42 @@ function W({
|
|
|
3568
2160
|
}
|
|
3569
2161
|
);
|
|
3570
2162
|
}
|
|
3571
|
-
function
|
|
3572
|
-
nodeType:
|
|
3573
|
-
node:
|
|
3574
|
-
dataSources:
|
|
3575
|
-
onChange:
|
|
3576
|
-
onClose:
|
|
2163
|
+
function Ne({
|
|
2164
|
+
nodeType: a,
|
|
2165
|
+
node: r,
|
|
2166
|
+
dataSources: c,
|
|
2167
|
+
onChange: t,
|
|
2168
|
+
onClose: y
|
|
3577
2169
|
}) {
|
|
3578
2170
|
var u;
|
|
3579
|
-
return
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
|
|
2171
|
+
return r ? /* @__PURE__ */ d("div", { className: "nice-etl-builder__properties", children: [
|
|
2172
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__properties-header", children: [
|
|
2173
|
+
/* @__PURE__ */ d("h4", { children: [
|
|
2174
|
+
a.charAt(0).toUpperCase() + a.slice(1),
|
|
3583
2175
|
" Properties"
|
|
3584
2176
|
] }),
|
|
3585
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
2177
|
+
/* @__PURE__ */ e("button", { onClick: y, children: "×" })
|
|
3586
2178
|
] }),
|
|
3587
|
-
/* @__PURE__ */
|
|
3588
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__properties-content", children: [
|
|
2180
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3589
2181
|
/* @__PURE__ */ e("label", { children: "Name" }),
|
|
3590
2182
|
/* @__PURE__ */ e(
|
|
3591
2183
|
"input",
|
|
3592
2184
|
{
|
|
3593
2185
|
type: "text",
|
|
3594
|
-
value:
|
|
3595
|
-
onChange: (
|
|
2186
|
+
value: r.name,
|
|
2187
|
+
onChange: (o) => t({ name: o.target.value })
|
|
3596
2188
|
}
|
|
3597
2189
|
)
|
|
3598
2190
|
] }),
|
|
3599
|
-
|
|
3600
|
-
/* @__PURE__ */
|
|
2191
|
+
a === "source" && /* @__PURE__ */ d(N, { children: [
|
|
2192
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3601
2193
|
/* @__PURE__ */ e("label", { children: "Type" }),
|
|
3602
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ d(
|
|
3603
2195
|
"select",
|
|
3604
2196
|
{
|
|
3605
|
-
value:
|
|
3606
|
-
onChange: (
|
|
2197
|
+
value: r.type,
|
|
2198
|
+
onChange: (o) => t({ type: o.target.value }),
|
|
3607
2199
|
children: [
|
|
3608
2200
|
/* @__PURE__ */ e("option", { value: "database", children: "Database" }),
|
|
3609
2201
|
/* @__PURE__ */ e("option", { value: "api", children: "API" }),
|
|
@@ -3613,19 +2205,19 @@ function We({
|
|
|
3613
2205
|
}
|
|
3614
2206
|
)
|
|
3615
2207
|
] }),
|
|
3616
|
-
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */ d("label", { children: [
|
|
3617
2209
|
/* @__PURE__ */ e(
|
|
3618
2210
|
"input",
|
|
3619
2211
|
{
|
|
3620
2212
|
type: "checkbox",
|
|
3621
|
-
checked: ((u =
|
|
3622
|
-
onChange: (
|
|
3623
|
-
var
|
|
3624
|
-
return
|
|
2213
|
+
checked: ((u = r.incremental) == null ? void 0 : u.enabled) || !1,
|
|
2214
|
+
onChange: (o) => {
|
|
2215
|
+
var p;
|
|
2216
|
+
return t({
|
|
3625
2217
|
incremental: {
|
|
3626
|
-
...
|
|
3627
|
-
enabled:
|
|
3628
|
-
column: ((
|
|
2218
|
+
...r.incremental,
|
|
2219
|
+
enabled: o.target.checked,
|
|
2220
|
+
column: ((p = r.incremental) == null ? void 0 : p.column) || ""
|
|
3629
2221
|
}
|
|
3630
2222
|
});
|
|
3631
2223
|
}
|
|
@@ -3634,50 +2226,50 @@ function We({
|
|
|
3634
2226
|
"Incremental Load"
|
|
3635
2227
|
] }) })
|
|
3636
2228
|
] }),
|
|
3637
|
-
|
|
3638
|
-
/* @__PURE__ */
|
|
2229
|
+
a === "transformation" && /* @__PURE__ */ d(N, { children: [
|
|
2230
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3639
2231
|
/* @__PURE__ */ e("label", { children: "Type" }),
|
|
3640
|
-
/* @__PURE__ */ e("span", { children:
|
|
2232
|
+
/* @__PURE__ */ e("span", { children: r.type })
|
|
3641
2233
|
] }),
|
|
3642
|
-
|
|
2234
|
+
r.type === "filter" && /* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3643
2235
|
/* @__PURE__ */ e("label", { children: "Condition" }),
|
|
3644
2236
|
/* @__PURE__ */ e(
|
|
3645
2237
|
"textarea",
|
|
3646
2238
|
{
|
|
3647
|
-
value: String(
|
|
3648
|
-
onChange: (
|
|
3649
|
-
config: { ...
|
|
2239
|
+
value: String(r.config.condition || ""),
|
|
2240
|
+
onChange: (o) => t({
|
|
2241
|
+
config: { ...r.config, condition: o.target.value }
|
|
3650
2242
|
}),
|
|
3651
2243
|
placeholder: "e.g., age > 18 AND status = 'active'",
|
|
3652
2244
|
rows: 3
|
|
3653
2245
|
}
|
|
3654
2246
|
)
|
|
3655
2247
|
] }),
|
|
3656
|
-
|
|
3657
|
-
/* @__PURE__ */
|
|
2248
|
+
r.type === "derive" && /* @__PURE__ */ d(N, { children: [
|
|
2249
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3658
2250
|
/* @__PURE__ */ e("label", { children: "Column Name" }),
|
|
3659
2251
|
/* @__PURE__ */ e(
|
|
3660
2252
|
"input",
|
|
3661
2253
|
{
|
|
3662
2254
|
type: "text",
|
|
3663
|
-
value: String(
|
|
3664
|
-
onChange: (
|
|
3665
|
-
config: { ...
|
|
2255
|
+
value: String(r.config.name || ""),
|
|
2256
|
+
onChange: (o) => t({
|
|
2257
|
+
config: { ...r.config, name: o.target.value }
|
|
3666
2258
|
})
|
|
3667
2259
|
}
|
|
3668
2260
|
)
|
|
3669
2261
|
] }),
|
|
3670
|
-
/* @__PURE__ */
|
|
2262
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3671
2263
|
/* @__PURE__ */ e("label", { children: "Expression" }),
|
|
3672
2264
|
/* @__PURE__ */ e(
|
|
3673
2265
|
"input",
|
|
3674
2266
|
{
|
|
3675
2267
|
type: "text",
|
|
3676
|
-
value: String(
|
|
3677
|
-
onChange: (
|
|
2268
|
+
value: String(r.config.expression || ""),
|
|
2269
|
+
onChange: (o) => t({
|
|
3678
2270
|
config: {
|
|
3679
|
-
...
|
|
3680
|
-
expression:
|
|
2271
|
+
...r.config,
|
|
2272
|
+
expression: o.target.value
|
|
3681
2273
|
}
|
|
3682
2274
|
}),
|
|
3683
2275
|
placeholder: "e.g., price * quantity"
|
|
@@ -3685,14 +2277,14 @@ function We({
|
|
|
3685
2277
|
)
|
|
3686
2278
|
] })
|
|
3687
2279
|
] }),
|
|
3688
|
-
|
|
2280
|
+
r.type === "custom" && /* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3689
2281
|
/* @__PURE__ */ e("label", { children: "Code" }),
|
|
3690
2282
|
/* @__PURE__ */ e(
|
|
3691
2283
|
"textarea",
|
|
3692
2284
|
{
|
|
3693
|
-
value: String(
|
|
3694
|
-
onChange: (
|
|
3695
|
-
config: { ...
|
|
2285
|
+
value: String(r.config.code || ""),
|
|
2286
|
+
onChange: (o) => t({
|
|
2287
|
+
config: { ...r.config, code: o.target.value }
|
|
3696
2288
|
}),
|
|
3697
2289
|
rows: 10,
|
|
3698
2290
|
className: "nice-etl-builder__code-input"
|
|
@@ -3700,14 +2292,14 @@ function We({
|
|
|
3700
2292
|
)
|
|
3701
2293
|
] })
|
|
3702
2294
|
] }),
|
|
3703
|
-
|
|
3704
|
-
/* @__PURE__ */
|
|
2295
|
+
a === "destination" && /* @__PURE__ */ d(N, { children: [
|
|
2296
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3705
2297
|
/* @__PURE__ */ e("label", { children: "Type" }),
|
|
3706
|
-
/* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ d(
|
|
3707
2299
|
"select",
|
|
3708
2300
|
{
|
|
3709
|
-
value:
|
|
3710
|
-
onChange: (
|
|
2301
|
+
value: r.type,
|
|
2302
|
+
onChange: (o) => t({ type: o.target.value }),
|
|
3711
2303
|
children: [
|
|
3712
2304
|
/* @__PURE__ */ e("option", { value: "database", children: "Database" }),
|
|
3713
2305
|
/* @__PURE__ */ e("option", { value: "file", children: "File" }),
|
|
@@ -3717,13 +2309,13 @@ function We({
|
|
|
3717
2309
|
}
|
|
3718
2310
|
)
|
|
3719
2311
|
] }),
|
|
3720
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3721
2313
|
/* @__PURE__ */ e("label", { children: "Write Mode" }),
|
|
3722
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ d(
|
|
3723
2315
|
"select",
|
|
3724
2316
|
{
|
|
3725
|
-
value:
|
|
3726
|
-
onChange: (
|
|
2317
|
+
value: r.writeMode,
|
|
2318
|
+
onChange: (o) => t({ writeMode: o.target.value }),
|
|
3727
2319
|
children: [
|
|
3728
2320
|
/* @__PURE__ */ e("option", { value: "append", children: "Append" }),
|
|
3729
2321
|
/* @__PURE__ */ e("option", { value: "overwrite", children: "Overwrite" }),
|
|
@@ -3735,56 +2327,56 @@ function We({
|
|
|
3735
2327
|
] })
|
|
3736
2328
|
] })
|
|
3737
2329
|
] })
|
|
3738
|
-
] }) : /* @__PURE__ */ e(
|
|
2330
|
+
] }) : /* @__PURE__ */ e(N, {});
|
|
3739
2331
|
}
|
|
3740
|
-
function
|
|
3741
|
-
schedule:
|
|
3742
|
-
monitoring:
|
|
3743
|
-
onChange:
|
|
2332
|
+
function Se({
|
|
2333
|
+
schedule: a,
|
|
2334
|
+
monitoring: r,
|
|
2335
|
+
onChange: c
|
|
3744
2336
|
}) {
|
|
3745
|
-
const [
|
|
3746
|
-
return /* @__PURE__ */
|
|
2337
|
+
const [t, y] = w(a || { enabled: !1 });
|
|
2338
|
+
return /* @__PURE__ */ d("div", { className: "nice-etl-builder__schedule-editor", children: [
|
|
3747
2339
|
/* @__PURE__ */ e("h4", { children: "Schedule Configuration" }),
|
|
3748
|
-
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */ d("label", { children: [
|
|
3749
2341
|
/* @__PURE__ */ e(
|
|
3750
2342
|
"input",
|
|
3751
2343
|
{
|
|
3752
2344
|
type: "checkbox",
|
|
3753
|
-
checked:
|
|
2345
|
+
checked: t.enabled,
|
|
3754
2346
|
onChange: (u) => {
|
|
3755
|
-
const
|
|
3756
|
-
|
|
2347
|
+
const o = { ...t, enabled: u.target.checked };
|
|
2348
|
+
y(o), c(o);
|
|
3757
2349
|
}
|
|
3758
2350
|
}
|
|
3759
2351
|
),
|
|
3760
2352
|
"Enable scheduled execution"
|
|
3761
2353
|
] }) }),
|
|
3762
|
-
|
|
3763
|
-
/* @__PURE__ */
|
|
2354
|
+
t.enabled && /* @__PURE__ */ d(N, { children: [
|
|
2355
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3764
2356
|
/* @__PURE__ */ e("label", { children: "Cron Expression" }),
|
|
3765
2357
|
/* @__PURE__ */ e(
|
|
3766
2358
|
"input",
|
|
3767
2359
|
{
|
|
3768
2360
|
type: "text",
|
|
3769
|
-
value:
|
|
2361
|
+
value: t.cron || "",
|
|
3770
2362
|
onChange: (u) => {
|
|
3771
|
-
const
|
|
3772
|
-
|
|
2363
|
+
const o = { ...t, cron: u.target.value };
|
|
2364
|
+
y(o);
|
|
3773
2365
|
},
|
|
3774
2366
|
placeholder: "0 0 * * * (every hour)"
|
|
3775
2367
|
}
|
|
3776
2368
|
),
|
|
3777
2369
|
/* @__PURE__ */ e("small", { children: "Format: minute hour day month weekday" })
|
|
3778
2370
|
] }),
|
|
3779
|
-
/* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3780
2372
|
/* @__PURE__ */ e("label", { children: "Timezone" }),
|
|
3781
|
-
/* @__PURE__ */
|
|
2373
|
+
/* @__PURE__ */ d(
|
|
3782
2374
|
"select",
|
|
3783
2375
|
{
|
|
3784
|
-
value:
|
|
2376
|
+
value: t.timezone || "UTC",
|
|
3785
2377
|
onChange: (u) => {
|
|
3786
|
-
const
|
|
3787
|
-
|
|
2378
|
+
const o = { ...t, timezone: u.target.value };
|
|
2379
|
+
y(o);
|
|
3788
2380
|
},
|
|
3789
2381
|
children: [
|
|
3790
2382
|
/* @__PURE__ */ e("option", { value: "UTC", children: "UTC" }),
|
|
@@ -3797,16 +2389,16 @@ function qe({
|
|
|
3797
2389
|
}
|
|
3798
2390
|
)
|
|
3799
2391
|
] }),
|
|
3800
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
2392
|
+
/* @__PURE__ */ e("button", { onClick: () => c(t), children: "Save Schedule" })
|
|
3801
2393
|
] }),
|
|
3802
2394
|
/* @__PURE__ */ e("h4", { children: "Monitoring" }),
|
|
3803
|
-
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */
|
|
3804
|
-
/* @__PURE__ */ e("input", { type: "checkbox", checked: (
|
|
2395
|
+
/* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */ d("label", { children: [
|
|
2396
|
+
/* @__PURE__ */ e("input", { type: "checkbox", checked: (r == null ? void 0 : r.alertOnFailure) || !1, disabled: !0 }),
|
|
3805
2397
|
"Alert on failure"
|
|
3806
2398
|
] }) }),
|
|
3807
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ d("div", { className: "nice-etl-builder__field", children: [
|
|
3808
2400
|
/* @__PURE__ */ e("label", { children: "Log Level" }),
|
|
3809
|
-
/* @__PURE__ */
|
|
2401
|
+
/* @__PURE__ */ d("select", { value: (r == null ? void 0 : r.logLevel) || "info", disabled: !0, children: [
|
|
3810
2402
|
/* @__PURE__ */ e("option", { value: "error", children: "Error" }),
|
|
3811
2403
|
/* @__PURE__ */ e("option", { value: "warn", children: "Warning" }),
|
|
3812
2404
|
/* @__PURE__ */ e("option", { value: "info", children: "Info" }),
|
|
@@ -3815,98 +2407,47 @@ function qe({
|
|
|
3815
2407
|
] })
|
|
3816
2408
|
] });
|
|
3817
2409
|
}
|
|
3818
|
-
function
|
|
3819
|
-
return /* @__PURE__ */
|
|
2410
|
+
function Ce({ runs: a }) {
|
|
2411
|
+
return /* @__PURE__ */ d("div", { className: "nice-etl-builder__history-view", children: [
|
|
3820
2412
|
/* @__PURE__ */ e("h4", { children: "Run History" }),
|
|
3821
|
-
|
|
3822
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
2413
|
+
a.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-etl-builder__no-history", children: "No runs yet" }) : /* @__PURE__ */ d("table", { className: "nice-etl-builder__history-table", children: [
|
|
2414
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { children: [
|
|
3823
2415
|
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
3824
2416
|
/* @__PURE__ */ e("th", { children: "Start Time" }),
|
|
3825
2417
|
/* @__PURE__ */ e("th", { children: "Duration" }),
|
|
3826
2418
|
/* @__PURE__ */ e("th", { children: "Rows" }),
|
|
3827
2419
|
/* @__PURE__ */ e("th", { children: "Errors" })
|
|
3828
2420
|
] }) }),
|
|
3829
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
2421
|
+
/* @__PURE__ */ e("tbody", { children: a.map((r) => /* @__PURE__ */ d(
|
|
3830
2422
|
"tr",
|
|
3831
2423
|
{
|
|
3832
|
-
className: `nice-etl-builder__run nice-etl-builder__run--${
|
|
2424
|
+
className: `nice-etl-builder__run nice-etl-builder__run--${r.status}`,
|
|
3833
2425
|
children: [
|
|
3834
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ d(
|
|
3835
2427
|
"span",
|
|
3836
2428
|
{
|
|
3837
|
-
className: `nice-etl-builder__status nice-etl-builder__status--${
|
|
2429
|
+
className: `nice-etl-builder__status nice-etl-builder__status--${r.status}`,
|
|
3838
2430
|
children: [
|
|
3839
|
-
|
|
3840
|
-
|
|
2431
|
+
r.status === "success" ? "✓" : r.status === "failed" ? "✗" : "⏳",
|
|
2432
|
+
r.status
|
|
3841
2433
|
]
|
|
3842
2434
|
}
|
|
3843
2435
|
) }),
|
|
3844
|
-
/* @__PURE__ */ e("td", { children:
|
|
3845
|
-
/* @__PURE__ */ e("td", { children:
|
|
3846
|
-
/* @__PURE__ */
|
|
3847
|
-
|
|
2436
|
+
/* @__PURE__ */ e("td", { children: r.startTime.toLocaleString() }),
|
|
2437
|
+
/* @__PURE__ */ e("td", { children: r.endTime ? `${Math.round((r.endTime.getTime() - r.startTime.getTime()) / 1e3)}s` : "-" }),
|
|
2438
|
+
/* @__PURE__ */ d("td", { children: [
|
|
2439
|
+
r.rowsProcessed.toLocaleString(),
|
|
3848
2440
|
" / ",
|
|
3849
|
-
|
|
2441
|
+
r.rowsWritten.toLocaleString()
|
|
3850
2442
|
] }),
|
|
3851
|
-
/* @__PURE__ */ e("td", { children:
|
|
2443
|
+
/* @__PURE__ */ e("td", { children: r.errors.length })
|
|
3852
2444
|
]
|
|
3853
2445
|
},
|
|
3854
|
-
|
|
2446
|
+
r.id
|
|
3855
2447
|
)) })
|
|
3856
2448
|
] })
|
|
3857
2449
|
] });
|
|
3858
2450
|
}
|
|
3859
|
-
const Xe = {
|
|
3860
|
-
chart: "chart",
|
|
3861
|
-
table: "dataGrid",
|
|
3862
|
-
card: "card",
|
|
3863
|
-
gauge: "gauge",
|
|
3864
|
-
map: "map",
|
|
3865
|
-
text: "text",
|
|
3866
|
-
image: "image",
|
|
3867
|
-
filter: "select",
|
|
3868
|
-
slicer: "select",
|
|
3869
|
-
timeline: "timeline",
|
|
3870
|
-
treemap: "treemap",
|
|
3871
|
-
funnel: "funnel",
|
|
3872
|
-
sankey: "sankey",
|
|
3873
|
-
heatmap: "heatmap"
|
|
3874
|
-
};
|
|
3875
|
-
let Ke = 0;
|
|
3876
|
-
const Ge = (r) => `${r}-${Date.now().toString(36)}-${(Ke++).toString(36)}`;
|
|
3877
|
-
function rr(r) {
|
|
3878
|
-
var c;
|
|
3879
|
-
const i = ((c = r.layout) == null ? void 0 : c.columns) ?? 12, n = Array.from(
|
|
3880
|
-
new Set(r.widgets.map((u) => u.dataSource).filter((u) => !!u))
|
|
3881
|
-
), s = r.widgets.map(
|
|
3882
|
-
(u) => {
|
|
3883
|
-
var m, o;
|
|
3884
|
-
return {
|
|
3885
|
-
id: u.id,
|
|
3886
|
-
controlType: Xe[u.type] ?? "card",
|
|
3887
|
-
props: {
|
|
3888
|
-
...u.title ? { title: u.title } : {},
|
|
3889
|
-
...u.dataSource ? { dataSource: u.dataSource } : {},
|
|
3890
|
-
...u.config ?? {}
|
|
3891
|
-
},
|
|
3892
|
-
colSpan: ((m = u.position) == null ? void 0 : m.width) ?? 4,
|
|
3893
|
-
...(o = u.position) != null && o.height ? { rowSpan: u.position.height } : {}
|
|
3894
|
-
};
|
|
3895
|
-
}
|
|
3896
|
-
);
|
|
3897
|
-
return {
|
|
3898
|
-
id: r.id,
|
|
3899
|
-
name: r.name,
|
|
3900
|
-
version: 2,
|
|
3901
|
-
columns: i,
|
|
3902
|
-
dataSources: n.map((u) => ({ key: u, type: "rest", autoLoad: !0 })),
|
|
3903
|
-
rows: [{ id: Ge("dash-row"), cells: s }],
|
|
3904
|
-
meta: { description: r.description, tags: ["dashboard"] }
|
|
3905
|
-
};
|
|
3906
|
-
}
|
|
3907
2451
|
export {
|
|
3908
|
-
|
|
3909
|
-
er as NiceETLBuilder,
|
|
3910
|
-
Qe as NiceReportBuilder,
|
|
3911
|
-
rr as dashboardToV2
|
|
2452
|
+
De as NiceETLBuilder
|
|
3912
2453
|
};
|