@questpie/admin 3.2.4 → 3.2.6
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/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +94 -296
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +61 -72
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +285 -605
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +176 -476
- package/dist/client/components/preview/live-preview-mode.mjs +233 -458
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +229 -572
- package/dist/client/components/primitives/select-single.mjs +179 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.mjs +63 -146
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +167 -348
- package/dist/client/preview/use-collection-preview.mjs +121 -215
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +116 -356
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +58 -182
- package/dist/client/views/collection/form-view.mjs +284 -518
- package/dist/client/views/collection/table-view.mjs +231 -463
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -560
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +477 -1301
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +458 -1274
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.d.mts +2 -2
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/adapters/index.d.mts +2 -0
- package/dist/server/adapters/nextjs.d.mts +1 -0
- package/dist/server/auth-helpers.d.mts +1 -0
- package/dist/server/modules/admin/.generated/module.d.mts +1 -0
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +39 -39
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +62 -62
- package/dist/server/modules/admin/collections/verification.d.mts +23 -23
- package/dist/server/modules/admin/index.d.mts +20 -19
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
- package/dist/server/modules/audit/.generated/module.d.mts +6 -6
- package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
- package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
- package/dist/server.d.mts +2 -0
- package/package.json +3 -5
|
@@ -7,12 +7,17 @@ import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
|
|
|
7
7
|
import { useServerWidgetData } from "../../hooks/use-server-widget-data.mjs";
|
|
8
8
|
import { WidgetEmptyState } from "./widget-empty-state.mjs";
|
|
9
9
|
import { ChartWidgetSkeleton } from "./widget-skeletons.mjs";
|
|
10
|
-
import
|
|
11
|
-
import "react";
|
|
10
|
+
import * as React from "react";
|
|
12
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, Line, LineChart, Pie, PieChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
14
13
|
|
|
15
14
|
//#region src/client/components/widgets/chart-widget.tsx
|
|
15
|
+
/**
|
|
16
|
+
* Chart Widget
|
|
17
|
+
*
|
|
18
|
+
* Displays data visualization over time.
|
|
19
|
+
* Uses WidgetCard for consistent styling.
|
|
20
|
+
*/
|
|
16
21
|
const CHART_COLORS = [
|
|
17
22
|
"var(--color-chart-1)",
|
|
18
23
|
"var(--color-chart-2)",
|
|
@@ -23,36 +28,26 @@ const CHART_COLORS = [
|
|
|
23
28
|
/**
|
|
24
29
|
* Custom tooltip component matching shadcn style
|
|
25
30
|
*/
|
|
26
|
-
function ChartTooltip(
|
|
27
|
-
const $ = c(7);
|
|
28
|
-
const { active, payload, label } = t0;
|
|
31
|
+
function ChartTooltip({ active, payload, label }) {
|
|
29
32
|
if (!active || !payload?.length) return null;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "border-border bg-background border px-3 py-2 text-xs shadow-md",
|
|
35
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
33
36
|
className: "text-foreground font-medium",
|
|
34
37
|
children: label
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: "border-border bg-background border px-3 py-2 text-xs shadow-md",
|
|
49
|
-
children: [t1, t2]
|
|
50
|
-
});
|
|
51
|
-
$[4] = t1;
|
|
52
|
-
$[5] = t2;
|
|
53
|
-
$[6] = t3;
|
|
54
|
-
} else t3 = $[6];
|
|
55
|
-
return t3;
|
|
38
|
+
}), payload.map((entry) => /* @__PURE__ */ jsxs("p", {
|
|
39
|
+
className: "text-muted-foreground",
|
|
40
|
+
children: [
|
|
41
|
+
entry.name,
|
|
42
|
+
":",
|
|
43
|
+
" ",
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "text-foreground font-medium",
|
|
46
|
+
children: entry.value
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}, String(entry.name)))]
|
|
50
|
+
});
|
|
56
51
|
}
|
|
57
52
|
/**
|
|
58
53
|
* Chart widget component
|
|
@@ -62,569 +57,226 @@ function ChartTooltip(t0) {
|
|
|
62
57
|
* - Multiple chart types (line, bar, area, pie)
|
|
63
58
|
* - Configurable time ranges
|
|
64
59
|
*/
|
|
65
|
-
function
|
|
66
|
-
return /* @__PURE__ */ jsxs("p", {
|
|
67
|
-
className: "text-muted-foreground",
|
|
68
|
-
children: [
|
|
69
|
-
entry.name,
|
|
70
|
-
":",
|
|
71
|
-
" ",
|
|
72
|
-
/* @__PURE__ */ jsx("span", {
|
|
73
|
-
className: "text-foreground font-medium",
|
|
74
|
-
children: entry.value
|
|
75
|
-
})
|
|
76
|
-
]
|
|
77
|
-
}, String(entry.name));
|
|
78
|
-
}
|
|
79
|
-
function ChartWidget(t0) {
|
|
80
|
-
const $ = c(63);
|
|
81
|
-
const { config } = t0;
|
|
60
|
+
function ChartWidget({ config }) {
|
|
82
61
|
const resolveText = useResolveText();
|
|
83
62
|
const { t, locale } = useTranslation();
|
|
84
|
-
const { collection, field, chartType
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
let t6;
|
|
91
|
-
if ($[0] !== refreshInterval || $[1] !== t5) {
|
|
92
|
-
t6 = {
|
|
93
|
-
enabled: t5,
|
|
94
|
-
refreshInterval
|
|
95
|
-
};
|
|
96
|
-
$[0] = refreshInterval;
|
|
97
|
-
$[1] = t5;
|
|
98
|
-
$[2] = t6;
|
|
99
|
-
} else t6 = $[2];
|
|
100
|
-
const serverQuery = useServerWidgetData(config.id, t6);
|
|
101
|
-
const t7 = !!collection && !hasLoader;
|
|
102
|
-
let t8;
|
|
103
|
-
if ($[3] !== t7) {
|
|
104
|
-
t8 = { schemaQueryOptions: { enabled: t7 } };
|
|
105
|
-
$[3] = t7;
|
|
106
|
-
$[4] = t8;
|
|
107
|
-
} else t8 = $[4];
|
|
108
|
-
const { fields } = useCollectionFields(collection, t8);
|
|
63
|
+
const { collection, field, chartType = "area", timeRange = "30d", label, color = "var(--color-chart-1)", showGrid = true, realtime, hasLoader, refreshInterval } = config;
|
|
64
|
+
const serverQuery = useServerWidgetData(config.id, {
|
|
65
|
+
enabled: !!hasLoader,
|
|
66
|
+
refreshInterval
|
|
67
|
+
});
|
|
68
|
+
const { fields } = useCollectionFields(collection, { schemaQueryOptions: { enabled: !!collection && !hasLoader } });
|
|
109
69
|
const fieldDef = fields[field];
|
|
110
70
|
const fieldType = fieldDef?.name;
|
|
111
71
|
const selectOptions = fieldDef?.["~options"]?.options;
|
|
112
|
-
|
|
113
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
114
|
-
t9 = { limit: 1e3 };
|
|
115
|
-
$[5] = t9;
|
|
116
|
-
} else t9 = $[5];
|
|
117
|
-
const t10 = !hasLoader;
|
|
118
|
-
let t11;
|
|
119
|
-
if ($[6] !== t10) {
|
|
120
|
-
t11 = { enabled: t10 };
|
|
121
|
-
$[6] = t10;
|
|
122
|
-
$[7] = t11;
|
|
123
|
-
} else t11 = $[7];
|
|
124
|
-
let t12;
|
|
125
|
-
if ($[8] !== realtime) {
|
|
126
|
-
t12 = { realtime };
|
|
127
|
-
$[8] = realtime;
|
|
128
|
-
$[9] = t12;
|
|
129
|
-
} else t12 = $[9];
|
|
130
|
-
const collectionQuery = useCollectionList(collection, t9, t11, t12);
|
|
72
|
+
const collectionQuery = useCollectionList(collection, { limit: 1e3 }, { enabled: !hasLoader }, { realtime });
|
|
131
73
|
const { isLoading, error, refetch, isFetching } = hasLoader ? serverQuery : collectionQuery;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (value === void 0 || value === null) return acc;
|
|
189
|
-
let key;
|
|
190
|
-
if (fieldType === "select") key = resolveOptionLabelForValue({
|
|
191
|
-
value,
|
|
192
|
-
options: selectOptions,
|
|
193
|
-
resolveText,
|
|
194
|
-
t,
|
|
195
|
-
locale
|
|
196
|
-
});
|
|
197
|
-
else if (value instanceof Date || !isNaN(Date.parse(value))) key = formatDateForRange(new Date(value), timeRange);
|
|
198
|
-
else key = String(value);
|
|
199
|
-
acc[key] = (acc[key] || 0) + 1;
|
|
200
|
-
return acc;
|
|
201
|
-
}, {});
|
|
202
|
-
t16$1 = Object.entries(grouped).map(_temp2).sort(_temp3);
|
|
203
|
-
$[22] = collectionItems;
|
|
204
|
-
$[23] = field;
|
|
205
|
-
$[24] = fieldType;
|
|
206
|
-
$[25] = locale;
|
|
207
|
-
$[26] = resolveText;
|
|
208
|
-
$[27] = selectOptions;
|
|
209
|
-
$[28] = t;
|
|
210
|
-
$[29] = timeRange;
|
|
211
|
-
$[30] = t16$1;
|
|
212
|
-
} else t16$1 = $[30];
|
|
213
|
-
t15 = t16$1;
|
|
214
|
-
}
|
|
215
|
-
const chartData = t15;
|
|
216
|
-
let t16;
|
|
217
|
-
if ($[31] !== t) {
|
|
218
|
-
t16 = t("widget.chart.emptyTitle");
|
|
219
|
-
$[31] = t;
|
|
220
|
-
$[32] = t16;
|
|
221
|
-
} else t16 = $[32];
|
|
222
|
-
let t17;
|
|
223
|
-
if ($[33] !== t) {
|
|
224
|
-
t17 = t("widget.chart.emptyDescription");
|
|
225
|
-
$[33] = t;
|
|
226
|
-
$[34] = t17;
|
|
227
|
-
} else t17 = $[34];
|
|
228
|
-
let t18;
|
|
229
|
-
if ($[35] !== t16 || $[36] !== t17) {
|
|
230
|
-
t18 = /* @__PURE__ */ jsx(WidgetEmptyState, {
|
|
231
|
-
iconName: "ph:chart-line",
|
|
232
|
-
title: t16,
|
|
233
|
-
description: t17,
|
|
234
|
-
className: "min-h-48"
|
|
235
|
-
});
|
|
236
|
-
$[35] = t16;
|
|
237
|
-
$[36] = t17;
|
|
238
|
-
$[37] = t18;
|
|
239
|
-
} else t18 = $[37];
|
|
240
|
-
const emptyContent = t18;
|
|
241
|
-
let t19;
|
|
242
|
-
if ($[38] !== chartData || $[39] !== chartType || $[40] !== color || $[41] !== emptyContent || $[42] !== showGrid) {
|
|
243
|
-
t19 = chartData.length === 0 ? emptyContent : /* @__PURE__ */ jsx("div", {
|
|
244
|
-
className: "h-48 w-full",
|
|
245
|
-
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
246
|
-
width: "100%",
|
|
247
|
-
height: "100%",
|
|
248
|
-
children: /* @__PURE__ */ jsx(ChartRenderer, {
|
|
249
|
-
type: chartType,
|
|
250
|
-
data: chartData,
|
|
251
|
-
color,
|
|
252
|
-
showGrid
|
|
253
|
-
})
|
|
74
|
+
const collectionItems = React.useMemo(() => {
|
|
75
|
+
if (hasLoader) return [];
|
|
76
|
+
return Array.isArray(collectionQuery.data?.docs) ? collectionQuery.data.docs : [];
|
|
77
|
+
}, [hasLoader, collectionQuery.data]);
|
|
78
|
+
const displayLabel = config.title ? resolveText(config.title) : label ? resolveText(label) : `${formatLabel(collection)} by ${field}`;
|
|
79
|
+
const chartData = React.useMemo(() => {
|
|
80
|
+
if (hasLoader) return serverQuery.data ?? [];
|
|
81
|
+
if (!collectionItems.length) return [];
|
|
82
|
+
const grouped = collectionItems.reduce((acc, item) => {
|
|
83
|
+
const value = item[field];
|
|
84
|
+
if (value === void 0 || value === null) return acc;
|
|
85
|
+
let key;
|
|
86
|
+
if (fieldType === "select") key = resolveOptionLabelForValue({
|
|
87
|
+
value,
|
|
88
|
+
options: selectOptions,
|
|
89
|
+
resolveText,
|
|
90
|
+
t,
|
|
91
|
+
locale
|
|
92
|
+
});
|
|
93
|
+
else if (value instanceof Date || !isNaN(Date.parse(value))) key = formatDateForRange(new Date(value), timeRange);
|
|
94
|
+
else key = String(value);
|
|
95
|
+
acc[key] = (acc[key] || 0) + 1;
|
|
96
|
+
return acc;
|
|
97
|
+
}, {});
|
|
98
|
+
return Object.entries(grouped).map(([name, value]) => ({
|
|
99
|
+
name,
|
|
100
|
+
value
|
|
101
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
102
|
+
}, [
|
|
103
|
+
hasLoader,
|
|
104
|
+
serverQuery.data,
|
|
105
|
+
collectionItems,
|
|
106
|
+
field,
|
|
107
|
+
fieldType,
|
|
108
|
+
selectOptions,
|
|
109
|
+
resolveText,
|
|
110
|
+
t,
|
|
111
|
+
locale,
|
|
112
|
+
timeRange
|
|
113
|
+
]);
|
|
114
|
+
const emptyContent = /* @__PURE__ */ jsx(WidgetEmptyState, {
|
|
115
|
+
iconName: "ph:chart-line",
|
|
116
|
+
title: t("widget.chart.emptyTitle"),
|
|
117
|
+
description: t("widget.chart.emptyDescription"),
|
|
118
|
+
className: "min-h-48"
|
|
119
|
+
});
|
|
120
|
+
const chartContent = chartData.length === 0 ? emptyContent : /* @__PURE__ */ jsx("div", {
|
|
121
|
+
className: "h-48 w-full",
|
|
122
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
123
|
+
width: "100%",
|
|
124
|
+
height: "100%",
|
|
125
|
+
children: /* @__PURE__ */ jsx(ChartRenderer, {
|
|
126
|
+
type: chartType,
|
|
127
|
+
data: chartData,
|
|
128
|
+
color,
|
|
129
|
+
showGrid
|
|
254
130
|
})
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
} else t20 = $[46];
|
|
271
|
-
const t21 = isFetching && !isLoading;
|
|
272
|
-
let t22;
|
|
273
|
-
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
274
|
-
t22 = /* @__PURE__ */ jsx(ChartWidgetSkeleton, {});
|
|
275
|
-
$[47] = t22;
|
|
276
|
-
} else t22 = $[47];
|
|
277
|
-
let t23;
|
|
278
|
-
if ($[48] !== error) {
|
|
279
|
-
t23 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
280
|
-
$[48] = error;
|
|
281
|
-
$[49] = t23;
|
|
282
|
-
} else t23 = $[49];
|
|
283
|
-
let t24;
|
|
284
|
-
if ($[50] !== refetch) {
|
|
285
|
-
t24 = () => refetch();
|
|
286
|
-
$[50] = refetch;
|
|
287
|
-
$[51] = t24;
|
|
288
|
-
} else t24 = $[51];
|
|
289
|
-
let t25;
|
|
290
|
-
if ($[52] !== chartContent || $[53] !== config.actions || $[54] !== config.cardVariant || $[55] !== config.className || $[56] !== displayLabel || $[57] !== isLoading || $[58] !== t20 || $[59] !== t21 || $[60] !== t23 || $[61] !== t24) {
|
|
291
|
-
t25 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
292
|
-
title: displayLabel,
|
|
293
|
-
description: t20,
|
|
294
|
-
variant: config.cardVariant,
|
|
295
|
-
isLoading,
|
|
296
|
-
isRefreshing: t21,
|
|
297
|
-
loadingSkeleton: t22,
|
|
298
|
-
error: t23,
|
|
299
|
-
onRefresh: t24,
|
|
300
|
-
actions: config.actions,
|
|
301
|
-
className: config.className,
|
|
302
|
-
children: chartContent
|
|
303
|
-
});
|
|
304
|
-
$[52] = chartContent;
|
|
305
|
-
$[53] = config.actions;
|
|
306
|
-
$[54] = config.cardVariant;
|
|
307
|
-
$[55] = config.className;
|
|
308
|
-
$[56] = displayLabel;
|
|
309
|
-
$[57] = isLoading;
|
|
310
|
-
$[58] = t20;
|
|
311
|
-
$[59] = t21;
|
|
312
|
-
$[60] = t23;
|
|
313
|
-
$[61] = t24;
|
|
314
|
-
$[62] = t25;
|
|
315
|
-
} else t25 = $[62];
|
|
316
|
-
return t25;
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
return /* @__PURE__ */ jsx(WidgetCard, {
|
|
134
|
+
title: displayLabel,
|
|
135
|
+
description: config.description ? resolveText(config.description) : void 0,
|
|
136
|
+
variant: config.cardVariant,
|
|
137
|
+
isLoading,
|
|
138
|
+
isRefreshing: isFetching && !isLoading,
|
|
139
|
+
loadingSkeleton: /* @__PURE__ */ jsx(ChartWidgetSkeleton, {}),
|
|
140
|
+
error: error instanceof Error ? error : error ? new Error(String(error)) : null,
|
|
141
|
+
onRefresh: () => refetch(),
|
|
142
|
+
actions: config.actions,
|
|
143
|
+
className: config.className,
|
|
144
|
+
children: chartContent
|
|
145
|
+
});
|
|
317
146
|
}
|
|
318
147
|
/**
|
|
319
148
|
* Renders the appropriate chart type as a proper component
|
|
320
149
|
*/
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const [name, value_0] = t0;
|
|
326
|
-
return {
|
|
327
|
-
name,
|
|
328
|
-
value: value_0
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
function ChartRenderer(t0) {
|
|
332
|
-
const $ = c(46);
|
|
333
|
-
const { type, data, color, showGrid } = t0;
|
|
334
|
-
let t1;
|
|
335
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
336
|
-
t1 = {
|
|
150
|
+
function ChartRenderer({ type, data, color, showGrid }) {
|
|
151
|
+
const commonProps = {
|
|
152
|
+
data,
|
|
153
|
+
margin: {
|
|
337
154
|
top: 5,
|
|
338
155
|
right: 5,
|
|
339
156
|
left: -20,
|
|
340
157
|
bottom: 5
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
data,
|
|
348
|
-
margin: t1
|
|
349
|
-
};
|
|
350
|
-
$[1] = data;
|
|
351
|
-
$[2] = t2;
|
|
352
|
-
} else t2 = $[2];
|
|
353
|
-
const commonProps = t2;
|
|
354
|
-
let t3;
|
|
355
|
-
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
356
|
-
t3 = {
|
|
357
|
-
fontSize: 10,
|
|
358
|
-
fill: "var(--color-muted-foreground)"
|
|
359
|
-
};
|
|
360
|
-
$[3] = t3;
|
|
361
|
-
} else t3 = $[3];
|
|
362
|
-
const axisStyle = t3;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const axisStyle = {
|
|
161
|
+
fontSize: 10,
|
|
162
|
+
fill: "var(--color-muted-foreground)"
|
|
163
|
+
};
|
|
363
164
|
switch (type) {
|
|
364
|
-
case "line": {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
165
|
+
case "line": return /* @__PURE__ */ jsxs(LineChart, {
|
|
166
|
+
...commonProps,
|
|
167
|
+
children: [
|
|
168
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
368
169
|
strokeDasharray: "3 3",
|
|
369
170
|
stroke: "var(--color-border)",
|
|
370
171
|
opacity: .5
|
|
371
|
-
})
|
|
372
|
-
|
|
373
|
-
$[5] = t4;
|
|
374
|
-
} else t4 = $[5];
|
|
375
|
-
let t5;
|
|
376
|
-
let t6;
|
|
377
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
378
|
-
t5 = /* @__PURE__ */ jsx(XAxis, {
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
379
174
|
dataKey: "name",
|
|
380
175
|
tick: axisStyle,
|
|
381
176
|
tickLine: false,
|
|
382
177
|
axisLine: false
|
|
383
|
-
})
|
|
384
|
-
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
385
180
|
tick: axisStyle,
|
|
386
181
|
tickLine: false,
|
|
387
182
|
axisLine: false
|
|
388
|
-
})
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
} else {
|
|
392
|
-
t5 = $[6];
|
|
393
|
-
t6 = $[7];
|
|
394
|
-
}
|
|
395
|
-
let t7;
|
|
396
|
-
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
397
|
-
t7 = /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) });
|
|
398
|
-
$[8] = t7;
|
|
399
|
-
} else t7 = $[8];
|
|
400
|
-
let t8;
|
|
401
|
-
if ($[9] !== color) {
|
|
402
|
-
t8 = /* @__PURE__ */ jsx(Line, {
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) }),
|
|
185
|
+
/* @__PURE__ */ jsx(Line, {
|
|
403
186
|
type: "monotone",
|
|
404
187
|
dataKey: "value",
|
|
405
188
|
stroke: color,
|
|
406
189
|
strokeWidth: 2,
|
|
407
190
|
dot: false
|
|
408
|
-
})
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
...commonProps,
|
|
416
|
-
children: [
|
|
417
|
-
t4,
|
|
418
|
-
t5,
|
|
419
|
-
t6,
|
|
420
|
-
t7,
|
|
421
|
-
t8
|
|
422
|
-
]
|
|
423
|
-
});
|
|
424
|
-
$[11] = commonProps;
|
|
425
|
-
$[12] = t4;
|
|
426
|
-
$[13] = t8;
|
|
427
|
-
$[14] = t9;
|
|
428
|
-
} else t9 = $[14];
|
|
429
|
-
return t9;
|
|
430
|
-
}
|
|
431
|
-
case "bar": {
|
|
432
|
-
let t4;
|
|
433
|
-
if ($[15] !== showGrid) {
|
|
434
|
-
t4 = showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
case "bar": return /* @__PURE__ */ jsxs(BarChart, {
|
|
195
|
+
...commonProps,
|
|
196
|
+
children: [
|
|
197
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
435
198
|
strokeDasharray: "3 3",
|
|
436
199
|
stroke: "var(--color-border)",
|
|
437
200
|
opacity: .5
|
|
438
|
-
})
|
|
439
|
-
|
|
440
|
-
$[16] = t4;
|
|
441
|
-
} else t4 = $[16];
|
|
442
|
-
let t5;
|
|
443
|
-
let t6;
|
|
444
|
-
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
445
|
-
t5 = /* @__PURE__ */ jsx(XAxis, {
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
446
203
|
dataKey: "name",
|
|
447
204
|
tick: axisStyle,
|
|
448
205
|
tickLine: false,
|
|
449
206
|
axisLine: false
|
|
450
|
-
})
|
|
451
|
-
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
452
209
|
tick: axisStyle,
|
|
453
210
|
tickLine: false,
|
|
454
211
|
axisLine: false
|
|
455
|
-
})
|
|
456
|
-
|
|
457
|
-
$[18] = t6;
|
|
458
|
-
} else {
|
|
459
|
-
t5 = $[17];
|
|
460
|
-
t6 = $[18];
|
|
461
|
-
}
|
|
462
|
-
let t7;
|
|
463
|
-
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
464
|
-
t7 = /* @__PURE__ */ jsx(Tooltip, {
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
465
214
|
content: /* @__PURE__ */ jsx(ChartTooltip, {}),
|
|
466
215
|
cursor: {
|
|
467
216
|
fill: "var(--color-muted)",
|
|
468
217
|
opacity: .3
|
|
469
218
|
}
|
|
470
|
-
})
|
|
471
|
-
|
|
472
|
-
} else t7 = $[19];
|
|
473
|
-
let t8;
|
|
474
|
-
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
475
|
-
t8 = [
|
|
476
|
-
2,
|
|
477
|
-
2,
|
|
478
|
-
0,
|
|
479
|
-
0
|
|
480
|
-
];
|
|
481
|
-
$[20] = t8;
|
|
482
|
-
} else t8 = $[20];
|
|
483
|
-
let t9;
|
|
484
|
-
if ($[21] !== color) {
|
|
485
|
-
t9 = /* @__PURE__ */ jsx(Bar, {
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsx(Bar, {
|
|
486
221
|
dataKey: "value",
|
|
487
222
|
fill: color,
|
|
488
|
-
radius:
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
let t10;
|
|
494
|
-
if ($[23] !== commonProps || $[24] !== t4 || $[25] !== t9) {
|
|
495
|
-
t10 = /* @__PURE__ */ jsxs(BarChart, {
|
|
496
|
-
...commonProps,
|
|
497
|
-
children: [
|
|
498
|
-
t4,
|
|
499
|
-
t5,
|
|
500
|
-
t6,
|
|
501
|
-
t7,
|
|
502
|
-
t9
|
|
223
|
+
radius: [
|
|
224
|
+
2,
|
|
225
|
+
2,
|
|
226
|
+
0,
|
|
227
|
+
0
|
|
503
228
|
]
|
|
504
|
-
})
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
if ($[29] !== data || $[30] !== t4) {
|
|
521
|
-
t5 = /* @__PURE__ */ jsx(Pie, {
|
|
522
|
-
data,
|
|
523
|
-
dataKey: "value",
|
|
524
|
-
nameKey: "name",
|
|
525
|
-
cx: "50%",
|
|
526
|
-
cy: "50%",
|
|
527
|
-
outerRadius: 60,
|
|
528
|
-
label: _temp4,
|
|
529
|
-
labelLine: false,
|
|
530
|
-
stroke: "var(--color-background)",
|
|
531
|
-
strokeWidth: 2,
|
|
532
|
-
children: t4
|
|
533
|
-
});
|
|
534
|
-
$[29] = data;
|
|
535
|
-
$[30] = t4;
|
|
536
|
-
$[31] = t5;
|
|
537
|
-
} else t5 = $[31];
|
|
538
|
-
let t6;
|
|
539
|
-
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
540
|
-
t6 = /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) });
|
|
541
|
-
$[32] = t6;
|
|
542
|
-
} else t6 = $[32];
|
|
543
|
-
let t7;
|
|
544
|
-
if ($[33] !== t5) {
|
|
545
|
-
t7 = /* @__PURE__ */ jsxs(PieChart, { children: [t5, t6] });
|
|
546
|
-
$[33] = t5;
|
|
547
|
-
$[34] = t7;
|
|
548
|
-
} else t7 = $[34];
|
|
549
|
-
return t7;
|
|
550
|
-
}
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
});
|
|
232
|
+
case "pie": return /* @__PURE__ */ jsxs(PieChart, { children: [/* @__PURE__ */ jsx(Pie, {
|
|
233
|
+
data,
|
|
234
|
+
dataKey: "value",
|
|
235
|
+
nameKey: "name",
|
|
236
|
+
cx: "50%",
|
|
237
|
+
cy: "50%",
|
|
238
|
+
outerRadius: 60,
|
|
239
|
+
label: ({ name }) => name,
|
|
240
|
+
labelLine: false,
|
|
241
|
+
stroke: "var(--color-background)",
|
|
242
|
+
strokeWidth: 2,
|
|
243
|
+
children: data.map((entry) => /* @__PURE__ */ jsx(Cell, { fill: CHART_COLORS[data.indexOf(entry) % CHART_COLORS.length] }, `cell-${entry.name}`))
|
|
244
|
+
}), /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) })] });
|
|
551
245
|
case "area":
|
|
552
|
-
default: {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
246
|
+
default: return /* @__PURE__ */ jsxs(AreaChart, {
|
|
247
|
+
...commonProps,
|
|
248
|
+
children: [
|
|
249
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
556
250
|
strokeDasharray: "3 3",
|
|
557
251
|
stroke: "var(--color-border)",
|
|
558
252
|
opacity: .5
|
|
559
|
-
})
|
|
560
|
-
|
|
561
|
-
$[36] = t4;
|
|
562
|
-
} else t4 = $[36];
|
|
563
|
-
let t5;
|
|
564
|
-
let t6;
|
|
565
|
-
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
566
|
-
t5 = /* @__PURE__ */ jsx(XAxis, {
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
567
255
|
dataKey: "name",
|
|
568
256
|
tick: axisStyle,
|
|
569
257
|
tickLine: false,
|
|
570
258
|
axisLine: false
|
|
571
|
-
})
|
|
572
|
-
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
573
261
|
tick: axisStyle,
|
|
574
262
|
tickLine: false,
|
|
575
263
|
axisLine: false
|
|
576
|
-
})
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
} else {
|
|
580
|
-
t5 = $[37];
|
|
581
|
-
t6 = $[38];
|
|
582
|
-
}
|
|
583
|
-
let t7;
|
|
584
|
-
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
585
|
-
t7 = /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) });
|
|
586
|
-
$[39] = t7;
|
|
587
|
-
} else t7 = $[39];
|
|
588
|
-
let t8;
|
|
589
|
-
if ($[40] !== color) {
|
|
590
|
-
t8 = /* @__PURE__ */ jsx(Area, {
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(ChartTooltip, {}) }),
|
|
266
|
+
/* @__PURE__ */ jsx(Area, {
|
|
591
267
|
type: "monotone",
|
|
592
268
|
dataKey: "value",
|
|
593
269
|
stroke: color,
|
|
594
270
|
fill: color,
|
|
595
271
|
fillOpacity: .15
|
|
596
|
-
})
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
} else t8 = $[41];
|
|
600
|
-
let t9;
|
|
601
|
-
if ($[42] !== commonProps || $[43] !== t4 || $[44] !== t8) {
|
|
602
|
-
t9 = /* @__PURE__ */ jsxs(AreaChart, {
|
|
603
|
-
...commonProps,
|
|
604
|
-
children: [
|
|
605
|
-
t4,
|
|
606
|
-
t5,
|
|
607
|
-
t6,
|
|
608
|
-
t7,
|
|
609
|
-
t8
|
|
610
|
-
]
|
|
611
|
-
});
|
|
612
|
-
$[42] = commonProps;
|
|
613
|
-
$[43] = t4;
|
|
614
|
-
$[44] = t8;
|
|
615
|
-
$[45] = t9;
|
|
616
|
-
} else t9 = $[45];
|
|
617
|
-
return t9;
|
|
618
|
-
}
|
|
272
|
+
})
|
|
273
|
+
]
|
|
274
|
+
});
|
|
619
275
|
}
|
|
620
276
|
}
|
|
621
277
|
/**
|
|
622
278
|
* Format date based on time range for grouping
|
|
623
279
|
*/
|
|
624
|
-
function _temp4(t0) {
|
|
625
|
-
const { name } = t0;
|
|
626
|
-
return name;
|
|
627
|
-
}
|
|
628
280
|
function formatDateForRange(date, timeRange) {
|
|
629
281
|
const months = [
|
|
630
282
|
"Jan",
|