@wakastellar/ui 3.3.3 → 3.5.0
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/badge-BbwO7QeZ.js +1 -0
- package/dist/badge-BfiocODp.mjs +23 -0
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +1 -1
- package/dist/chunk-14q5BKub.js +1 -0
- package/dist/{chunk-BH6uBOac.mjs → chunk-Cr9pTUWm.mjs} +5 -5
- package/dist/cn-DEtaFQsA.js +1 -0
- package/dist/cn-DUn6aSIQ.mjs +24 -0
- package/dist/doc.cjs.js +2 -2
- package/dist/doc.es.js +19 -19
- package/dist/editor.cjs.js +48 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.es.js +6551 -0
- package/dist/{exceljs.min-DG9M8IZ1.mjs → exceljs.min-DL1XYDll.mjs} +1 -1
- package/dist/{exceljs.min-BuefmDRS.js → exceljs.min-qeIfSCbF.js} +1 -1
- package/dist/export.cjs.js +1 -1
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +150 -150
- package/dist/index.es.js +26782 -27591
- package/dist/input-BfaSAGVw.js +1 -0
- package/dist/input-DVr_Qkl8.mjs +14 -0
- package/dist/rich-text.cjs.js +1 -1
- package/dist/rich-text.es.js +1 -1
- package/dist/security-CyBpuklN.mjs +122 -0
- package/dist/security-bFWwDrlg.js +1 -0
- package/dist/separator-NrkltulH.js +1 -0
- package/dist/separator-ibN2mycs.mjs +51 -0
- package/dist/src/components/editor/blocks/index.d.ts +51 -0
- package/dist/src/components/editor/blocks/waka-acceptance-criteria-block.d.ts +60 -0
- package/dist/src/components/editor/blocks/waka-ai-assist-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-api-endpoint-block.d.ts +63 -0
- package/dist/src/components/editor/blocks/waka-code-playground-block.d.ts +61 -0
- package/dist/src/components/editor/blocks/waka-comment-thread-block.d.ts +85 -0
- package/dist/src/components/editor/blocks/waka-diagram-block.d.ts +52 -0
- package/dist/src/components/editor/blocks/waka-embed-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-slash-menu-block.d.ts +67 -0
- package/dist/src/components/editor/blocks/waka-user-story-block.d.ts +79 -0
- package/dist/src/components/editor/blocks/waka-version-diff-block.d.ts +73 -0
- package/dist/src/components/editor/index.d.ts +66 -0
- package/dist/src/components/editor/waka-ai-writer.d.ts +80 -0
- package/dist/src/components/editor/waka-collaborative-editor.d.ts +93 -0
- package/dist/src/components/editor/waka-diff-viewer.d.ts +71 -0
- package/dist/src/components/editor/waka-dnd-editor.d.ts +64 -0
- package/dist/src/components/editor/waka-document-editor.d.ts +92 -0
- package/dist/src/components/editor/waka-editor-elements.d.ts +79 -0
- package/dist/src/components/editor/waka-editor-leaves.d.ts +39 -0
- package/dist/src/components/editor/waka-editor-plugins.d.ts +41 -0
- package/dist/src/components/editor/waka-editor-toolbar.d.ts +20 -0
- package/dist/src/components/editor/waka-editor.d.ts +59 -0
- package/dist/src/components/editor/waka-floating-toolbar.d.ts +47 -0
- package/dist/src/components/editor/waka-markdown-editor.d.ts +60 -0
- package/dist/src/components/editor/waka-mention-editor.d.ts +125 -0
- package/dist/src/components/editor/waka-slash-menu.d.ts +70 -0
- package/dist/src/components/editor/waka-spec-editor.d.ts +88 -0
- package/dist/src/components/index.d.ts +1 -15
- package/dist/src/editor.d.ts +26 -0
- package/dist/textarea-CdQWggYG.js +1 -0
- package/dist/textarea-DJDXJ3nd.mjs +23 -0
- package/dist/types-C2St0wOW.js +1 -0
- package/dist/{types-B6GVaSIP.mjs → types-JnqoLyuv.mjs} +214 -211
- package/dist/{useDataTableImport-BPvfo--2.mjs → useDataTableImport-BWUFesPi.mjs} +3 -3
- package/dist/{useDataTableImport-Cm_pCKnO.js → useDataTableImport-T7ddpN5k.js} +3 -3
- package/dist/waka-doc-renderer-CTxC7Trf.js +3 -0
- package/dist/{waka-doc-renderer-BkIvas3z.mjs → waka-doc-renderer-Cw-Xnyen.mjs} +264 -281
- package/dist/waka-editor-plugins-DR6tpsUC.mjs +135 -0
- package/dist/waka-editor-plugins-sGSh9hn2.js +1 -0
- package/dist/waka-rich-text-editor-BlIdtknG.js +1 -0
- package/dist/waka-rich-text-editor-D1uA3zbB.js +1 -0
- package/dist/waka-rich-text-editor-DgSWiXMW.mjs +342 -0
- package/dist/waka-rich-text-editor-DndVJuDw.mjs +2 -0
- package/package.json +87 -2
- package/src/blocks/footer/index.tsx +1 -6
- package/src/blocks/login/index.tsx +1 -7
- package/src/blocks/profile/index.tsx +3 -5
- package/src/components/editor/blocks/index.ts +182 -0
- package/src/components/editor/blocks/waka-acceptance-criteria-block.tsx +326 -0
- package/src/components/editor/blocks/waka-ai-assist-block.tsx +284 -0
- package/src/components/editor/blocks/waka-api-endpoint-block.tsx +382 -0
- package/src/components/editor/blocks/waka-code-playground-block.tsx +331 -0
- package/src/components/editor/blocks/waka-comment-thread-block.tsx +448 -0
- package/src/components/editor/blocks/waka-diagram-block.tsx +293 -0
- package/src/components/editor/blocks/waka-embed-block.tsx +416 -0
- package/src/components/editor/blocks/waka-slash-menu-block.tsx +432 -0
- package/src/components/editor/blocks/waka-user-story-block.tsx +295 -0
- package/src/components/editor/blocks/waka-version-diff-block.tsx +426 -0
- package/src/components/editor/index.ts +279 -0
- package/src/components/editor/waka-ai-writer.tsx +434 -0
- package/src/components/editor/waka-collaborative-editor.tsx +426 -0
- package/src/components/editor/waka-diff-viewer.tsx +352 -0
- package/src/components/editor/waka-dnd-editor.tsx +284 -0
- package/src/components/editor/waka-document-editor.tsx +502 -0
- package/src/components/editor/waka-editor-elements.tsx +312 -0
- package/src/components/editor/waka-editor-leaves.tsx +101 -0
- package/src/components/editor/waka-editor-plugins.ts +207 -0
- package/src/components/editor/waka-editor-toolbar.tsx +358 -0
- package/src/components/editor/waka-editor.tsx +431 -0
- package/src/components/editor/waka-floating-toolbar.tsx +268 -0
- package/src/components/editor/waka-markdown-editor.tsx +395 -0
- package/src/components/editor/waka-mention-editor.tsx +459 -0
- package/src/components/editor/waka-slash-menu.tsx +392 -0
- package/src/components/editor/waka-spec-editor.tsx +657 -0
- package/src/components/index.ts +1 -18
- package/dist/chunk-BDDJmn7V.js +0 -1
- package/dist/cn-DnPbmOCy.js +0 -1
- package/dist/cn-DpLcAzrf.mjs +0 -22
- package/dist/separator-BDReXBvI.mjs +0 -59
- package/dist/separator-BKjNl9sI.js +0 -1
- package/dist/src/components/waka-actor-badge/index.d.ts +0 -8
- package/dist/src/components/waka-actors-list/index.d.ts +0 -18
- package/dist/src/components/waka-ai-assistant-button/index.d.ts +0 -8
- package/dist/src/components/waka-document-flyover/index.d.ts +0 -10
- package/dist/src/components/waka-document-preview-popup/index.d.ts +0 -26
- package/dist/src/components/waka-hour-balance-badge/index.d.ts +0 -8
- package/dist/src/components/waka-hour-consumption-table/index.d.ts +0 -15
- package/dist/src/components/waka-hour-pack-dialog/index.d.ts +0 -8
- package/dist/src/components/waka-project-stats-header/index.d.ts +0 -15
- package/dist/src/components/waka-step-comment-bubble/index.d.ts +0 -13
- package/dist/src/components/waka-step-comment-panel/index.d.ts +0 -20
- package/dist/src/components/waka-step-permission-matrix/index.d.ts +0 -12
- package/dist/src/components/waka-time-entry-dialog/index.d.ts +0 -16
- package/dist/src/components/waka-time-tracking-flyover/index.d.ts +0 -11
- package/dist/types-BH9cQRqZ.js +0 -1
- package/dist/waka-doc-renderer-BZ2-SqyT.js +0 -3
- package/dist/waka-rich-text-editor-BJGlQgpq.js +0 -1
- package/dist/waka-rich-text-editor-BJzzxeP1.mjs +0 -361
- package/dist/waka-rich-text-editor-wnXLwvUo.js +0 -1
- package/src/components/waka-actor-badge/index.tsx +0 -34
- package/src/components/waka-actors-list/index.tsx +0 -125
- package/src/components/waka-ai-assistant-button/index.tsx +0 -31
- package/src/components/waka-document-flyover/index.tsx +0 -36
- package/src/components/waka-document-preview-popup/index.tsx +0 -103
- package/src/components/waka-hour-balance-badge/index.tsx +0 -43
- package/src/components/waka-hour-consumption-table/index.tsx +0 -72
- package/src/components/waka-hour-pack-dialog/index.tsx +0 -72
- package/src/components/waka-project-stats-header/index.tsx +0 -69
- package/src/components/waka-step-comment-bubble/index.tsx +0 -71
- package/src/components/waka-step-comment-panel/index.tsx +0 -106
- package/src/components/waka-step-permission-matrix/index.tsx +0 -65
- package/src/components/waka-time-entry-dialog/index.tsx +0 -131
- package/src/components/waka-time-tracking-flyover/index.tsx +0 -41
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { Minus as
|
|
5
|
-
import { jsx as
|
|
1
|
+
import { n as e, t } from "./cn-DUn6aSIQ.mjs";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
|
+
import { Minus as o, TrendingDown as s, TrendingUp as c } from "lucide-react";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/skeleton/index.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
e();
|
|
8
|
+
function d({ className: e, ...n }) {
|
|
9
|
+
return /* @__PURE__ */ l("div", {
|
|
10
|
+
className: t("animate-pulse rounded-md bg-muted", e),
|
|
10
11
|
...n
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
//#endregion
|
|
14
15
|
//#region src/components/waka-charts/hooks/useRechartsLoader.ts
|
|
15
|
-
function
|
|
16
|
-
let [e, t] =
|
|
17
|
-
return
|
|
16
|
+
function f() {
|
|
17
|
+
let [e, t] = a(null), [n, i] = a(!0), [o, s] = a(null);
|
|
18
|
+
return r(() => {
|
|
18
19
|
let e = !0;
|
|
19
20
|
return (async () => {
|
|
20
21
|
try {
|
|
@@ -38,23 +39,23 @@ function d() {
|
|
|
38
39
|
defs: "defs",
|
|
39
40
|
linearGradient: "linearGradient",
|
|
40
41
|
stop: "stop"
|
|
41
|
-
}),
|
|
42
|
+
}), i(!1));
|
|
42
43
|
} catch (t) {
|
|
43
|
-
e && (s(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load Recharts")),
|
|
44
|
+
e && (s(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load Recharts")), i(!1));
|
|
44
45
|
}
|
|
45
46
|
})(), () => {
|
|
46
47
|
e = !1;
|
|
47
48
|
};
|
|
48
49
|
}, []), {
|
|
49
50
|
components: e,
|
|
50
|
-
loading:
|
|
51
|
+
loading: n,
|
|
51
52
|
error: o,
|
|
52
|
-
isAvailable: !
|
|
53
|
+
isAvailable: !n && !o && e !== null
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
//#endregion
|
|
56
57
|
//#region src/components/waka-charts/hooks/useChartTheme.ts
|
|
57
|
-
var
|
|
58
|
+
var p = {
|
|
58
59
|
colors: [
|
|
59
60
|
"hsl(var(--chart-1, 220 70% 50%))",
|
|
60
61
|
"hsl(var(--chart-2, 160 60% 45%))",
|
|
@@ -70,21 +71,21 @@ var f = {
|
|
|
70
71
|
tooltipBorder: "hsl(var(--border, 220 13% 91%))",
|
|
71
72
|
fontFamily: "inherit"
|
|
72
73
|
};
|
|
73
|
-
function
|
|
74
|
-
let n =
|
|
75
|
-
colors: e?.colors ??
|
|
76
|
-
gridColor: e?.gridColor ??
|
|
77
|
-
axisColor: e?.axisColor ??
|
|
78
|
-
textColor: e?.textColor ??
|
|
79
|
-
tooltipBackground: e?.tooltipBackground ??
|
|
80
|
-
tooltipText: e?.tooltipText ??
|
|
81
|
-
tooltipBorder: e?.tooltipBorder ??
|
|
82
|
-
fontFamily: e?.fontFamily ??
|
|
74
|
+
function m(e, t = "default") {
|
|
75
|
+
let n = i(() => ({
|
|
76
|
+
colors: e?.colors ?? p.colors,
|
|
77
|
+
gridColor: e?.gridColor ?? p.gridColor,
|
|
78
|
+
axisColor: e?.axisColor ?? p.axisColor,
|
|
79
|
+
textColor: e?.textColor ?? p.textColor,
|
|
80
|
+
tooltipBackground: e?.tooltipBackground ?? p.tooltipBackground,
|
|
81
|
+
tooltipText: e?.tooltipText ?? p.tooltipText,
|
|
82
|
+
tooltipBorder: e?.tooltipBorder ?? p.tooltipBorder,
|
|
83
|
+
fontFamily: e?.fontFamily ?? p.fontFamily
|
|
83
84
|
}), [e]);
|
|
84
85
|
return {
|
|
85
86
|
theme: n,
|
|
86
|
-
getColor:
|
|
87
|
-
tooltipStyles:
|
|
87
|
+
getColor: i(() => (e) => n.colors[e % n.colors.length], [n.colors]),
|
|
88
|
+
tooltipStyles: i(() => ({
|
|
88
89
|
contentStyle: {
|
|
89
90
|
backgroundColor: n.tooltipBackground,
|
|
90
91
|
color: n.tooltipText,
|
|
@@ -105,7 +106,7 @@ function p(e, t = "default") {
|
|
|
105
106
|
marginBottom: "4px"
|
|
106
107
|
}
|
|
107
108
|
}), [n]),
|
|
108
|
-
containerClasses:
|
|
109
|
+
containerClasses: i(() => {
|
|
109
110
|
let e = "relative";
|
|
110
111
|
switch (t) {
|
|
111
112
|
case "gradient": return `${e} bg-gradient-to-br from-background to-muted/20`;
|
|
@@ -118,7 +119,8 @@ function p(e, t = "default") {
|
|
|
118
119
|
}
|
|
119
120
|
//#endregion
|
|
120
121
|
//#region src/components/waka-charts/WakaChart.tsx
|
|
121
|
-
|
|
122
|
+
e();
|
|
123
|
+
var h = {
|
|
122
124
|
sm: {
|
|
123
125
|
width: "100%",
|
|
124
126
|
height: 150
|
|
@@ -139,33 +141,33 @@ var m = {
|
|
|
139
141
|
width: "100%",
|
|
140
142
|
height: 300
|
|
141
143
|
}
|
|
142
|
-
},
|
|
143
|
-
let { components: S, loading: C, error: w, isAvailable: T } =
|
|
144
|
-
if (D) return /* @__PURE__ */
|
|
144
|
+
}, g = n.forwardRef(({ children: e, variant: n = "default", size: r = "md", height: i, width: a, theme: o, className: s, style: c, title: p, description: g, loading: v, error: y, responsive: b = !0 }, x) => {
|
|
145
|
+
let { components: S, loading: C, error: w, isAvailable: T } = f(), { containerClasses: E } = m(o, n), D = v || C, O = y || (w ? "Recharts non disponible. Installez recharts pour utiliser les graphiques." : null), k = h[r], A = a ?? k.width, j = i ?? k.height;
|
|
146
|
+
if (D) return /* @__PURE__ */ u("div", {
|
|
145
147
|
ref: x,
|
|
146
|
-
className:
|
|
147
|
-
style:
|
|
148
|
-
children: [
|
|
149
|
-
title:
|
|
150
|
-
description:
|
|
151
|
-
}), /* @__PURE__ */
|
|
148
|
+
className: t(E, s),
|
|
149
|
+
style: c,
|
|
150
|
+
children: [p && /* @__PURE__ */ l(_, {
|
|
151
|
+
title: p,
|
|
152
|
+
description: g
|
|
153
|
+
}), /* @__PURE__ */ l(d, {
|
|
152
154
|
className: "w-full",
|
|
153
155
|
style: { height: j }
|
|
154
156
|
})]
|
|
155
157
|
});
|
|
156
|
-
if (O || !T) return /* @__PURE__ */
|
|
158
|
+
if (O || !T) return /* @__PURE__ */ u("div", {
|
|
157
159
|
ref: x,
|
|
158
|
-
className:
|
|
159
|
-
style:
|
|
160
|
-
children: [
|
|
161
|
-
title:
|
|
162
|
-
description:
|
|
163
|
-
}), /* @__PURE__ */
|
|
160
|
+
className: t(E, s),
|
|
161
|
+
style: c,
|
|
162
|
+
children: [p && /* @__PURE__ */ l(_, {
|
|
163
|
+
title: p,
|
|
164
|
+
description: g
|
|
165
|
+
}), /* @__PURE__ */ l("div", {
|
|
164
166
|
className: "flex items-center justify-center text-muted-foreground text-sm border border-dashed border-border rounded-lg",
|
|
165
167
|
style: { height: j },
|
|
166
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ u("div", {
|
|
167
169
|
className: "text-center p-4",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ l("p", { children: O || "Graphique non disponible" }), /* @__PURE__ */ l("p", {
|
|
169
171
|
className: "text-xs mt-1",
|
|
170
172
|
children: "Installez recharts: pnpm add recharts"
|
|
171
173
|
})]
|
|
@@ -173,34 +175,34 @@ var m = {
|
|
|
173
175
|
})]
|
|
174
176
|
});
|
|
175
177
|
let { ResponsiveContainer: M } = S;
|
|
176
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ u("div", {
|
|
177
179
|
ref: x,
|
|
178
|
-
className:
|
|
179
|
-
style:
|
|
180
|
-
children: [
|
|
181
|
-
title:
|
|
182
|
-
description:
|
|
183
|
-
}), b ? /* @__PURE__ */
|
|
180
|
+
className: t(E, s),
|
|
181
|
+
style: c,
|
|
182
|
+
children: [p && /* @__PURE__ */ l(_, {
|
|
183
|
+
title: p,
|
|
184
|
+
description: g
|
|
185
|
+
}), b ? /* @__PURE__ */ l(M, {
|
|
184
186
|
width: A,
|
|
185
187
|
height: j,
|
|
186
|
-
children:
|
|
187
|
-
}) : /* @__PURE__ */
|
|
188
|
+
children: e(S)
|
|
189
|
+
}) : /* @__PURE__ */ l("div", {
|
|
188
190
|
style: {
|
|
189
191
|
width: A,
|
|
190
192
|
height: j
|
|
191
193
|
},
|
|
192
|
-
children:
|
|
194
|
+
children: e(S)
|
|
193
195
|
})]
|
|
194
196
|
});
|
|
195
197
|
});
|
|
196
|
-
|
|
197
|
-
function
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
g.displayName = "WakaChart";
|
|
199
|
+
function _({ title: e, description: t }) {
|
|
200
|
+
return /* @__PURE__ */ u("div", {
|
|
199
201
|
className: "mb-4",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
201
203
|
className: "text-lg font-semibold",
|
|
202
204
|
children: e
|
|
203
|
-
}), t && /* @__PURE__ */
|
|
205
|
+
}), t && /* @__PURE__ */ l("p", {
|
|
204
206
|
className: "text-sm text-muted-foreground",
|
|
205
207
|
children: t
|
|
206
208
|
})]
|
|
@@ -208,10 +210,10 @@ function g({ title: e, description: t }) {
|
|
|
208
210
|
}
|
|
209
211
|
//#endregion
|
|
210
212
|
//#region src/components/waka-charts/WakaBarChart.tsx
|
|
211
|
-
var
|
|
212
|
-
let { theme: P, getColor: F, tooltipStyles: I } =
|
|
213
|
+
var v = n.forwardRef(({ data: e, dataKeys: t, series: r, variant: i = "default", size: a = "md", height: o, width: s, animation: c = !0, animationDuration: d = 500, grid: f = !0, tooltip: p = !0, legend: h, axis: _, theme: v, className: y, style: b, title: x, description: S, loading: C, error: w, onClick: T, responsive: E = !0, layout: D = "vertical", stacked: O = !1, radius: k = 4, barSize: A, barGap: j = 4, barCategoryGap: M = "20%" }, N) => {
|
|
214
|
+
let { theme: P, getColor: F, tooltipStyles: I } = m(v, i), L = n.useMemo(() => {
|
|
213
215
|
if (r && r.length > 0) return r;
|
|
214
|
-
if (
|
|
216
|
+
if (t && t.length > 0) return t.map((e, t) => ({
|
|
215
217
|
dataKey: e,
|
|
216
218
|
label: e,
|
|
217
219
|
color: F(t)
|
|
@@ -221,23 +223,23 @@ var _ = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
221
223
|
label: "Value",
|
|
222
224
|
color: F(0)
|
|
223
225
|
}];
|
|
224
|
-
let
|
|
225
|
-
return
|
|
226
|
+
let n = e[0];
|
|
227
|
+
return n ? Object.keys(n).filter((e) => e !== "name" && typeof n[e] == "number").map((e, t) => ({
|
|
226
228
|
dataKey: e,
|
|
227
229
|
label: e,
|
|
228
230
|
color: F(t)
|
|
229
231
|
})) : [];
|
|
230
232
|
}, [
|
|
231
233
|
r,
|
|
232
|
-
|
|
234
|
+
t,
|
|
233
235
|
e,
|
|
234
236
|
F
|
|
235
|
-
]), R =
|
|
236
|
-
enabled:
|
|
237
|
+
]), R = n.useMemo(() => h ? typeof h == "boolean" ? {
|
|
238
|
+
enabled: h,
|
|
237
239
|
position: "bottom",
|
|
238
240
|
align: "center"
|
|
239
|
-
} :
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
+
} : h : null, [h]), z = n.useMemo(() => p ? typeof p == "boolean" ? { enabled: p } : p : null, [p]);
|
|
242
|
+
return /* @__PURE__ */ l(g, {
|
|
241
243
|
ref: N,
|
|
242
244
|
variant: i,
|
|
243
245
|
size: a,
|
|
@@ -253,20 +255,20 @@ var _ = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
253
255
|
responsive: E,
|
|
254
256
|
children: (t) => {
|
|
255
257
|
if (!t) return null;
|
|
256
|
-
let { BarChart: n, Bar: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend:
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
+
let { BarChart: n, Bar: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend: m } = t;
|
|
259
|
+
return /* @__PURE__ */ u(n, {
|
|
258
260
|
data: e,
|
|
259
261
|
layout: D === "horizontal" ? "vertical" : "horizontal",
|
|
260
262
|
barGap: j,
|
|
261
263
|
barCategoryGap: M,
|
|
262
264
|
children: [
|
|
263
|
-
f && /* @__PURE__ */
|
|
265
|
+
f && /* @__PURE__ */ l(o, {
|
|
264
266
|
strokeDasharray: "3 3",
|
|
265
267
|
stroke: P.gridColor,
|
|
266
268
|
horizontal: !0,
|
|
267
269
|
vertical: !1
|
|
268
270
|
}),
|
|
269
|
-
_?.showXAxis !== !1 && /* @__PURE__ */
|
|
271
|
+
_?.showXAxis !== !1 && /* @__PURE__ */ l(i, {
|
|
270
272
|
dataKey: "name",
|
|
271
273
|
axisLine: { stroke: P.axisColor },
|
|
272
274
|
tickLine: { stroke: P.axisColor },
|
|
@@ -276,7 +278,7 @@ var _ = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
276
278
|
},
|
|
277
279
|
tickFormatter: _?.xAxisFormatter
|
|
278
280
|
}),
|
|
279
|
-
_?.showYAxis !== !1 && /* @__PURE__ */
|
|
281
|
+
_?.showYAxis !== !1 && /* @__PURE__ */ l(a, {
|
|
280
282
|
axisLine: { stroke: P.axisColor },
|
|
281
283
|
tickLine: { stroke: P.axisColor },
|
|
282
284
|
tick: {
|
|
@@ -287,16 +289,16 @@ var _ = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
287
289
|
domain: _?.yAxisDomain,
|
|
288
290
|
unit: _?.yAxisUnit
|
|
289
291
|
}),
|
|
290
|
-
z?.enabled !== !1 &&
|
|
292
|
+
z?.enabled !== !1 && p && /* @__PURE__ */ l(s, {
|
|
291
293
|
...I,
|
|
292
294
|
formatter: z && typeof z != "boolean" && z.formatter ? (t, n) => z.formatter(t, n, e[0]) : (e) => `${z && typeof z != "boolean" && z.valuePrefix || ""}${e}${z && typeof z != "boolean" && z.valueSuffix || ""}`
|
|
293
295
|
}),
|
|
294
|
-
R?.enabled && /* @__PURE__ */
|
|
296
|
+
R?.enabled && /* @__PURE__ */ l(m, {
|
|
295
297
|
align: R.align,
|
|
296
298
|
verticalAlign: R.position === "top" ? "top" : "bottom",
|
|
297
299
|
wrapperStyle: { paddingTop: R.position === "bottom" ? 16 : 0 }
|
|
298
300
|
}),
|
|
299
|
-
L.map((e, t) => /* @__PURE__ */
|
|
301
|
+
L.map((e, t) => /* @__PURE__ */ l(r, {
|
|
300
302
|
dataKey: e.dataKey,
|
|
301
303
|
name: e.label,
|
|
302
304
|
fill: e.color || F(t),
|
|
@@ -304,20 +306,20 @@ var _ = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
304
306
|
stackId: O ? "stack" : void 0,
|
|
305
307
|
barSize: A,
|
|
306
308
|
animationDuration: d,
|
|
307
|
-
isAnimationActive:
|
|
309
|
+
isAnimationActive: c
|
|
308
310
|
}, e.dataKey))
|
|
309
311
|
]
|
|
310
312
|
});
|
|
311
313
|
}
|
|
312
314
|
});
|
|
313
315
|
});
|
|
314
|
-
|
|
316
|
+
v.displayName = "WakaBarChart";
|
|
315
317
|
//#endregion
|
|
316
318
|
//#region src/components/waka-charts/WakaLineChart.tsx
|
|
317
|
-
var
|
|
318
|
-
let { theme: N, getColor: P, tooltipStyles: F } =
|
|
319
|
+
var y = n.forwardRef(({ data: e, dataKeys: t, series: r, variant: i = "default", size: a = "md", height: o, width: s, animation: c = !0, animationDuration: d = 500, grid: f = !0, tooltip: p = !0, legend: h, axis: _, theme: v, className: y, style: b, title: x, description: S, loading: C, error: w, onClick: T, responsive: E = !0, curve: D = "monotone", dots: O = !0, dotSize: k = 4, activeDot: A = !0, strokeWidth: j = 2 }, M) => {
|
|
320
|
+
let { theme: N, getColor: P, tooltipStyles: F } = m(v, i), I = n.useMemo(() => {
|
|
319
321
|
if (r && r.length > 0) return r;
|
|
320
|
-
if (
|
|
322
|
+
if (t && t.length > 0) return t.map((e, t) => ({
|
|
321
323
|
dataKey: e,
|
|
322
324
|
label: e,
|
|
323
325
|
color: P(t),
|
|
@@ -329,8 +331,8 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
329
331
|
color: P(0),
|
|
330
332
|
strokeWidth: j
|
|
331
333
|
}];
|
|
332
|
-
let
|
|
333
|
-
return
|
|
334
|
+
let n = e[0];
|
|
335
|
+
return n ? Object.keys(n).filter((e) => e !== "name" && typeof n[e] == "number").map((e, t) => ({
|
|
334
336
|
dataKey: e,
|
|
335
337
|
label: e,
|
|
336
338
|
color: P(t),
|
|
@@ -338,16 +340,16 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
338
340
|
})) : [];
|
|
339
341
|
}, [
|
|
340
342
|
r,
|
|
341
|
-
|
|
343
|
+
t,
|
|
342
344
|
e,
|
|
343
345
|
P,
|
|
344
346
|
j
|
|
345
|
-
]), L =
|
|
346
|
-
enabled:
|
|
347
|
+
]), L = n.useMemo(() => h ? typeof h == "boolean" ? {
|
|
348
|
+
enabled: h,
|
|
347
349
|
position: "bottom",
|
|
348
350
|
align: "center"
|
|
349
|
-
} :
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
+
} : h : null, [h]), R = n.useMemo(() => p ? typeof p == "boolean" ? { enabled: p } : p : null, [p]);
|
|
352
|
+
return /* @__PURE__ */ l(g, {
|
|
351
353
|
ref: M,
|
|
352
354
|
variant: i,
|
|
353
355
|
size: a,
|
|
@@ -363,17 +365,17 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
363
365
|
responsive: E,
|
|
364
366
|
children: (t) => {
|
|
365
367
|
if (!t) return null;
|
|
366
|
-
let { LineChart: n, Line: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend:
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
+
let { LineChart: n, Line: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend: m } = t;
|
|
369
|
+
return /* @__PURE__ */ u(n, {
|
|
368
370
|
data: e,
|
|
369
371
|
children: [
|
|
370
|
-
f && /* @__PURE__ */
|
|
372
|
+
f && /* @__PURE__ */ l(o, {
|
|
371
373
|
strokeDasharray: "3 3",
|
|
372
374
|
stroke: N.gridColor,
|
|
373
375
|
horizontal: !0,
|
|
374
376
|
vertical: !1
|
|
375
377
|
}),
|
|
376
|
-
_?.showXAxis !== !1 && /* @__PURE__ */
|
|
378
|
+
_?.showXAxis !== !1 && /* @__PURE__ */ l(i, {
|
|
377
379
|
dataKey: "name",
|
|
378
380
|
axisLine: { stroke: N.axisColor },
|
|
379
381
|
tickLine: { stroke: N.axisColor },
|
|
@@ -383,7 +385,7 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
383
385
|
},
|
|
384
386
|
tickFormatter: _?.xAxisFormatter
|
|
385
387
|
}),
|
|
386
|
-
_?.showYAxis !== !1 && /* @__PURE__ */
|
|
388
|
+
_?.showYAxis !== !1 && /* @__PURE__ */ l(a, {
|
|
387
389
|
axisLine: { stroke: N.axisColor },
|
|
388
390
|
tickLine: { stroke: N.axisColor },
|
|
389
391
|
tick: {
|
|
@@ -394,16 +396,16 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
394
396
|
domain: _?.yAxisDomain,
|
|
395
397
|
unit: _?.yAxisUnit
|
|
396
398
|
}),
|
|
397
|
-
R?.enabled !== !1 &&
|
|
399
|
+
R?.enabled !== !1 && p && /* @__PURE__ */ l(s, {
|
|
398
400
|
...F,
|
|
399
401
|
formatter: R && typeof R != "boolean" && R.formatter ? (t, n) => R.formatter(t, n, e[0]) : (e) => `${R && typeof R != "boolean" && R.valuePrefix || ""}${e}${R && typeof R != "boolean" && R.valueSuffix || ""}`
|
|
400
402
|
}),
|
|
401
|
-
L?.enabled && /* @__PURE__ */
|
|
403
|
+
L?.enabled && /* @__PURE__ */ l(m, {
|
|
402
404
|
align: L.align,
|
|
403
405
|
verticalAlign: L.position === "top" ? "top" : "bottom",
|
|
404
406
|
wrapperStyle: { paddingTop: L.position === "bottom" ? 16 : 0 }
|
|
405
407
|
}),
|
|
406
|
-
I.map((e, t) => /* @__PURE__ */
|
|
408
|
+
I.map((e, t) => /* @__PURE__ */ l(r, {
|
|
407
409
|
dataKey: e.dataKey,
|
|
408
410
|
name: e.label,
|
|
409
411
|
stroke: e.color || P(t),
|
|
@@ -416,20 +418,20 @@ var v = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
416
418
|
} : !1,
|
|
417
419
|
activeDot: A ? { r: k + 2 } : !1,
|
|
418
420
|
animationDuration: d,
|
|
419
|
-
isAnimationActive:
|
|
421
|
+
isAnimationActive: c
|
|
420
422
|
}, e.dataKey))
|
|
421
423
|
]
|
|
422
424
|
});
|
|
423
425
|
}
|
|
424
426
|
});
|
|
425
427
|
});
|
|
426
|
-
|
|
428
|
+
y.displayName = "WakaLineChart";
|
|
427
429
|
//#endregion
|
|
428
430
|
//#region src/components/waka-charts/WakaAreaChart.tsx
|
|
429
|
-
var
|
|
430
|
-
let { theme: I, getColor: L, tooltipStyles: R } =
|
|
431
|
+
var b = n.forwardRef(({ data: e, dataKeys: t, series: r, variant: i = "default", size: a = "md", height: o, width: s, animation: c = !0, animationDuration: d = 500, grid: f = !0, tooltip: p = !0, legend: h, axis: _, theme: v, className: y, style: b, title: x, description: S, loading: C, error: w, onClick: T, responsive: E = !0, curve: D = "monotone", dots: O = !1, dotSize: k = 4, activeDot: A = !0, strokeWidth: j = 2, stacked: M = !1, fillOpacity: N = .3, gradientDirection: P = "vertical" }, F) => {
|
|
432
|
+
let { theme: I, getColor: L, tooltipStyles: R } = m(v, i), z = n.useMemo(() => {
|
|
431
433
|
if (r && r.length > 0) return r;
|
|
432
|
-
if (
|
|
434
|
+
if (t && t.length > 0) return t.map((e, t) => ({
|
|
433
435
|
dataKey: e,
|
|
434
436
|
label: e,
|
|
435
437
|
color: L(t),
|
|
@@ -443,8 +445,8 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
443
445
|
strokeWidth: j,
|
|
444
446
|
fillOpacity: N
|
|
445
447
|
}];
|
|
446
|
-
let
|
|
447
|
-
return
|
|
448
|
+
let n = e[0];
|
|
449
|
+
return n ? Object.keys(n).filter((e) => e !== "name" && typeof n[e] == "number").map((e, t) => ({
|
|
448
450
|
dataKey: e,
|
|
449
451
|
label: e,
|
|
450
452
|
color: L(t),
|
|
@@ -453,17 +455,17 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
453
455
|
})) : [];
|
|
454
456
|
}, [
|
|
455
457
|
r,
|
|
456
|
-
|
|
458
|
+
t,
|
|
457
459
|
e,
|
|
458
460
|
L,
|
|
459
461
|
j,
|
|
460
462
|
N
|
|
461
|
-
]), B =
|
|
462
|
-
enabled:
|
|
463
|
+
]), B = n.useMemo(() => h ? typeof h == "boolean" ? {
|
|
464
|
+
enabled: h,
|
|
463
465
|
position: "bottom",
|
|
464
466
|
align: "center"
|
|
465
|
-
} :
|
|
466
|
-
return /* @__PURE__ */
|
|
467
|
+
} : h : null, [h]), V = n.useMemo(() => p ? typeof p == "boolean" ? { enabled: p } : p : null, [p]);
|
|
468
|
+
return /* @__PURE__ */ l(g, {
|
|
467
469
|
ref: F,
|
|
468
470
|
variant: i,
|
|
469
471
|
size: a,
|
|
@@ -479,36 +481,36 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
479
481
|
responsive: E,
|
|
480
482
|
children: (t) => {
|
|
481
483
|
if (!t) return null;
|
|
482
|
-
let { AreaChart: n, Area: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend:
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
+
let { AreaChart: n, Area: r, XAxis: i, YAxis: a, CartesianGrid: o, Tooltip: s, Legend: m } = t;
|
|
485
|
+
return /* @__PURE__ */ u(n, {
|
|
484
486
|
data: e,
|
|
485
487
|
children: [
|
|
486
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ l("defs", { children: z.map((e, t) => {
|
|
487
489
|
let n = e.color || L(t), r = `gradient-${e.dataKey}-${t}`;
|
|
488
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ u("linearGradient", {
|
|
489
491
|
id: r,
|
|
490
492
|
x1: "0",
|
|
491
493
|
y1: "0",
|
|
492
494
|
x2: P === "horizontal" ? "1" : "0",
|
|
493
495
|
y2: P === "horizontal" ? "0" : "1",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ l("stop", {
|
|
495
497
|
offset: "5%",
|
|
496
498
|
stopColor: n,
|
|
497
499
|
stopOpacity: .8
|
|
498
|
-
}), /* @__PURE__ */
|
|
500
|
+
}), /* @__PURE__ */ l("stop", {
|
|
499
501
|
offset: "95%",
|
|
500
502
|
stopColor: n,
|
|
501
503
|
stopOpacity: .1
|
|
502
504
|
})]
|
|
503
505
|
}, r);
|
|
504
506
|
}) }),
|
|
505
|
-
f && /* @__PURE__ */
|
|
507
|
+
f && /* @__PURE__ */ l(o, {
|
|
506
508
|
strokeDasharray: "3 3",
|
|
507
509
|
stroke: I.gridColor,
|
|
508
510
|
horizontal: !0,
|
|
509
511
|
vertical: !1
|
|
510
512
|
}),
|
|
511
|
-
_?.showXAxis !== !1 && /* @__PURE__ */
|
|
513
|
+
_?.showXAxis !== !1 && /* @__PURE__ */ l(i, {
|
|
512
514
|
dataKey: "name",
|
|
513
515
|
axisLine: { stroke: I.axisColor },
|
|
514
516
|
tickLine: { stroke: I.axisColor },
|
|
@@ -518,7 +520,7 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
518
520
|
},
|
|
519
521
|
tickFormatter: _?.xAxisFormatter
|
|
520
522
|
}),
|
|
521
|
-
_?.showYAxis !== !1 && /* @__PURE__ */
|
|
523
|
+
_?.showYAxis !== !1 && /* @__PURE__ */ l(a, {
|
|
522
524
|
axisLine: { stroke: I.axisColor },
|
|
523
525
|
tickLine: { stroke: I.axisColor },
|
|
524
526
|
tick: {
|
|
@@ -529,18 +531,18 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
529
531
|
domain: _?.yAxisDomain,
|
|
530
532
|
unit: _?.yAxisUnit
|
|
531
533
|
}),
|
|
532
|
-
V?.enabled !== !1 &&
|
|
534
|
+
V?.enabled !== !1 && p && /* @__PURE__ */ l(s, {
|
|
533
535
|
...R,
|
|
534
536
|
formatter: V && typeof V != "boolean" && V.formatter ? (t, n) => V.formatter(t, n, e[0]) : (e) => `${V && typeof V != "boolean" && V.valuePrefix || ""}${e}${V && typeof V != "boolean" && V.valueSuffix || ""}`
|
|
535
537
|
}),
|
|
536
|
-
B?.enabled && /* @__PURE__ */
|
|
538
|
+
B?.enabled && /* @__PURE__ */ l(m, {
|
|
537
539
|
align: B.align,
|
|
538
540
|
verticalAlign: B.position === "top" ? "top" : "bottom",
|
|
539
541
|
wrapperStyle: { paddingTop: B.position === "bottom" ? 16 : 0 }
|
|
540
542
|
}),
|
|
541
543
|
z.map((e, t) => {
|
|
542
544
|
let n = e.color || L(t), i = `gradient-${e.dataKey}-${t}`;
|
|
543
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ l(r, {
|
|
544
546
|
dataKey: e.dataKey,
|
|
545
547
|
name: e.label,
|
|
546
548
|
stroke: n,
|
|
@@ -554,7 +556,7 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
554
556
|
} : !1,
|
|
555
557
|
stackId: M ? "stack" : void 0,
|
|
556
558
|
animationDuration: d,
|
|
557
|
-
isAnimationActive:
|
|
559
|
+
isAnimationActive: c
|
|
558
560
|
}, e.dataKey);
|
|
559
561
|
})
|
|
560
562
|
]
|
|
@@ -562,18 +564,18 @@ var y = t.forwardRef(({ data: e, dataKeys: n, series: r, variant: i = "default",
|
|
|
562
564
|
}
|
|
563
565
|
});
|
|
564
566
|
});
|
|
565
|
-
|
|
567
|
+
b.displayName = "WakaAreaChart";
|
|
566
568
|
//#endregion
|
|
567
569
|
//#region src/components/waka-charts/WakaPieChart.tsx
|
|
568
|
-
var
|
|
569
|
-
let { theme: N, getColor: P, tooltipStyles: F } =
|
|
570
|
+
var x = n.forwardRef(({ data: e, variant: t = "default", size: r = "md", height: i, width: a, animation: o = !0, animationDuration: s = 500, tooltip: c = !0, legend: d = !0, theme: f, className: p, style: h, title: _, description: v, loading: y, error: b, onClick: x, responsive: S = !0, dataKey: C = "value", nameKey: w = "name", innerRadius: T = 0, outerRadius: E = "80%", startAngle: D = 90, endAngle: O = -270, paddingAngle: k = 2, label: A = !1, labelPosition: j = "outside" }, M) => {
|
|
571
|
+
let { theme: N, getColor: P, tooltipStyles: F } = m(f, t), I = n.useMemo(() => d ? typeof d == "boolean" ? {
|
|
570
572
|
enabled: d,
|
|
571
573
|
position: "bottom",
|
|
572
574
|
align: "center"
|
|
573
|
-
} : d : null, [d]), L =
|
|
575
|
+
} : d : null, [d]), L = n.useMemo(() => c ? typeof c == "boolean" ? { enabled: c } : c : null, [c]), R = n.useCallback((e) => {
|
|
574
576
|
if (!A) return null;
|
|
575
577
|
let t = Math.PI / 180, n = j === "inside" ? e.innerRadius + (e.outerRadius - e.innerRadius) * .5 : e.outerRadius * 1.1, r = e.cx + n * Math.cos(-e.midAngle * t), i = e.cy + n * Math.sin(-e.midAngle * t), a = "";
|
|
576
|
-
return a = A === "percent" ? `${(e.percent * 100).toFixed(0)}%` : A === "value" ? String(e.value) : A === "name" ? e.name : `${(e.percent * 100).toFixed(0)}%`, /* @__PURE__ */
|
|
578
|
+
return a = A === "percent" ? `${(e.percent * 100).toFixed(0)}%` : A === "value" ? String(e.value) : A === "name" ? e.name : `${(e.percent * 100).toFixed(0)}%`, /* @__PURE__ */ l("text", {
|
|
577
579
|
x: r,
|
|
578
580
|
y: i,
|
|
579
581
|
fill: j === "inside" ? "#fff" : N.textColor,
|
|
@@ -587,15 +589,15 @@ var b = t.forwardRef(({ data: e, variant: n = "default", size: r = "md", height:
|
|
|
587
589
|
j,
|
|
588
590
|
N.textColor
|
|
589
591
|
]);
|
|
590
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ l(g, {
|
|
591
593
|
ref: M,
|
|
592
|
-
variant:
|
|
594
|
+
variant: t,
|
|
593
595
|
size: r,
|
|
594
596
|
height: i,
|
|
595
597
|
width: a,
|
|
596
598
|
theme: f,
|
|
597
|
-
className:
|
|
598
|
-
style:
|
|
599
|
+
className: p,
|
|
600
|
+
style: h,
|
|
599
601
|
title: _,
|
|
600
602
|
description: v,
|
|
601
603
|
loading: y,
|
|
@@ -604,18 +606,18 @@ var b = t.forwardRef(({ data: e, variant: n = "default", size: r = "md", height:
|
|
|
604
606
|
children: (t) => {
|
|
605
607
|
if (!t) return null;
|
|
606
608
|
let { PieChart: n, Pie: r, Cell: i, Tooltip: a, Legend: d } = t;
|
|
607
|
-
return /* @__PURE__ */
|
|
608
|
-
L?.enabled !== !1 &&
|
|
609
|
+
return /* @__PURE__ */ u(n, { children: [
|
|
610
|
+
L?.enabled !== !1 && c && /* @__PURE__ */ l(a, {
|
|
609
611
|
...F,
|
|
610
612
|
formatter: L && typeof L != "boolean" && L.formatter ? (t, n) => L.formatter(t, n, e[0]) : (e) => `${L && typeof L != "boolean" && L.valuePrefix || ""}${e}${L && typeof L != "boolean" && L.valueSuffix || ""}`
|
|
611
613
|
}),
|
|
612
|
-
I?.enabled && /* @__PURE__ */
|
|
614
|
+
I?.enabled && /* @__PURE__ */ l(d, {
|
|
613
615
|
align: I.align,
|
|
614
616
|
verticalAlign: I.position === "top" ? "top" : "bottom",
|
|
615
617
|
layout: I.position === "left" || I.position === "right" ? "vertical" : "horizontal",
|
|
616
618
|
wrapperStyle: { paddingTop: I.position === "bottom" ? 16 : 0 }
|
|
617
619
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ l(r, {
|
|
619
621
|
data: e,
|
|
620
622
|
dataKey: C,
|
|
621
623
|
nameKey: w,
|
|
@@ -630,7 +632,7 @@ var b = t.forwardRef(({ data: e, variant: n = "default", size: r = "md", height:
|
|
|
630
632
|
isAnimationActive: o,
|
|
631
633
|
label: A ? R : !1,
|
|
632
634
|
labelLine: A && j === "outside",
|
|
633
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
635
|
+
children: e.map((e, t) => /* @__PURE__ */ l(i, {
|
|
634
636
|
fill: P(t),
|
|
635
637
|
stroke: "transparent"
|
|
636
638
|
}, `cell-${t}`))
|
|
@@ -639,25 +641,25 @@ var b = t.forwardRef(({ data: e, variant: n = "default", size: r = "md", height:
|
|
|
639
641
|
}
|
|
640
642
|
});
|
|
641
643
|
});
|
|
642
|
-
b.displayName = "WakaPieChart";
|
|
643
644
|
//#endregion
|
|
644
645
|
//#region src/components/waka-charts/WakaSparkline.tsx
|
|
645
|
-
|
|
646
|
-
|
|
646
|
+
x.displayName = "WakaPieChart", e();
|
|
647
|
+
var S = n.forwardRef(({ data: e, type: r = "line", width: i = 100, height: a = 30, color: o = "hsl(var(--chart-1))", fillColor: s, fillOpacity: c = .3, showMinMax: d = !1, showValue: p = !1, className: m, animation: h = !0 }, g) => {
|
|
648
|
+
let { components: _, loading: v, isAvailable: y } = f(), b = n.useMemo(() => e.map((e, t) => ({
|
|
647
649
|
index: t,
|
|
648
650
|
value: e
|
|
649
|
-
})), [
|
|
650
|
-
let
|
|
651
|
+
})), [e]), { min: x, max: S, current: w } = n.useMemo(() => {
|
|
652
|
+
let t = e.filter((e) => typeof e == "number" && !isNaN(e));
|
|
651
653
|
return {
|
|
652
|
-
min: Math.min(...
|
|
653
|
-
max: Math.max(...
|
|
654
|
-
current:
|
|
654
|
+
min: Math.min(...t),
|
|
655
|
+
max: Math.max(...t),
|
|
656
|
+
current: t[t.length - 1]
|
|
655
657
|
};
|
|
656
|
-
}, [
|
|
657
|
-
if (v) return /* @__PURE__ */
|
|
658
|
+
}, [e]);
|
|
659
|
+
if (v) return /* @__PURE__ */ l("div", {
|
|
658
660
|
ref: g,
|
|
659
|
-
className:
|
|
660
|
-
children: /* @__PURE__ */
|
|
661
|
+
className: t("inline-flex items-center gap-2", m),
|
|
662
|
+
children: /* @__PURE__ */ l("div", {
|
|
661
663
|
className: "bg-muted animate-pulse rounded",
|
|
662
664
|
style: {
|
|
663
665
|
width: i,
|
|
@@ -665,73 +667,73 @@ var x = t.forwardRef(({ data: n, type: r = "line", width: i = 100, height: a = 3
|
|
|
665
667
|
}
|
|
666
668
|
})
|
|
667
669
|
});
|
|
668
|
-
if (!y || !_) return /* @__PURE__ */
|
|
670
|
+
if (!y || !_) return /* @__PURE__ */ u("div", {
|
|
669
671
|
ref: g,
|
|
670
|
-
className:
|
|
671
|
-
children: [/* @__PURE__ */
|
|
672
|
-
data:
|
|
672
|
+
className: t("inline-flex items-center gap-2", m),
|
|
673
|
+
children: [/* @__PURE__ */ l(C, {
|
|
674
|
+
data: e,
|
|
673
675
|
width: i,
|
|
674
676
|
height: a,
|
|
675
677
|
color: o,
|
|
676
678
|
type: r,
|
|
677
679
|
fillColor: s,
|
|
678
|
-
fillOpacity:
|
|
679
|
-
}), p && /* @__PURE__ */
|
|
680
|
+
fillOpacity: c
|
|
681
|
+
}), p && /* @__PURE__ */ l("span", {
|
|
680
682
|
className: "text-sm font-medium",
|
|
681
683
|
children: w
|
|
682
684
|
})]
|
|
683
685
|
});
|
|
684
686
|
let { ResponsiveContainer: T, LineChart: E, BarChart: D, AreaChart: O, Line: k, Bar: A, Area: j } = _;
|
|
685
|
-
return /* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ u("div", {
|
|
686
688
|
ref: g,
|
|
687
|
-
className:
|
|
689
|
+
className: t("inline-flex items-center gap-2", m),
|
|
688
690
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ l("div", {
|
|
690
692
|
style: {
|
|
691
693
|
width: i,
|
|
692
694
|
height: a
|
|
693
695
|
},
|
|
694
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ l(T, {
|
|
695
697
|
width: "100%",
|
|
696
698
|
height: "100%",
|
|
697
|
-
children: r === "bar" ? /* @__PURE__ */
|
|
699
|
+
children: r === "bar" ? /* @__PURE__ */ l(D, {
|
|
698
700
|
data: b,
|
|
699
|
-
children: /* @__PURE__ */
|
|
701
|
+
children: /* @__PURE__ */ l(A, {
|
|
700
702
|
dataKey: "value",
|
|
701
703
|
fill: o,
|
|
702
704
|
radius: 1,
|
|
703
705
|
isAnimationActive: h
|
|
704
706
|
})
|
|
705
|
-
}) : r === "area" ? /* @__PURE__ */
|
|
707
|
+
}) : r === "area" ? /* @__PURE__ */ u(O, {
|
|
706
708
|
data: b,
|
|
707
|
-
children: [/* @__PURE__ */
|
|
709
|
+
children: [/* @__PURE__ */ l("defs", { children: /* @__PURE__ */ u("linearGradient", {
|
|
708
710
|
id: `sparkline-gradient-${o.replace(/[^a-z0-9]/gi, "")}`,
|
|
709
711
|
x1: "0",
|
|
710
712
|
y1: "0",
|
|
711
713
|
x2: "0",
|
|
712
714
|
y2: "1",
|
|
713
|
-
children: [/* @__PURE__ */
|
|
715
|
+
children: [/* @__PURE__ */ l("stop", {
|
|
714
716
|
offset: "5%",
|
|
715
717
|
stopColor: s || o,
|
|
716
718
|
stopOpacity: .8
|
|
717
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ l("stop", {
|
|
718
720
|
offset: "95%",
|
|
719
721
|
stopColor: s || o,
|
|
720
722
|
stopOpacity: .1
|
|
721
723
|
})]
|
|
722
|
-
}) }), /* @__PURE__ */
|
|
724
|
+
}) }), /* @__PURE__ */ l(j, {
|
|
723
725
|
type: "monotone",
|
|
724
726
|
dataKey: "value",
|
|
725
727
|
stroke: o,
|
|
726
728
|
fill: `url(#sparkline-gradient-${o.replace(/[^a-z0-9]/gi, "")})`,
|
|
727
|
-
fillOpacity:
|
|
729
|
+
fillOpacity: c,
|
|
728
730
|
strokeWidth: 1.5,
|
|
729
731
|
dot: !1,
|
|
730
732
|
isAnimationActive: h
|
|
731
733
|
})]
|
|
732
|
-
}) : /* @__PURE__ */
|
|
734
|
+
}) : /* @__PURE__ */ l(E, {
|
|
733
735
|
data: b,
|
|
734
|
-
children: /* @__PURE__ */
|
|
736
|
+
children: /* @__PURE__ */ l(k, {
|
|
735
737
|
type: "monotone",
|
|
736
738
|
dataKey: "value",
|
|
737
739
|
stroke: o,
|
|
@@ -742,34 +744,34 @@ var x = t.forwardRef(({ data: n, type: r = "line", width: i = 100, height: a = 3
|
|
|
742
744
|
})
|
|
743
745
|
})
|
|
744
746
|
}),
|
|
745
|
-
|
|
747
|
+
d && /* @__PURE__ */ u("div", {
|
|
746
748
|
className: "flex flex-col text-xs text-muted-foreground",
|
|
747
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ u("span", { children: ["↑ ", S] }), /* @__PURE__ */ u("span", { children: ["↓ ", x] })]
|
|
748
750
|
}),
|
|
749
|
-
p && /* @__PURE__ */
|
|
751
|
+
p && /* @__PURE__ */ l("span", {
|
|
750
752
|
className: "text-sm font-medium",
|
|
751
753
|
children: w
|
|
752
754
|
})
|
|
753
755
|
]
|
|
754
756
|
});
|
|
755
757
|
});
|
|
756
|
-
|
|
757
|
-
function
|
|
758
|
-
let s = t - 4,
|
|
758
|
+
S.displayName = "WakaSparkline";
|
|
759
|
+
function C({ data: e, width: t, height: n, color: r, type: i, fillColor: a, fillOpacity: o }) {
|
|
760
|
+
let s = t - 4, c = n - 4, d = Math.min(...e), f = Math.max(...e) - d || 1, p = e.map((t, n) => ({
|
|
759
761
|
x: 2 + n / (e.length - 1 || 1) * s,
|
|
760
|
-
y: 2 +
|
|
762
|
+
y: 2 + c - (t - d) / f * c,
|
|
761
763
|
value: t
|
|
762
764
|
}));
|
|
763
765
|
if (i === "bar") {
|
|
764
766
|
let i = s / e.length - 1;
|
|
765
|
-
return /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ l("svg", {
|
|
766
768
|
width: t,
|
|
767
769
|
height: n,
|
|
768
770
|
children: e.map((e, t) => {
|
|
769
|
-
let n = (e - d) / f *
|
|
770
|
-
return /* @__PURE__ */
|
|
771
|
+
let n = (e - d) / f * c;
|
|
772
|
+
return /* @__PURE__ */ l("rect", {
|
|
771
773
|
x: 2 + t * (i + 1),
|
|
772
|
-
y: 2 +
|
|
774
|
+
y: 2 + c - n,
|
|
773
775
|
width: i,
|
|
774
776
|
height: n,
|
|
775
777
|
fill: r,
|
|
@@ -779,23 +781,23 @@ function S({ data: e, width: t, height: n, color: r, type: i, fillColor: a, fill
|
|
|
779
781
|
});
|
|
780
782
|
}
|
|
781
783
|
let m = p.map((e, t) => `${t === 0 ? "M" : "L"} ${e.x} ${e.y}`).join(" ");
|
|
782
|
-
return i === "area" ? /* @__PURE__ */
|
|
784
|
+
return i === "area" ? /* @__PURE__ */ u("svg", {
|
|
783
785
|
width: t,
|
|
784
786
|
height: n,
|
|
785
|
-
children: [/* @__PURE__ */
|
|
787
|
+
children: [/* @__PURE__ */ l("path", {
|
|
786
788
|
d: `${m} L ${p[p.length - 1].x} ${n - 2} L 2 ${n - 2} Z`,
|
|
787
789
|
fill: a || r,
|
|
788
790
|
fillOpacity: o
|
|
789
|
-
}), /* @__PURE__ */
|
|
791
|
+
}), /* @__PURE__ */ l("path", {
|
|
790
792
|
d: m,
|
|
791
793
|
fill: "none",
|
|
792
794
|
stroke: r,
|
|
793
795
|
strokeWidth: 1.5
|
|
794
796
|
})]
|
|
795
|
-
}) : /* @__PURE__ */
|
|
797
|
+
}) : /* @__PURE__ */ l("svg", {
|
|
796
798
|
width: t,
|
|
797
799
|
height: n,
|
|
798
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ l("path", {
|
|
799
801
|
d: m,
|
|
800
802
|
fill: "none",
|
|
801
803
|
stroke: r,
|
|
@@ -805,11 +807,12 @@ function S({ data: e, width: t, height: n, color: r, type: i, fillColor: a, fill
|
|
|
805
807
|
}
|
|
806
808
|
//#endregion
|
|
807
809
|
//#region src/components/waka-charts/WakaMiniChart.tsx
|
|
808
|
-
|
|
809
|
-
|
|
810
|
+
e();
|
|
811
|
+
var w = n.forwardRef(({ data: e, type: r = "sparkline", width: i = 80, height: a = 24, color: d, showTrend: f = !0, valueFormatter: p, className: m }, h) => {
|
|
812
|
+
let g = n.useMemo(() => !e || e.length === 0 ? [] : typeof e[0] == "number" ? e : e.map((e) => {
|
|
810
813
|
let t = e.value ?? Object.values(e).find((e) => typeof e == "number");
|
|
811
814
|
return typeof t == "number" ? t : 0;
|
|
812
|
-
}), [
|
|
815
|
+
}), [e]), { trend: _, trendPercent: v, currentValue: y } = n.useMemo(() => {
|
|
813
816
|
if (g.length < 2) return {
|
|
814
817
|
trend: "neutral",
|
|
815
818
|
trendPercent: 0,
|
|
@@ -821,29 +824,29 @@ var C = t.forwardRef(({ data: n, type: r = "sparkline", width: i = 80, height: u
|
|
|
821
824
|
trendPercent: r,
|
|
822
825
|
currentValue: t
|
|
823
826
|
};
|
|
824
|
-
}, [g]), b =
|
|
825
|
-
return g.length === 0 ? /* @__PURE__ */
|
|
827
|
+
}, [g]), b = n.useMemo(() => d || (_ === "up" ? "hsl(var(--chart-2, 142 76% 36%))" : _ === "down" ? "hsl(var(--destructive, 0 84% 60%))" : "hsl(var(--muted-foreground, 220 9% 46%))"), [d, _]);
|
|
828
|
+
return g.length === 0 ? /* @__PURE__ */ l("div", {
|
|
826
829
|
ref: h,
|
|
827
|
-
className:
|
|
828
|
-
children: /* @__PURE__ */
|
|
829
|
-
}) : (p ? p(y) : y.toLocaleString(), /* @__PURE__ */
|
|
830
|
+
className: t("flex items-center gap-1 text-muted-foreground", m),
|
|
831
|
+
children: /* @__PURE__ */ l(o, { className: "h-3 w-3" })
|
|
832
|
+
}) : (p ? p(y) : y.toLocaleString(), /* @__PURE__ */ u("div", {
|
|
830
833
|
ref: h,
|
|
831
|
-
className:
|
|
832
|
-
children: [/* @__PURE__ */
|
|
834
|
+
className: t("flex items-center gap-2", m),
|
|
835
|
+
children: [/* @__PURE__ */ l(S, {
|
|
833
836
|
data: g,
|
|
834
837
|
type: r === "sparkline" ? "line" : r,
|
|
835
838
|
width: i,
|
|
836
|
-
height:
|
|
839
|
+
height: a,
|
|
837
840
|
color: b,
|
|
838
841
|
animation: !1
|
|
839
|
-
}), f && /* @__PURE__ */
|
|
842
|
+
}), f && /* @__PURE__ */ u("div", {
|
|
840
843
|
className: "flex items-center gap-1",
|
|
841
844
|
children: [
|
|
842
|
-
_ === "up" && /* @__PURE__ */ c
|
|
843
|
-
_ === "down" && /* @__PURE__ */
|
|
844
|
-
_ === "neutral" && /* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
className:
|
|
845
|
+
_ === "up" && /* @__PURE__ */ l(c, { className: "h-3 w-3 text-green-600 dark:text-green-400" }),
|
|
846
|
+
_ === "down" && /* @__PURE__ */ l(s, { className: "h-3 w-3 text-red-600 dark:text-red-400" }),
|
|
847
|
+
_ === "neutral" && /* @__PURE__ */ l(o, { className: "h-3 w-3 text-muted-foreground" }),
|
|
848
|
+
/* @__PURE__ */ u("span", {
|
|
849
|
+
className: t("text-xs font-medium", _ === "up" && "text-green-600 dark:text-green-400", _ === "down" && "text-red-600 dark:text-red-400", _ === "neutral" && "text-muted-foreground"),
|
|
847
850
|
children: [
|
|
848
851
|
_ !== "neutral" && (v > 0 ? "+" : ""),
|
|
849
852
|
v.toFixed(1),
|
|
@@ -854,10 +857,10 @@ var C = t.forwardRef(({ data: n, type: r = "sparkline", width: i = 80, height: u
|
|
|
854
857
|
})]
|
|
855
858
|
}));
|
|
856
859
|
});
|
|
857
|
-
|
|
860
|
+
w.displayName = "WakaMiniChart";
|
|
858
861
|
//#endregion
|
|
859
862
|
//#region src/components/waka-charts/dataTableHelpers.ts
|
|
860
|
-
function
|
|
863
|
+
function T(e) {
|
|
861
864
|
let { accessorKey: t, header: n = String(t), chartType: r = "sparkline", width: i = 100, height: a = 24, color: o, showValue: s = !1, valueFormatter: c } = e;
|
|
862
865
|
return {
|
|
863
866
|
accessorKey: t,
|
|
@@ -887,7 +890,7 @@ function w(e) {
|
|
|
887
890
|
}
|
|
888
891
|
};
|
|
889
892
|
}
|
|
890
|
-
var
|
|
893
|
+
var E = {
|
|
891
894
|
cell: (e) => {
|
|
892
895
|
if (!Array.isArray(e)) return null;
|
|
893
896
|
let t = [];
|
|
@@ -902,13 +905,13 @@ var T = {
|
|
|
902
905
|
size: 100,
|
|
903
906
|
enableSorting: !1,
|
|
904
907
|
enableFiltering: !1
|
|
905
|
-
},
|
|
908
|
+
}, D = [
|
|
906
909
|
"hsl(var(--chart-1))",
|
|
907
910
|
"hsl(var(--chart-2))",
|
|
908
911
|
"hsl(var(--chart-3))",
|
|
909
912
|
"hsl(var(--chart-4))",
|
|
910
913
|
"hsl(var(--chart-5))"
|
|
911
|
-
],
|
|
914
|
+
], O = {
|
|
912
915
|
sm: {
|
|
913
916
|
width: "100%",
|
|
914
917
|
height: 150
|
|
@@ -931,4 +934,4 @@ var T = {
|
|
|
931
934
|
}
|
|
932
935
|
};
|
|
933
936
|
//#endregion
|
|
934
|
-
export {
|
|
937
|
+
export { w as a, b as c, g as d, m as f, E as i, y as l, d as m, D as n, S as o, f as p, T as r, x as s, O as t, v as u };
|