@questpie/admin 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +12 -9
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +251 -230
- package/dist/client/components/primitives/select-single.mjs +345 -290
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +134 -96
- package/dist/client/components/widgets/progress-widget.mjs +59 -34
- package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
- package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +159 -246
- package/dist/client/components/widgets/timeline-widget.mjs +66 -43
- package/dist/client/components/widgets/value-widget.mjs +261 -152
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +59 -40
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/auth-layout.d.mts +18 -11
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1162 -229
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +149 -172
- package/dist/client/views/layout/admin-router.mjs +747 -544
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +751 -591
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +3 -3
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +3 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +17 -1
- package/dist/server/i18n/messages/cs.mjs +23 -0
- package/dist/server/i18n/messages/de.mjs +23 -0
- package/dist/server/i18n/messages/en.mjs +64 -1
- package/dist/server/i18n/messages/es.mjs +23 -0
- package/dist/server/i18n/messages/fr.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +23 -0
- package/dist/server/i18n/messages/pt.mjs +23 -0
- package/dist/server/i18n/messages/sk.mjs +83 -1
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- 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 +64 -64
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +40 -28
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
- 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 +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +25 -25
- package/dist/server/modules/audit/.generated/module.d.mts +7 -7
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +39 -39
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- package/dist/client/views/layout/admin-topbar.mjs +0 -236
|
@@ -6,10 +6,11 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
|
|
6
6
|
import { Card, CardContent, CardHeader, CardTitle } from "../../components/ui/card.mjs";
|
|
7
7
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../../components/ui/accordion.mjs";
|
|
8
8
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../components/ui/tabs.mjs";
|
|
9
|
+
import { AdminViewHeader } from "../layout/admin-view-layout.mjs";
|
|
9
10
|
import { DashboardWidget } from "./dashboard-widget.mjs";
|
|
10
11
|
import { c } from "react/compiler-runtime";
|
|
11
12
|
import { Icon } from "@iconify/react";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
|
|
14
15
|
//#region src/client/views/dashboard/dashboard-grid.tsx
|
|
15
16
|
/**
|
|
@@ -25,34 +26,74 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
25
26
|
*/
|
|
26
27
|
/**
|
|
27
28
|
* Grid column classes for different column counts.
|
|
28
|
-
* Uses
|
|
29
|
+
* Uses fixed auto rows so cards align like tile-based mobile widgets.
|
|
29
30
|
*/
|
|
30
31
|
const gridClasses = {
|
|
31
32
|
1: "grid-cols-1",
|
|
32
|
-
2: "grid-cols-
|
|
33
|
-
3: "grid-cols-
|
|
34
|
-
4: "grid-cols-
|
|
35
|
-
5: "grid-cols-
|
|
36
|
-
6: "grid-cols-
|
|
37
|
-
|
|
33
|
+
2: "grid-cols-2",
|
|
34
|
+
3: "grid-cols-2 @md:grid-cols-3",
|
|
35
|
+
4: "grid-cols-2 @md:grid-cols-4",
|
|
36
|
+
5: "grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5",
|
|
37
|
+
6: "grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-6",
|
|
38
|
+
7: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-7",
|
|
39
|
+
8: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-8",
|
|
40
|
+
9: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-9",
|
|
41
|
+
10: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-10",
|
|
42
|
+
11: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-11",
|
|
43
|
+
12: "grid-cols-2 @xs:grid-cols-4 @md:grid-cols-6 @lg:grid-cols-12"
|
|
38
44
|
};
|
|
39
45
|
/**
|
|
40
46
|
* Span classes for widget column spanning.
|
|
41
47
|
*/
|
|
42
48
|
const spanClasses = {
|
|
43
49
|
1: "col-span-1",
|
|
44
|
-
2: "col-span-
|
|
45
|
-
3: "col-span-
|
|
46
|
-
4: "col-span-
|
|
47
|
-
5: "col-span-
|
|
48
|
-
6: "col-span-
|
|
50
|
+
2: "col-span-2",
|
|
51
|
+
3: "col-span-2 @md:col-span-3",
|
|
52
|
+
4: "col-span-2 @md:col-span-4",
|
|
53
|
+
5: "col-span-2 @md:col-span-4 @lg:col-span-5",
|
|
54
|
+
6: "col-span-2 @md:col-span-4 @lg:col-span-6",
|
|
55
|
+
7: "col-span-2 @xs:col-span-4 @md:col-span-6 @lg:col-span-7",
|
|
56
|
+
8: "col-span-2 @xs:col-span-4 @md:col-span-6 @lg:col-span-8",
|
|
57
|
+
9: "col-span-2 @xs:col-span-4 @md:col-span-6 @lg:col-span-9",
|
|
58
|
+
10: "col-span-2 @xs:col-span-4 @md:col-span-6 @lg:col-span-10",
|
|
59
|
+
11: "col-span-2 @xs:col-span-4 @md:col-span-6 @lg:col-span-11",
|
|
49
60
|
12: "col-span-full"
|
|
50
61
|
};
|
|
62
|
+
const DEFAULT_ROW_HEIGHT = "8.5rem";
|
|
63
|
+
const sizeLayoutDefaults = {
|
|
64
|
+
small: {
|
|
65
|
+
span: 1,
|
|
66
|
+
rowSpan: 1
|
|
67
|
+
},
|
|
68
|
+
medium: {
|
|
69
|
+
span: 2,
|
|
70
|
+
rowSpan: 1
|
|
71
|
+
},
|
|
72
|
+
large: {
|
|
73
|
+
span: 2,
|
|
74
|
+
rowSpan: 2
|
|
75
|
+
},
|
|
76
|
+
full: {
|
|
77
|
+
span: 12,
|
|
78
|
+
rowSpan: 2
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const widgetTypeRowDefaults = {
|
|
82
|
+
stats: 1,
|
|
83
|
+
value: 1,
|
|
84
|
+
progress: 1,
|
|
85
|
+
chart: 2,
|
|
86
|
+
quickActions: 2,
|
|
87
|
+
recentItems: 2,
|
|
88
|
+
table: 2,
|
|
89
|
+
timeline: 2,
|
|
90
|
+
custom: 2
|
|
91
|
+
};
|
|
51
92
|
/**
|
|
52
93
|
* Get grid columns class based on column count
|
|
53
94
|
*/
|
|
54
95
|
function getGridClass(columns) {
|
|
55
|
-
return gridClasses[columns] || gridClasses[4];
|
|
96
|
+
return gridClasses[Math.min(Math.max(columns, 1), 12)] || gridClasses[4];
|
|
56
97
|
}
|
|
57
98
|
/**
|
|
58
99
|
* Get column span class for a widget.
|
|
@@ -62,8 +103,35 @@ function getGridClass(columns) {
|
|
|
62
103
|
function getSpanClass(span) {
|
|
63
104
|
if (!span || span <= 1) return "col-span-1";
|
|
64
105
|
if (spanClasses[span]) return spanClasses[span];
|
|
65
|
-
|
|
66
|
-
|
|
106
|
+
return spanClasses[Math.min(Math.max(span, 1), 12)] ?? "col-span-full";
|
|
107
|
+
}
|
|
108
|
+
function normalizeRowHeight(rowHeight) {
|
|
109
|
+
if (typeof rowHeight === "number") return `${rowHeight}px`;
|
|
110
|
+
if (rowHeight) return rowHeight;
|
|
111
|
+
return DEFAULT_ROW_HEIGHT;
|
|
112
|
+
}
|
|
113
|
+
function getGridStyle(rowHeight, gap) {
|
|
114
|
+
return {
|
|
115
|
+
gridAutoRows: normalizeRowHeight(rowHeight),
|
|
116
|
+
...gap ? { gap: `${gap * .25}rem` } : {}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function getStackStyle(gap) {
|
|
120
|
+
return gap ? { gap: `${gap * .25}rem` } : void 0;
|
|
121
|
+
}
|
|
122
|
+
function getWidgetSpan(item) {
|
|
123
|
+
const position = item.position;
|
|
124
|
+
const sizeDefault = item.size ? sizeLayoutDefaults[item.size] : void 0;
|
|
125
|
+
return Math.min(Math.max(position?.w ?? item.span ?? sizeDefault?.span ?? 1, 1), 12);
|
|
126
|
+
}
|
|
127
|
+
function getWidgetRowSpan(item) {
|
|
128
|
+
const position = item.position;
|
|
129
|
+
const sizeDefault = item.size ? sizeLayoutDefaults[item.size] : void 0;
|
|
130
|
+
const rowSpan = position?.h ?? item.rowSpan ?? sizeDefault?.rowSpan ?? widgetTypeRowDefaults[item.type] ?? 2;
|
|
131
|
+
return Math.min(Math.max(rowSpan, 1), 8);
|
|
132
|
+
}
|
|
133
|
+
function getWidgetStyle(rowSpan) {
|
|
134
|
+
return { gridRowEnd: `span ${rowSpan}` };
|
|
67
135
|
}
|
|
68
136
|
/**
|
|
69
137
|
* Check if item is a widget config
|
|
@@ -88,12 +156,15 @@ function isTabsConfig(item) {
|
|
|
88
156
|
*/
|
|
89
157
|
function getLayoutItemKey(item, index) {
|
|
90
158
|
if (isWidgetConfig(item)) return `widget-${item.id || item.type}-${index}`;
|
|
91
|
-
if (isSectionConfig(item)) return `section-${index}`;
|
|
92
|
-
if (isTabsConfig(item))
|
|
159
|
+
if (isSectionConfig(item)) return `section-${item.id || index}`;
|
|
160
|
+
if (isTabsConfig(item)) {
|
|
161
|
+
const tabIds = item.tabs.map((t) => t.id).join("-");
|
|
162
|
+
return `tabs-${item.id || tabIds || index}`;
|
|
163
|
+
}
|
|
93
164
|
return `item-${index}`;
|
|
94
165
|
}
|
|
95
166
|
function DashboardHeader(t0) {
|
|
96
|
-
const $ = c(
|
|
167
|
+
const $ = c(18);
|
|
97
168
|
const { title, description, actions, navigate, resolveText } = t0;
|
|
98
169
|
if (!title && !description && !actions?.length) return null;
|
|
99
170
|
let t1;
|
|
@@ -106,187 +177,334 @@ function DashboardHeader(t0) {
|
|
|
106
177
|
$[1] = t1;
|
|
107
178
|
} else t1 = $[1];
|
|
108
179
|
const handleActionClick = t1;
|
|
180
|
+
let T0;
|
|
109
181
|
let t2;
|
|
182
|
+
let t3;
|
|
183
|
+
let t4;
|
|
184
|
+
let t5;
|
|
110
185
|
if ($[2] !== actions || $[3] !== description || $[4] !== handleActionClick || $[5] !== resolveText || $[6] !== title) {
|
|
111
186
|
const primaryAction = actions?.find(_temp) || actions?.[0];
|
|
112
187
|
const secondaryActions = actions?.filter((a_0) => a_0 !== primaryAction) || [];
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
children:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
secondaryActions.map((action_0) => {
|
|
152
|
-
const iconElement = resolveIconElement(action_0.icon, { "data-icon": "inline-start" });
|
|
153
|
-
const variant = action_0.variant || "default";
|
|
154
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
155
|
-
variant: variant === "primary" ? "default" : variant,
|
|
156
|
-
onClick: () => handleActionClick(action_0),
|
|
157
|
-
className: "hidden md:inline-flex",
|
|
158
|
-
children: [iconElement, resolveText(action_0.label)]
|
|
159
|
-
}, action_0.id);
|
|
160
|
-
}),
|
|
161
|
-
secondaryActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
162
|
-
variant: "outline",
|
|
163
|
-
size: "icon",
|
|
164
|
-
className: "md:hidden",
|
|
165
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
166
|
-
icon: "ph:dots-three-vertical",
|
|
167
|
-
className: "size-4"
|
|
168
|
-
})
|
|
169
|
-
}) }), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
170
|
-
align: "end",
|
|
171
|
-
children: secondaryActions.map((action_1) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
172
|
-
onClick: () => handleActionClick(action_1),
|
|
173
|
-
children: [resolveIconElement(action_1.icon, { className: "size-4 mr-2" }), resolveText(action_1.label)]
|
|
174
|
-
}, action_1.id))
|
|
175
|
-
})] })
|
|
176
|
-
]
|
|
177
|
-
})]
|
|
178
|
-
});
|
|
188
|
+
T0 = AdminViewHeader;
|
|
189
|
+
t2 = "qa-dashboard__header mb-4";
|
|
190
|
+
t3 = title;
|
|
191
|
+
t4 = description;
|
|
192
|
+
t5 = actions && actions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
193
|
+
primaryAction && /* @__PURE__ */ jsxs(Button, {
|
|
194
|
+
variant: primaryAction.variant === "primary" ? "default" : primaryAction.variant || "default",
|
|
195
|
+
size: "sm",
|
|
196
|
+
onClick: () => handleActionClick(primaryAction),
|
|
197
|
+
children: [resolveIconElement(primaryAction.icon, { "data-icon": "inline-start" }), resolveText(primaryAction.label)]
|
|
198
|
+
}, primaryAction.id),
|
|
199
|
+
secondaryActions.map((action_0) => {
|
|
200
|
+
const iconElement = resolveIconElement(action_0.icon, { "data-icon": "inline-start" });
|
|
201
|
+
const variant = action_0.variant || "default";
|
|
202
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
203
|
+
variant: variant === "primary" ? "default" : variant,
|
|
204
|
+
size: "sm",
|
|
205
|
+
onClick: () => handleActionClick(action_0),
|
|
206
|
+
className: "hidden md:inline-flex",
|
|
207
|
+
children: [iconElement, resolveText(action_0.label)]
|
|
208
|
+
}, action_0.id);
|
|
209
|
+
}),
|
|
210
|
+
secondaryActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
211
|
+
variant: "outline",
|
|
212
|
+
size: "icon-sm",
|
|
213
|
+
className: "md:hidden",
|
|
214
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
215
|
+
icon: "ph:dots-three-vertical",
|
|
216
|
+
className: "size-3.5"
|
|
217
|
+
})
|
|
218
|
+
}) }), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
219
|
+
align: "end",
|
|
220
|
+
children: secondaryActions.map((action_1) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
221
|
+
onClick: () => handleActionClick(action_1),
|
|
222
|
+
children: [resolveIconElement(action_1.icon, { className: "size-4 mr-2" }), resolveText(action_1.label)]
|
|
223
|
+
}, action_1.id))
|
|
224
|
+
})] })
|
|
225
|
+
] }) : void 0;
|
|
179
226
|
$[2] = actions;
|
|
180
227
|
$[3] = description;
|
|
181
228
|
$[4] = handleActionClick;
|
|
182
229
|
$[5] = resolveText;
|
|
183
230
|
$[6] = title;
|
|
184
|
-
$[7] =
|
|
185
|
-
|
|
186
|
-
|
|
231
|
+
$[7] = T0;
|
|
232
|
+
$[8] = t2;
|
|
233
|
+
$[9] = t3;
|
|
234
|
+
$[10] = t4;
|
|
235
|
+
$[11] = t5;
|
|
236
|
+
} else {
|
|
237
|
+
T0 = $[7];
|
|
238
|
+
t2 = $[8];
|
|
239
|
+
t3 = $[9];
|
|
240
|
+
t4 = $[10];
|
|
241
|
+
t5 = $[11];
|
|
242
|
+
}
|
|
243
|
+
let t6;
|
|
244
|
+
if ($[12] !== T0 || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
|
|
245
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
246
|
+
className: t2,
|
|
247
|
+
title: t3,
|
|
248
|
+
description: t4,
|
|
249
|
+
actions: t5
|
|
250
|
+
});
|
|
251
|
+
$[12] = T0;
|
|
252
|
+
$[13] = t2;
|
|
253
|
+
$[14] = t3;
|
|
254
|
+
$[15] = t4;
|
|
255
|
+
$[16] = t5;
|
|
256
|
+
$[17] = t6;
|
|
257
|
+
} else t6 = $[17];
|
|
258
|
+
return t6;
|
|
187
259
|
}
|
|
188
260
|
function _temp(a) {
|
|
189
261
|
return a.variant === "primary";
|
|
190
262
|
}
|
|
191
263
|
function LayoutItemRenderer(t0) {
|
|
192
|
-
const $ = c(
|
|
193
|
-
const { item, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
264
|
+
const $ = c(32);
|
|
265
|
+
const { item, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
194
266
|
if (isWidgetConfig(item)) {
|
|
195
267
|
let t1;
|
|
268
|
+
let t2;
|
|
196
269
|
let widgetConfig;
|
|
197
270
|
if ($[0] !== dashboardRealtime || $[1] !== item) {
|
|
198
|
-
const spanClass = getSpanClass(item
|
|
271
|
+
const spanClass = getSpanClass(getWidgetSpan(item));
|
|
272
|
+
const rowSpan = getWidgetRowSpan(item);
|
|
199
273
|
widgetConfig = dashboardRealtime !== void 0 && item.realtime === void 0 ? {
|
|
200
274
|
...item,
|
|
201
275
|
realtime: dashboardRealtime
|
|
202
276
|
} : item;
|
|
203
|
-
t1 = cn(spanClass, item.className);
|
|
277
|
+
t1 = cn("qa-dashboard__tile h-full min-h-0 min-w-0", spanClass, item.className);
|
|
278
|
+
t2 = getWidgetStyle(rowSpan);
|
|
204
279
|
$[0] = dashboardRealtime;
|
|
205
280
|
$[1] = item;
|
|
206
281
|
$[2] = t1;
|
|
207
|
-
$[3] =
|
|
282
|
+
$[3] = t2;
|
|
283
|
+
$[4] = widgetConfig;
|
|
208
284
|
} else {
|
|
209
285
|
t1 = $[2];
|
|
210
|
-
|
|
286
|
+
t2 = $[3];
|
|
287
|
+
widgetConfig = $[4];
|
|
211
288
|
}
|
|
212
|
-
let
|
|
213
|
-
if ($[
|
|
214
|
-
|
|
289
|
+
let t3;
|
|
290
|
+
if ($[5] !== basePath || $[6] !== navigate || $[7] !== widgetConfig || $[8] !== widgetRegistry) {
|
|
291
|
+
t3 = /* @__PURE__ */ jsx(DashboardWidget, {
|
|
215
292
|
config: widgetConfig,
|
|
216
293
|
basePath,
|
|
217
294
|
navigate,
|
|
218
295
|
widgetRegistry
|
|
219
296
|
});
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
} else
|
|
226
|
-
let
|
|
227
|
-
if ($[
|
|
228
|
-
|
|
297
|
+
$[5] = basePath;
|
|
298
|
+
$[6] = navigate;
|
|
299
|
+
$[7] = widgetConfig;
|
|
300
|
+
$[8] = widgetRegistry;
|
|
301
|
+
$[9] = t3;
|
|
302
|
+
} else t3 = $[9];
|
|
303
|
+
let t4;
|
|
304
|
+
if ($[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
|
|
305
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
229
306
|
className: t1,
|
|
230
|
-
|
|
307
|
+
style: t2,
|
|
308
|
+
children: t3
|
|
231
309
|
});
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
|
|
236
|
-
|
|
310
|
+
$[10] = t1;
|
|
311
|
+
$[11] = t2;
|
|
312
|
+
$[12] = t3;
|
|
313
|
+
$[13] = t4;
|
|
314
|
+
} else t4 = $[13];
|
|
315
|
+
return t4;
|
|
237
316
|
}
|
|
238
317
|
if (isSectionConfig(item)) {
|
|
239
318
|
let t1;
|
|
240
|
-
if ($[
|
|
319
|
+
if ($[14] !== basePath || $[15] !== dashboardRealtime || $[16] !== gap || $[17] !== item || $[18] !== navigate || $[19] !== resolveText || $[20] !== rowHeight || $[21] !== widgetRegistry) {
|
|
241
320
|
t1 = /* @__PURE__ */ jsx(SectionRenderer, {
|
|
242
321
|
section: item,
|
|
243
322
|
basePath,
|
|
244
323
|
navigate,
|
|
245
324
|
widgetRegistry,
|
|
246
325
|
resolveText,
|
|
247
|
-
dashboardRealtime
|
|
326
|
+
dashboardRealtime,
|
|
327
|
+
rowHeight,
|
|
328
|
+
gap
|
|
248
329
|
});
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
|
|
330
|
+
$[14] = basePath;
|
|
331
|
+
$[15] = dashboardRealtime;
|
|
332
|
+
$[16] = gap;
|
|
333
|
+
$[17] = item;
|
|
334
|
+
$[18] = navigate;
|
|
335
|
+
$[19] = resolveText;
|
|
336
|
+
$[20] = rowHeight;
|
|
337
|
+
$[21] = widgetRegistry;
|
|
338
|
+
$[22] = t1;
|
|
339
|
+
} else t1 = $[22];
|
|
257
340
|
return t1;
|
|
258
341
|
}
|
|
259
342
|
if (isTabsConfig(item)) {
|
|
260
343
|
let t1;
|
|
261
|
-
if ($[
|
|
344
|
+
if ($[23] !== basePath || $[24] !== dashboardRealtime || $[25] !== gap || $[26] !== item || $[27] !== navigate || $[28] !== resolveText || $[29] !== rowHeight || $[30] !== widgetRegistry) {
|
|
262
345
|
t1 = /* @__PURE__ */ jsx(TabsRenderer, {
|
|
263
346
|
tabs: item,
|
|
264
347
|
basePath,
|
|
265
348
|
navigate,
|
|
266
349
|
widgetRegistry,
|
|
267
350
|
resolveText,
|
|
268
|
-
dashboardRealtime
|
|
351
|
+
dashboardRealtime,
|
|
352
|
+
rowHeight,
|
|
353
|
+
gap
|
|
269
354
|
});
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
|
|
355
|
+
$[23] = basePath;
|
|
356
|
+
$[24] = dashboardRealtime;
|
|
357
|
+
$[25] = gap;
|
|
358
|
+
$[26] = item;
|
|
359
|
+
$[27] = navigate;
|
|
360
|
+
$[28] = resolveText;
|
|
361
|
+
$[29] = rowHeight;
|
|
362
|
+
$[30] = widgetRegistry;
|
|
363
|
+
$[31] = t1;
|
|
364
|
+
} else t1 = $[31];
|
|
278
365
|
return t1;
|
|
279
366
|
}
|
|
280
367
|
return null;
|
|
281
368
|
}
|
|
369
|
+
function WidgetGridGroup(t0) {
|
|
370
|
+
const $ = c(28);
|
|
371
|
+
const { items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
372
|
+
let t1;
|
|
373
|
+
if ($[0] !== columns) {
|
|
374
|
+
t1 = cn("@container grid items-stretch gap-4", getGridClass(columns));
|
|
375
|
+
$[0] = columns;
|
|
376
|
+
$[1] = t1;
|
|
377
|
+
} else t1 = $[1];
|
|
378
|
+
let t2;
|
|
379
|
+
if ($[2] !== gap || $[3] !== rowHeight) {
|
|
380
|
+
t2 = getGridStyle(rowHeight, gap);
|
|
381
|
+
$[2] = gap;
|
|
382
|
+
$[3] = rowHeight;
|
|
383
|
+
$[4] = t2;
|
|
384
|
+
} else t2 = $[4];
|
|
385
|
+
let t3;
|
|
386
|
+
if ($[5] !== basePath || $[6] !== columns || $[7] !== dashboardRealtime || $[8] !== gap || $[9] !== items || $[10] !== navigate || $[11] !== resolveText || $[12] !== rowHeight || $[13] !== widgetRegistry) {
|
|
387
|
+
let t4$1;
|
|
388
|
+
if ($[15] !== basePath || $[16] !== columns || $[17] !== dashboardRealtime || $[18] !== gap || $[19] !== navigate || $[20] !== resolveText || $[21] !== rowHeight || $[22] !== widgetRegistry) {
|
|
389
|
+
t4$1 = (item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
|
|
390
|
+
item,
|
|
391
|
+
index,
|
|
392
|
+
columns,
|
|
393
|
+
basePath,
|
|
394
|
+
navigate,
|
|
395
|
+
widgetRegistry,
|
|
396
|
+
resolveText,
|
|
397
|
+
dashboardRealtime,
|
|
398
|
+
rowHeight,
|
|
399
|
+
gap
|
|
400
|
+
}, getLayoutItemKey(item, index));
|
|
401
|
+
$[15] = basePath;
|
|
402
|
+
$[16] = columns;
|
|
403
|
+
$[17] = dashboardRealtime;
|
|
404
|
+
$[18] = gap;
|
|
405
|
+
$[19] = navigate;
|
|
406
|
+
$[20] = resolveText;
|
|
407
|
+
$[21] = rowHeight;
|
|
408
|
+
$[22] = widgetRegistry;
|
|
409
|
+
$[23] = t4$1;
|
|
410
|
+
} else t4$1 = $[23];
|
|
411
|
+
t3 = items.map(t4$1);
|
|
412
|
+
$[5] = basePath;
|
|
413
|
+
$[6] = columns;
|
|
414
|
+
$[7] = dashboardRealtime;
|
|
415
|
+
$[8] = gap;
|
|
416
|
+
$[9] = items;
|
|
417
|
+
$[10] = navigate;
|
|
418
|
+
$[11] = resolveText;
|
|
419
|
+
$[12] = rowHeight;
|
|
420
|
+
$[13] = widgetRegistry;
|
|
421
|
+
$[14] = t3;
|
|
422
|
+
} else t3 = $[14];
|
|
423
|
+
let t4;
|
|
424
|
+
if ($[24] !== t1 || $[25] !== t2 || $[26] !== t3) {
|
|
425
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
426
|
+
className: t1,
|
|
427
|
+
style: t2,
|
|
428
|
+
children: t3
|
|
429
|
+
});
|
|
430
|
+
$[24] = t1;
|
|
431
|
+
$[25] = t2;
|
|
432
|
+
$[26] = t3;
|
|
433
|
+
$[27] = t4;
|
|
434
|
+
} else t4 = $[27];
|
|
435
|
+
return t4;
|
|
436
|
+
}
|
|
437
|
+
function LayoutItemsRenderer(t0) {
|
|
438
|
+
const $ = c(10);
|
|
439
|
+
const { items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
440
|
+
let t1;
|
|
441
|
+
if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== gap || $[4] !== items || $[5] !== navigate || $[6] !== resolveText || $[7] !== rowHeight || $[8] !== widgetRegistry) {
|
|
442
|
+
const blocks = [];
|
|
443
|
+
let widgetGroup = [];
|
|
444
|
+
let widgetGroupStart = 0;
|
|
445
|
+
const flushWidgetGroup = () => {
|
|
446
|
+
if (widgetGroup.length === 0) return;
|
|
447
|
+
blocks.push(/* @__PURE__ */ jsx(WidgetGridGroup, {
|
|
448
|
+
items: widgetGroup,
|
|
449
|
+
columns,
|
|
450
|
+
rowHeight,
|
|
451
|
+
gap,
|
|
452
|
+
basePath,
|
|
453
|
+
navigate,
|
|
454
|
+
widgetRegistry,
|
|
455
|
+
resolveText,
|
|
456
|
+
dashboardRealtime
|
|
457
|
+
}, `widgets-${widgetGroupStart}`));
|
|
458
|
+
widgetGroup = [];
|
|
459
|
+
};
|
|
460
|
+
items.forEach((item, index) => {
|
|
461
|
+
if (isWidgetConfig(item)) {
|
|
462
|
+
if (widgetGroup.length === 0) widgetGroupStart = index;
|
|
463
|
+
widgetGroup.push(item);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
flushWidgetGroup();
|
|
467
|
+
blocks.push(/* @__PURE__ */ jsx(LayoutItemRenderer, {
|
|
468
|
+
item,
|
|
469
|
+
index,
|
|
470
|
+
columns,
|
|
471
|
+
basePath,
|
|
472
|
+
navigate,
|
|
473
|
+
widgetRegistry,
|
|
474
|
+
resolveText,
|
|
475
|
+
dashboardRealtime,
|
|
476
|
+
rowHeight,
|
|
477
|
+
gap
|
|
478
|
+
}, getLayoutItemKey(item, index)));
|
|
479
|
+
});
|
|
480
|
+
flushWidgetGroup();
|
|
481
|
+
t1 = /* @__PURE__ */ jsx("div", {
|
|
482
|
+
className: "qa-dashboard__stack flex flex-col gap-7",
|
|
483
|
+
children: blocks
|
|
484
|
+
});
|
|
485
|
+
$[0] = basePath;
|
|
486
|
+
$[1] = columns;
|
|
487
|
+
$[2] = dashboardRealtime;
|
|
488
|
+
$[3] = gap;
|
|
489
|
+
$[4] = items;
|
|
490
|
+
$[5] = navigate;
|
|
491
|
+
$[6] = resolveText;
|
|
492
|
+
$[7] = rowHeight;
|
|
493
|
+
$[8] = widgetRegistry;
|
|
494
|
+
$[9] = t1;
|
|
495
|
+
} else t1 = $[9];
|
|
496
|
+
return t1;
|
|
497
|
+
}
|
|
282
498
|
function SectionRenderer(t0) {
|
|
283
|
-
const $ = c(
|
|
284
|
-
const { section, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
285
|
-
const { label, description, wrapper: t1, defaultCollapsed: t2, layout: t3, columns: t4, gap, items, className } = section;
|
|
499
|
+
const $ = c(57);
|
|
500
|
+
const { section, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap } = t0;
|
|
501
|
+
const { label, description, wrapper: t1, defaultCollapsed: t2, layout: t3, columns: t4, gap: sectionGap, rowHeight: sectionRowHeight, items, className } = section;
|
|
286
502
|
const wrapper = t1 === void 0 ? "flat" : t1;
|
|
287
503
|
const defaultCollapsed = t2 === void 0 ? false : t2;
|
|
288
504
|
const layout = t3 === void 0 ? "grid" : t3;
|
|
289
505
|
const columns = t4 === void 0 ? 4 : t4;
|
|
506
|
+
const rowHeight = sectionRowHeight ?? inheritedRowHeight;
|
|
507
|
+
const gap = sectionGap ?? inheritedGap;
|
|
290
508
|
let t5;
|
|
291
509
|
if ($[0] !== label || $[1] !== resolveText) {
|
|
292
510
|
t5 = label ? resolveText(label) : void 0;
|
|
@@ -303,26 +521,22 @@ function SectionRenderer(t0) {
|
|
|
303
521
|
$[5] = t6;
|
|
304
522
|
} else t6 = $[5];
|
|
305
523
|
const sectionDescription = t6;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if ($[12] !== basePath || $[13] !== columns || $[14] !== dashboardRealtime || $[15] !== items || $[16] !== navigate || $[17] !== resolveText || $[18] !== widgetRegistry) {
|
|
323
|
-
let t11$1;
|
|
324
|
-
if ($[20] !== basePath || $[21] !== columns || $[22] !== dashboardRealtime || $[23] !== navigate || $[24] !== resolveText || $[25] !== widgetRegistry) {
|
|
325
|
-
t11$1 = (item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
|
|
524
|
+
let t7;
|
|
525
|
+
if ($[6] !== basePath || $[7] !== columns || $[8] !== dashboardRealtime || $[9] !== gap || $[10] !== items || $[11] !== layout || $[12] !== navigate || $[13] !== resolveText || $[14] !== rowHeight || $[15] !== widgetRegistry) {
|
|
526
|
+
t7 = layout === "grid" ? /* @__PURE__ */ jsx(LayoutItemsRenderer, {
|
|
527
|
+
items,
|
|
528
|
+
columns,
|
|
529
|
+
basePath,
|
|
530
|
+
navigate,
|
|
531
|
+
widgetRegistry,
|
|
532
|
+
resolveText,
|
|
533
|
+
dashboardRealtime,
|
|
534
|
+
rowHeight,
|
|
535
|
+
gap
|
|
536
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
537
|
+
className: "@container flex flex-col gap-4",
|
|
538
|
+
style: getStackStyle(gap),
|
|
539
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
|
|
326
540
|
item,
|
|
327
541
|
index,
|
|
328
542
|
columns,
|
|
@@ -330,324 +544,311 @@ function SectionRenderer(t0) {
|
|
|
330
544
|
navigate,
|
|
331
545
|
widgetRegistry,
|
|
332
546
|
resolveText,
|
|
333
|
-
dashboardRealtime
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
$[22] = dashboardRealtime;
|
|
338
|
-
$[23] = navigate;
|
|
339
|
-
$[24] = resolveText;
|
|
340
|
-
$[25] = widgetRegistry;
|
|
341
|
-
$[26] = t11$1;
|
|
342
|
-
} else t11$1 = $[26];
|
|
343
|
-
t10 = items.map(t11$1);
|
|
344
|
-
$[12] = basePath;
|
|
345
|
-
$[13] = columns;
|
|
346
|
-
$[14] = dashboardRealtime;
|
|
347
|
-
$[15] = items;
|
|
348
|
-
$[16] = navigate;
|
|
349
|
-
$[17] = resolveText;
|
|
350
|
-
$[18] = widgetRegistry;
|
|
351
|
-
$[19] = t10;
|
|
352
|
-
} else t10 = $[19];
|
|
353
|
-
let t11;
|
|
354
|
-
if ($[27] !== t10 || $[28] !== t8 || $[29] !== t9) {
|
|
355
|
-
t11 = /* @__PURE__ */ jsx("div", {
|
|
356
|
-
className: t8,
|
|
357
|
-
style: t9,
|
|
358
|
-
children: t10
|
|
547
|
+
dashboardRealtime,
|
|
548
|
+
rowHeight,
|
|
549
|
+
gap
|
|
550
|
+
}, getLayoutItemKey(item, index)))
|
|
359
551
|
});
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
|
|
365
|
-
|
|
552
|
+
$[6] = basePath;
|
|
553
|
+
$[7] = columns;
|
|
554
|
+
$[8] = dashboardRealtime;
|
|
555
|
+
$[9] = gap;
|
|
556
|
+
$[10] = items;
|
|
557
|
+
$[11] = layout;
|
|
558
|
+
$[12] = navigate;
|
|
559
|
+
$[13] = resolveText;
|
|
560
|
+
$[14] = rowHeight;
|
|
561
|
+
$[15] = widgetRegistry;
|
|
562
|
+
$[16] = t7;
|
|
563
|
+
} else t7 = $[16];
|
|
564
|
+
const itemsContent = t7;
|
|
366
565
|
if (wrapper === "flat") {
|
|
367
|
-
let
|
|
368
|
-
if ($[
|
|
369
|
-
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
} else
|
|
373
|
-
let
|
|
374
|
-
if ($[
|
|
375
|
-
|
|
566
|
+
let t8;
|
|
567
|
+
if ($[17] !== className) {
|
|
568
|
+
t8 = cn("min-w-0", className);
|
|
569
|
+
$[17] = className;
|
|
570
|
+
$[18] = t8;
|
|
571
|
+
} else t8 = $[18];
|
|
572
|
+
let t9;
|
|
573
|
+
if ($[19] !== sectionDescription || $[20] !== sectionLabel) {
|
|
574
|
+
t9 = (sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs("div", {
|
|
376
575
|
className: "mb-4",
|
|
377
576
|
children: [sectionLabel && /* @__PURE__ */ jsx("h2", {
|
|
378
|
-
className: "text-
|
|
577
|
+
className: "text-base font-semibold text-balance",
|
|
379
578
|
children: sectionLabel
|
|
380
579
|
}), sectionDescription && /* @__PURE__ */ jsx("p", {
|
|
381
|
-
className: "text-muted-foreground mt-1 text-sm",
|
|
580
|
+
className: "text-muted-foreground mt-1 text-sm text-pretty",
|
|
382
581
|
children: sectionDescription
|
|
383
582
|
})]
|
|
384
583
|
});
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
} else
|
|
389
|
-
let
|
|
390
|
-
if ($[
|
|
391
|
-
|
|
392
|
-
className:
|
|
393
|
-
children: [
|
|
584
|
+
$[19] = sectionDescription;
|
|
585
|
+
$[20] = sectionLabel;
|
|
586
|
+
$[21] = t9;
|
|
587
|
+
} else t9 = $[21];
|
|
588
|
+
let t10;
|
|
589
|
+
if ($[22] !== itemsContent || $[23] !== t8 || $[24] !== t9) {
|
|
590
|
+
t10 = /* @__PURE__ */ jsxs("section", {
|
|
591
|
+
className: t8,
|
|
592
|
+
children: [t9, itemsContent]
|
|
394
593
|
});
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else
|
|
400
|
-
return
|
|
594
|
+
$[22] = itemsContent;
|
|
595
|
+
$[23] = t8;
|
|
596
|
+
$[24] = t9;
|
|
597
|
+
$[25] = t10;
|
|
598
|
+
} else t10 = $[25];
|
|
599
|
+
return t10;
|
|
401
600
|
}
|
|
402
601
|
if (wrapper === "card") {
|
|
403
|
-
let
|
|
404
|
-
if ($[
|
|
405
|
-
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
} else
|
|
409
|
-
let
|
|
410
|
-
if ($[
|
|
411
|
-
|
|
602
|
+
let t8;
|
|
603
|
+
if ($[26] !== className) {
|
|
604
|
+
t8 = cn("min-w-0", className);
|
|
605
|
+
$[26] = className;
|
|
606
|
+
$[27] = t8;
|
|
607
|
+
} else t8 = $[27];
|
|
608
|
+
let t9;
|
|
609
|
+
if ($[28] !== sectionDescription || $[29] !== sectionLabel) {
|
|
610
|
+
t9 = (sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs(CardHeader, { children: [sectionLabel && /* @__PURE__ */ jsx(CardTitle, { children: sectionLabel }), sectionDescription && /* @__PURE__ */ jsx("p", {
|
|
412
611
|
className: "text-muted-foreground text-sm",
|
|
413
612
|
children: sectionDescription
|
|
414
613
|
})] });
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
} else
|
|
419
|
-
let
|
|
420
|
-
if ($[
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
} else t14 = $[46];
|
|
425
|
-
let t15;
|
|
426
|
-
if ($[47] !== t12 || $[48] !== t13 || $[49] !== t14) {
|
|
427
|
-
t15 = /* @__PURE__ */ jsxs(Card, {
|
|
428
|
-
className: t12,
|
|
429
|
-
children: [t13, t14]
|
|
614
|
+
$[28] = sectionDescription;
|
|
615
|
+
$[29] = sectionLabel;
|
|
616
|
+
$[30] = t9;
|
|
617
|
+
} else t9 = $[30];
|
|
618
|
+
let t10;
|
|
619
|
+
if ($[31] !== itemsContent) {
|
|
620
|
+
t10 = /* @__PURE__ */ jsx(CardContent, {
|
|
621
|
+
className: "min-w-0",
|
|
622
|
+
children: itemsContent
|
|
430
623
|
});
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
624
|
+
$[31] = itemsContent;
|
|
625
|
+
$[32] = t10;
|
|
626
|
+
} else t10 = $[32];
|
|
627
|
+
let t11;
|
|
628
|
+
if ($[33] !== t10 || $[34] !== t8 || $[35] !== t9) {
|
|
629
|
+
t11 = /* @__PURE__ */ jsxs(Card, {
|
|
630
|
+
className: t8,
|
|
631
|
+
children: [t9, t10]
|
|
632
|
+
});
|
|
633
|
+
$[33] = t10;
|
|
634
|
+
$[34] = t8;
|
|
635
|
+
$[35] = t9;
|
|
636
|
+
$[36] = t11;
|
|
637
|
+
} else t11 = $[36];
|
|
638
|
+
return t11;
|
|
437
639
|
}
|
|
438
640
|
if (wrapper === "collapsible") {
|
|
439
|
-
let
|
|
440
|
-
if ($[
|
|
441
|
-
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
} else
|
|
445
|
-
let
|
|
446
|
-
if ($[
|
|
447
|
-
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
} else
|
|
451
|
-
let
|
|
452
|
-
if ($[
|
|
453
|
-
|
|
641
|
+
let t8;
|
|
642
|
+
if ($[37] !== defaultCollapsed) {
|
|
643
|
+
t8 = defaultCollapsed ? [] : [0];
|
|
644
|
+
$[37] = defaultCollapsed;
|
|
645
|
+
$[38] = t8;
|
|
646
|
+
} else t8 = $[38];
|
|
647
|
+
let t9;
|
|
648
|
+
if ($[39] !== className) {
|
|
649
|
+
t9 = cn("min-w-0", className);
|
|
650
|
+
$[39] = className;
|
|
651
|
+
$[40] = t9;
|
|
652
|
+
} else t9 = $[40];
|
|
653
|
+
let t10;
|
|
654
|
+
if ($[41] !== sectionLabel) {
|
|
655
|
+
t10 = sectionLabel && /* @__PURE__ */ jsx("span", {
|
|
454
656
|
className: "text-lg font-semibold",
|
|
455
657
|
children: sectionLabel
|
|
456
658
|
});
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
} else
|
|
460
|
-
let
|
|
461
|
-
if ($[
|
|
462
|
-
|
|
659
|
+
$[41] = sectionLabel;
|
|
660
|
+
$[42] = t10;
|
|
661
|
+
} else t10 = $[42];
|
|
662
|
+
let t11;
|
|
663
|
+
if ($[43] !== sectionDescription) {
|
|
664
|
+
t11 = sectionDescription && /* @__PURE__ */ jsx("p", {
|
|
463
665
|
className: "text-muted-foreground text-sm font-normal",
|
|
464
666
|
children: sectionDescription
|
|
465
667
|
});
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
} else
|
|
469
|
-
let
|
|
470
|
-
if ($[
|
|
471
|
-
|
|
668
|
+
$[43] = sectionDescription;
|
|
669
|
+
$[44] = t11;
|
|
670
|
+
} else t11 = $[44];
|
|
671
|
+
let t12;
|
|
672
|
+
if ($[45] !== t10 || $[46] !== t11) {
|
|
673
|
+
t12 = /* @__PURE__ */ jsx(AccordionTrigger, {
|
|
472
674
|
className: "py-2 hover:no-underline",
|
|
473
675
|
children: /* @__PURE__ */ jsxs("div", {
|
|
474
676
|
className: "text-left",
|
|
475
|
-
children: [
|
|
677
|
+
children: [t10, t11]
|
|
476
678
|
})
|
|
477
679
|
});
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
} else
|
|
482
|
-
let
|
|
483
|
-
if ($[
|
|
484
|
-
|
|
680
|
+
$[45] = t10;
|
|
681
|
+
$[46] = t11;
|
|
682
|
+
$[47] = t12;
|
|
683
|
+
} else t12 = $[47];
|
|
684
|
+
let t13;
|
|
685
|
+
if ($[48] !== itemsContent) {
|
|
686
|
+
t13 = /* @__PURE__ */ jsx(AccordionContent, {
|
|
485
687
|
className: "pt-4",
|
|
486
688
|
children: itemsContent
|
|
487
689
|
});
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
} else
|
|
491
|
-
let
|
|
492
|
-
if ($[
|
|
493
|
-
|
|
690
|
+
$[48] = itemsContent;
|
|
691
|
+
$[49] = t13;
|
|
692
|
+
} else t13 = $[49];
|
|
693
|
+
let t14;
|
|
694
|
+
if ($[50] !== t12 || $[51] !== t13) {
|
|
695
|
+
t14 = /* @__PURE__ */ jsxs(AccordionItem, {
|
|
494
696
|
className: "border-none",
|
|
495
|
-
children: [
|
|
697
|
+
children: [t12, t13]
|
|
496
698
|
});
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
} else
|
|
501
|
-
let
|
|
502
|
-
if ($[
|
|
503
|
-
|
|
504
|
-
defaultValue:
|
|
505
|
-
className:
|
|
506
|
-
children:
|
|
699
|
+
$[50] = t12;
|
|
700
|
+
$[51] = t13;
|
|
701
|
+
$[52] = t14;
|
|
702
|
+
} else t14 = $[52];
|
|
703
|
+
let t15;
|
|
704
|
+
if ($[53] !== t14 || $[54] !== t8 || $[55] !== t9) {
|
|
705
|
+
t15 = /* @__PURE__ */ jsx(Accordion, {
|
|
706
|
+
defaultValue: t8,
|
|
707
|
+
className: t9,
|
|
708
|
+
children: t14
|
|
507
709
|
});
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
} else
|
|
513
|
-
return
|
|
710
|
+
$[53] = t14;
|
|
711
|
+
$[54] = t8;
|
|
712
|
+
$[55] = t9;
|
|
713
|
+
$[56] = t15;
|
|
714
|
+
} else t15 = $[56];
|
|
715
|
+
return t15;
|
|
514
716
|
}
|
|
515
717
|
return itemsContent;
|
|
516
718
|
}
|
|
517
719
|
function TabsRenderer(t0) {
|
|
518
|
-
const $ = c(
|
|
519
|
-
const { tabs, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
520
|
-
const
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
const t2 = variant === "line" ? "line" : "default";
|
|
720
|
+
const $ = c(26);
|
|
721
|
+
const { tabs, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, columns: t1, rowHeight, gap } = t0;
|
|
722
|
+
const columns = t1 === void 0 ? 4 : t1;
|
|
723
|
+
const { tabs: tabConfigs, defaultTab } = tabs;
|
|
724
|
+
let t2;
|
|
524
725
|
let t3;
|
|
525
|
-
if ($[0] !==
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
726
|
+
if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== defaultTab || $[4] !== gap || $[5] !== navigate || $[6] !== resolveText || $[7] !== rowHeight || $[8] !== tabConfigs || $[9] !== tabs.className || $[10] !== widgetRegistry) {
|
|
727
|
+
t3 = Symbol.for("react.early_return_sentinel");
|
|
728
|
+
bb0: {
|
|
729
|
+
const visibleTabs = tabConfigs.filter(_temp2);
|
|
730
|
+
if (visibleTabs.length === 0) {
|
|
731
|
+
t3 = null;
|
|
732
|
+
break bb0;
|
|
733
|
+
}
|
|
734
|
+
const defaultValue = visibleTabs.some((tab_0) => tab_0.id === defaultTab) ? defaultTab : visibleTabs[0]?.id;
|
|
735
|
+
let t4;
|
|
736
|
+
if ($[13] !== tabs.className) {
|
|
737
|
+
t4 = cn("min-w-0", tabs.className);
|
|
738
|
+
$[13] = tabs.className;
|
|
739
|
+
$[14] = t4;
|
|
740
|
+
} else t4 = $[14];
|
|
741
|
+
let t5;
|
|
742
|
+
if ($[15] !== resolveText) {
|
|
743
|
+
t5 = (tab_1) => /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
744
|
+
value: tab_1.id,
|
|
745
|
+
className: "flex-1",
|
|
746
|
+
children: [
|
|
747
|
+
resolveIconElement(tab_1.icon, { className: "size-3.5" }),
|
|
748
|
+
resolveText(tab_1.label),
|
|
749
|
+
tab_1.badge !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
750
|
+
className: "bg-foreground text-background ml-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums",
|
|
751
|
+
children: tab_1.badge
|
|
752
|
+
})
|
|
753
|
+
]
|
|
754
|
+
}, tab_1.id);
|
|
755
|
+
$[15] = resolveText;
|
|
756
|
+
$[16] = t5;
|
|
757
|
+
} else t5 = $[16];
|
|
758
|
+
let t6;
|
|
759
|
+
if ($[17] !== basePath || $[18] !== columns || $[19] !== dashboardRealtime || $[20] !== gap || $[21] !== navigate || $[22] !== resolveText || $[23] !== rowHeight || $[24] !== widgetRegistry) {
|
|
760
|
+
t6 = (tab_2) => /* @__PURE__ */ jsx(TabsContent, {
|
|
761
|
+
value: tab_2.id,
|
|
762
|
+
className: "min-w-0",
|
|
763
|
+
children: /* @__PURE__ */ jsx(TabContentRenderer, {
|
|
764
|
+
tab: tab_2,
|
|
765
|
+
columns,
|
|
766
|
+
basePath,
|
|
767
|
+
navigate,
|
|
768
|
+
widgetRegistry,
|
|
769
|
+
resolveText,
|
|
770
|
+
dashboardRealtime,
|
|
771
|
+
rowHeight,
|
|
772
|
+
gap
|
|
536
773
|
})
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
$[9] = dashboardRealtime;
|
|
583
|
-
$[10] = navigate;
|
|
584
|
-
$[11] = resolveText;
|
|
585
|
-
$[12] = tabConfigs;
|
|
586
|
-
$[13] = widgetRegistry;
|
|
587
|
-
$[14] = t5;
|
|
588
|
-
} else t5 = $[14];
|
|
589
|
-
let t6;
|
|
590
|
-
if ($[21] !== defaultValue || $[22] !== t4 || $[23] !== t5) {
|
|
591
|
-
t6 = /* @__PURE__ */ jsxs(Tabs, {
|
|
592
|
-
defaultValue,
|
|
593
|
-
className: "col-span-full",
|
|
594
|
-
children: [t4, t5]
|
|
595
|
-
});
|
|
596
|
-
$[21] = defaultValue;
|
|
597
|
-
$[22] = t4;
|
|
598
|
-
$[23] = t5;
|
|
599
|
-
$[24] = t6;
|
|
600
|
-
} else t6 = $[24];
|
|
601
|
-
return t6;
|
|
774
|
+
}, tab_2.id);
|
|
775
|
+
$[17] = basePath;
|
|
776
|
+
$[18] = columns;
|
|
777
|
+
$[19] = dashboardRealtime;
|
|
778
|
+
$[20] = gap;
|
|
779
|
+
$[21] = navigate;
|
|
780
|
+
$[22] = resolveText;
|
|
781
|
+
$[23] = rowHeight;
|
|
782
|
+
$[24] = widgetRegistry;
|
|
783
|
+
$[25] = t6;
|
|
784
|
+
} else t6 = $[25];
|
|
785
|
+
t2 = /* @__PURE__ */ jsxs(Tabs, {
|
|
786
|
+
defaultValue,
|
|
787
|
+
className: t4,
|
|
788
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
789
|
+
className: "mb-4 max-w-full overflow-x-auto",
|
|
790
|
+
children: /* @__PURE__ */ jsx(TabsList, {
|
|
791
|
+
className: "w-full min-w-max",
|
|
792
|
+
children: visibleTabs.map(t5)
|
|
793
|
+
})
|
|
794
|
+
}), visibleTabs.map(t6)]
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
$[0] = basePath;
|
|
798
|
+
$[1] = columns;
|
|
799
|
+
$[2] = dashboardRealtime;
|
|
800
|
+
$[3] = defaultTab;
|
|
801
|
+
$[4] = gap;
|
|
802
|
+
$[5] = navigate;
|
|
803
|
+
$[6] = resolveText;
|
|
804
|
+
$[7] = rowHeight;
|
|
805
|
+
$[8] = tabConfigs;
|
|
806
|
+
$[9] = tabs.className;
|
|
807
|
+
$[10] = widgetRegistry;
|
|
808
|
+
$[11] = t2;
|
|
809
|
+
$[12] = t3;
|
|
810
|
+
} else {
|
|
811
|
+
t2 = $[11];
|
|
812
|
+
t3 = $[12];
|
|
813
|
+
}
|
|
814
|
+
if (t3 !== Symbol.for("react.early_return_sentinel")) return t3;
|
|
815
|
+
return t2;
|
|
816
|
+
}
|
|
817
|
+
function _temp2(tab) {
|
|
818
|
+
return tab.items.length > 0;
|
|
602
819
|
}
|
|
603
820
|
function TabContentRenderer(t0) {
|
|
604
|
-
const $ = c(
|
|
605
|
-
const { tab, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
} else t1 = $[0];
|
|
821
|
+
const $ = c(10);
|
|
822
|
+
const { tab, columns: t1, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap } = t0;
|
|
823
|
+
const inheritedColumns = t1 === void 0 ? 4 : t1;
|
|
824
|
+
const columns = tab.columns ?? inheritedColumns;
|
|
825
|
+
const rowHeight = tab.rowHeight ?? inheritedRowHeight;
|
|
826
|
+
const gap = tab.gap ?? inheritedGap;
|
|
611
827
|
let t2;
|
|
612
|
-
if ($[
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
dashboardRealtime
|
|
624
|
-
}, getLayoutItemKey(item, index));
|
|
625
|
-
$[8] = basePath;
|
|
626
|
-
$[9] = dashboardRealtime;
|
|
627
|
-
$[10] = navigate;
|
|
628
|
-
$[11] = resolveText;
|
|
629
|
-
$[12] = widgetRegistry;
|
|
630
|
-
$[13] = t3$1;
|
|
631
|
-
} else t3$1 = $[13];
|
|
632
|
-
t2 = tab.items.map(t3$1);
|
|
633
|
-
$[1] = basePath;
|
|
634
|
-
$[2] = dashboardRealtime;
|
|
635
|
-
$[3] = navigate;
|
|
636
|
-
$[4] = resolveText;
|
|
637
|
-
$[5] = tab.items;
|
|
638
|
-
$[6] = widgetRegistry;
|
|
639
|
-
$[7] = t2;
|
|
640
|
-
} else t2 = $[7];
|
|
641
|
-
let t3;
|
|
642
|
-
if ($[14] !== t2) {
|
|
643
|
-
t3 = /* @__PURE__ */ jsx("div", {
|
|
644
|
-
className: t1,
|
|
645
|
-
children: t2
|
|
828
|
+
if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== gap || $[4] !== navigate || $[5] !== resolveText || $[6] !== rowHeight || $[7] !== tab.items || $[8] !== widgetRegistry) {
|
|
829
|
+
t2 = /* @__PURE__ */ jsx(LayoutItemsRenderer, {
|
|
830
|
+
items: tab.items,
|
|
831
|
+
columns,
|
|
832
|
+
basePath,
|
|
833
|
+
navigate,
|
|
834
|
+
widgetRegistry,
|
|
835
|
+
resolveText,
|
|
836
|
+
dashboardRealtime,
|
|
837
|
+
rowHeight,
|
|
838
|
+
gap
|
|
646
839
|
});
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
|
|
650
|
-
|
|
840
|
+
$[0] = basePath;
|
|
841
|
+
$[1] = columns;
|
|
842
|
+
$[2] = dashboardRealtime;
|
|
843
|
+
$[3] = gap;
|
|
844
|
+
$[4] = navigate;
|
|
845
|
+
$[5] = resolveText;
|
|
846
|
+
$[6] = rowHeight;
|
|
847
|
+
$[7] = tab.items;
|
|
848
|
+
$[8] = widgetRegistry;
|
|
849
|
+
$[9] = t2;
|
|
850
|
+
} else t2 = $[9];
|
|
851
|
+
return t2;
|
|
651
852
|
}
|
|
652
853
|
/**
|
|
653
854
|
* DashboardGrid - Renders a configurable grid of dashboard widgets
|
|
@@ -683,12 +884,12 @@ function TabContentRenderer(t0) {
|
|
|
683
884
|
* ```
|
|
684
885
|
*/
|
|
685
886
|
function DashboardGrid(t0) {
|
|
686
|
-
const $ = c(
|
|
887
|
+
const $ = c(54);
|
|
687
888
|
const { config, basePath: t1, navigate, widgetRegistry, className } = t0;
|
|
688
889
|
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
689
890
|
const resolveText = useResolveText();
|
|
690
891
|
const { t } = useTranslation();
|
|
691
|
-
const { title, description, columns: t2, realtime: dashboardRealtime } = config;
|
|
892
|
+
const { title, description, columns: t2, rowHeight, gap, realtime: dashboardRealtime } = config;
|
|
692
893
|
const columns = t2 === void 0 ? 4 : t2;
|
|
693
894
|
let t3;
|
|
694
895
|
if ($[0] !== config.items || $[1] !== config.widgets) {
|
|
@@ -752,31 +953,31 @@ function DashboardGrid(t0) {
|
|
|
752
953
|
$[19] = t8$1;
|
|
753
954
|
$[20] = t9$1;
|
|
754
955
|
} else t9$1 = $[20];
|
|
755
|
-
let t10
|
|
956
|
+
let t10;
|
|
756
957
|
if ($[21] !== t) {
|
|
757
|
-
t10
|
|
958
|
+
t10 = t("dashboard.noWidgetsDescription");
|
|
758
959
|
$[21] = t;
|
|
759
|
-
$[22] = t10
|
|
760
|
-
} else t10
|
|
761
|
-
let t11
|
|
762
|
-
if ($[23] !== t10
|
|
763
|
-
t11
|
|
960
|
+
$[22] = t10;
|
|
961
|
+
} else t10 = $[22];
|
|
962
|
+
let t11;
|
|
963
|
+
if ($[23] !== t10) {
|
|
964
|
+
t11 = /* @__PURE__ */ jsx("p", {
|
|
764
965
|
className: "text-muted-foreground mt-1 text-sm",
|
|
765
|
-
children: t10
|
|
966
|
+
children: t10
|
|
766
967
|
});
|
|
767
|
-
$[23] = t10
|
|
768
|
-
$[24] = t11
|
|
769
|
-
} else t11
|
|
968
|
+
$[23] = t10;
|
|
969
|
+
$[24] = t11;
|
|
970
|
+
} else t11 = $[24];
|
|
770
971
|
let t12;
|
|
771
|
-
if ($[25] !== t11
|
|
972
|
+
if ($[25] !== t11 || $[26] !== t9$1) {
|
|
772
973
|
t12 = /* @__PURE__ */ jsx("div", {
|
|
773
|
-
className: "
|
|
974
|
+
className: "flex h-48 items-center justify-center",
|
|
774
975
|
children: /* @__PURE__ */ jsxs("div", {
|
|
775
976
|
className: "text-center",
|
|
776
|
-
children: [t9$1, t11
|
|
977
|
+
children: [t9$1, t11]
|
|
777
978
|
})
|
|
778
979
|
});
|
|
779
|
-
$[25] = t11
|
|
980
|
+
$[25] = t11;
|
|
780
981
|
$[26] = t9$1;
|
|
781
982
|
$[27] = t12;
|
|
782
983
|
} else t12 = $[27];
|
|
@@ -816,65 +1017,41 @@ function DashboardGrid(t0) {
|
|
|
816
1017
|
$[39] = t7;
|
|
817
1018
|
} else t7 = $[39];
|
|
818
1019
|
let t8;
|
|
819
|
-
if ($[40] !== columns) {
|
|
820
|
-
t8 =
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
index,
|
|
831
|
-
columns,
|
|
832
|
-
basePath,
|
|
833
|
-
navigate,
|
|
834
|
-
widgetRegistry,
|
|
835
|
-
resolveText,
|
|
836
|
-
dashboardRealtime
|
|
837
|
-
}, getLayoutItemKey(item, index));
|
|
838
|
-
$[50] = basePath;
|
|
839
|
-
$[51] = columns;
|
|
840
|
-
$[52] = dashboardRealtime;
|
|
841
|
-
$[53] = navigate;
|
|
842
|
-
$[54] = resolveText;
|
|
843
|
-
$[55] = widgetRegistry;
|
|
844
|
-
$[56] = t10$1;
|
|
845
|
-
} else t10$1 = $[56];
|
|
846
|
-
t9 = layoutItems.map(t10$1);
|
|
847
|
-
$[42] = basePath;
|
|
848
|
-
$[43] = columns;
|
|
849
|
-
$[44] = dashboardRealtime;
|
|
850
|
-
$[45] = layoutItems;
|
|
851
|
-
$[46] = navigate;
|
|
852
|
-
$[47] = resolveText;
|
|
853
|
-
$[48] = widgetRegistry;
|
|
854
|
-
$[49] = t9;
|
|
855
|
-
} else t9 = $[49];
|
|
856
|
-
let t10;
|
|
857
|
-
if ($[57] !== t8 || $[58] !== t9) {
|
|
858
|
-
t10 = /* @__PURE__ */ jsx("div", {
|
|
859
|
-
className: t8,
|
|
860
|
-
children: t9
|
|
1020
|
+
if ($[40] !== basePath || $[41] !== columns || $[42] !== dashboardRealtime || $[43] !== gap || $[44] !== layoutItems || $[45] !== navigate || $[46] !== resolveText || $[47] !== rowHeight || $[48] !== widgetRegistry) {
|
|
1021
|
+
t8 = /* @__PURE__ */ jsx(LayoutItemsRenderer, {
|
|
1022
|
+
items: layoutItems,
|
|
1023
|
+
columns,
|
|
1024
|
+
rowHeight,
|
|
1025
|
+
gap,
|
|
1026
|
+
basePath,
|
|
1027
|
+
navigate,
|
|
1028
|
+
widgetRegistry,
|
|
1029
|
+
resolveText,
|
|
1030
|
+
dashboardRealtime
|
|
861
1031
|
});
|
|
862
|
-
$[
|
|
863
|
-
$[
|
|
864
|
-
$[
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
1032
|
+
$[40] = basePath;
|
|
1033
|
+
$[41] = columns;
|
|
1034
|
+
$[42] = dashboardRealtime;
|
|
1035
|
+
$[43] = gap;
|
|
1036
|
+
$[44] = layoutItems;
|
|
1037
|
+
$[45] = navigate;
|
|
1038
|
+
$[46] = resolveText;
|
|
1039
|
+
$[47] = rowHeight;
|
|
1040
|
+
$[48] = widgetRegistry;
|
|
1041
|
+
$[49] = t8;
|
|
1042
|
+
} else t8 = $[49];
|
|
1043
|
+
let t9;
|
|
1044
|
+
if ($[50] !== t6 || $[51] !== t7 || $[52] !== t8) {
|
|
1045
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
869
1046
|
className: t6,
|
|
870
|
-
children: [t7,
|
|
1047
|
+
children: [t7, t8]
|
|
871
1048
|
});
|
|
872
|
-
$[
|
|
873
|
-
$[
|
|
874
|
-
$[
|
|
875
|
-
$[
|
|
876
|
-
} else
|
|
877
|
-
return
|
|
1049
|
+
$[50] = t6;
|
|
1050
|
+
$[51] = t7;
|
|
1051
|
+
$[52] = t8;
|
|
1052
|
+
$[53] = t9;
|
|
1053
|
+
} else t9 = $[53];
|
|
1054
|
+
return t9;
|
|
878
1055
|
}
|
|
879
1056
|
|
|
880
1057
|
//#endregion
|