@questpie/admin 3.0.3 → 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 +1 -1
- 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 +68 -68
- 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 +12 -0
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +2 -2
- 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 +27 -27
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- 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
|
@@ -4,6 +4,7 @@ import { selectClient, useAdminStore } from "../../runtime/provider.mjs";
|
|
|
4
4
|
import { resolveIconElement } from "../component-renderer.mjs";
|
|
5
5
|
import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
|
|
6
6
|
import { useServerWidgetData } from "../../hooks/use-server-widget-data.mjs";
|
|
7
|
+
import { WidgetEmptyState } from "./widget-empty-state.mjs";
|
|
7
8
|
import { ValueWidgetSkeleton } from "./widget-skeletons.mjs";
|
|
8
9
|
import { c } from "react/compiler-runtime";
|
|
9
10
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -44,7 +45,7 @@ function formatValue(value) {
|
|
|
44
45
|
* ```
|
|
45
46
|
*/
|
|
46
47
|
function ValueWidget(t0) {
|
|
47
|
-
const $ = c(
|
|
48
|
+
const $ = c(130);
|
|
48
49
|
const { config } = t0;
|
|
49
50
|
const client = useAdminStore(selectClient);
|
|
50
51
|
const resolveText = useResolveText();
|
|
@@ -95,7 +96,7 @@ function ValueWidget(t0) {
|
|
|
95
96
|
const clientQuery = useQuery(t5);
|
|
96
97
|
const { data, isLoading, error, refetch, isFetching } = useServerData ? serverQuery : clientQuery;
|
|
97
98
|
const isFeatured = config.cardVariant === "featured";
|
|
98
|
-
if (isLoading || error
|
|
99
|
+
if (isLoading || error) {
|
|
99
100
|
let t6$1;
|
|
100
101
|
if ($[13] !== config.title || $[14] !== resolveText) {
|
|
101
102
|
t6$1 = config.title ? resolveText(config.title) : void 0;
|
|
@@ -104,44 +105,123 @@ function ValueWidget(t0) {
|
|
|
104
105
|
$[15] = t6$1;
|
|
105
106
|
} else t6$1 = $[15];
|
|
106
107
|
let t7$1;
|
|
107
|
-
if ($[16] !==
|
|
108
|
-
t7$1 =
|
|
109
|
-
$[16] =
|
|
110
|
-
$[17] =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
$
|
|
118
|
-
$[
|
|
119
|
-
|
|
108
|
+
if ($[16] !== config.description || $[17] !== resolveText) {
|
|
109
|
+
t7$1 = config.description ? resolveText(config.description) : void 0;
|
|
110
|
+
$[16] = config.description;
|
|
111
|
+
$[17] = resolveText;
|
|
112
|
+
$[18] = t7$1;
|
|
113
|
+
} else t7$1 = $[18];
|
|
114
|
+
const t8$1 = config.icon;
|
|
115
|
+
const t9$1 = config.cardVariant;
|
|
116
|
+
let t10$1;
|
|
117
|
+
if ($[19] !== isFeatured) {
|
|
118
|
+
t10$1 = /* @__PURE__ */ jsx(ValueWidgetSkeleton, { featured: isFeatured });
|
|
119
|
+
$[19] = isFeatured;
|
|
120
|
+
$[20] = t10$1;
|
|
121
|
+
} else t10$1 = $[20];
|
|
122
|
+
let t11$1;
|
|
123
|
+
if ($[21] !== error) {
|
|
124
|
+
t11$1 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
125
|
+
$[21] = error;
|
|
126
|
+
$[22] = t11$1;
|
|
127
|
+
} else t11$1 = $[22];
|
|
128
|
+
let t12$1;
|
|
129
|
+
if ($[23] !== refetch) {
|
|
130
|
+
t12$1 = () => refetch();
|
|
131
|
+
$[23] = refetch;
|
|
132
|
+
$[24] = t12$1;
|
|
133
|
+
} else t12$1 = $[24];
|
|
134
|
+
const t13$1 = config.actions;
|
|
135
|
+
const t14$1 = data?.classNames?.root;
|
|
136
|
+
let t15$1;
|
|
137
|
+
if ($[25] !== config.className || $[26] !== t14$1) {
|
|
138
|
+
t15$1 = cn(config.className, t14$1);
|
|
139
|
+
$[25] = config.className;
|
|
140
|
+
$[26] = t14$1;
|
|
141
|
+
$[27] = t15$1;
|
|
142
|
+
} else t15$1 = $[27];
|
|
143
|
+
let t16$1;
|
|
144
|
+
if ($[28] !== config.actions || $[29] !== config.cardVariant || $[30] !== config.icon || $[31] !== isLoading || $[32] !== t10$1 || $[33] !== t11$1 || $[34] !== t12$1 || $[35] !== t15$1 || $[36] !== t6$1 || $[37] !== t7$1) {
|
|
145
|
+
t16$1 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
146
|
+
title: t6$1,
|
|
147
|
+
description: t7$1,
|
|
148
|
+
icon: t8$1,
|
|
149
|
+
variant: t9$1,
|
|
150
|
+
isLoading,
|
|
151
|
+
loadingSkeleton: t10$1,
|
|
152
|
+
error: t11$1,
|
|
153
|
+
onRefresh: t12$1,
|
|
154
|
+
actions: t13$1,
|
|
155
|
+
className: t15$1
|
|
156
|
+
});
|
|
157
|
+
$[28] = config.actions;
|
|
158
|
+
$[29] = config.cardVariant;
|
|
159
|
+
$[30] = config.icon;
|
|
160
|
+
$[31] = isLoading;
|
|
161
|
+
$[32] = t10$1;
|
|
162
|
+
$[33] = t11$1;
|
|
163
|
+
$[34] = t12$1;
|
|
164
|
+
$[35] = t15$1;
|
|
165
|
+
$[36] = t6$1;
|
|
166
|
+
$[37] = t7$1;
|
|
167
|
+
$[38] = t16$1;
|
|
168
|
+
} else t16$1 = $[38];
|
|
169
|
+
return t16$1;
|
|
170
|
+
}
|
|
171
|
+
if (!data) {
|
|
172
|
+
let t6$1;
|
|
173
|
+
if ($[39] !== config.title || $[40] !== resolveText) {
|
|
174
|
+
t6$1 = config.title ? resolveText(config.title) : void 0;
|
|
175
|
+
$[39] = config.title;
|
|
176
|
+
$[40] = resolveText;
|
|
177
|
+
$[41] = t6$1;
|
|
178
|
+
} else t6$1 = $[41];
|
|
179
|
+
let t7$1;
|
|
180
|
+
if ($[42] !== config.description || $[43] !== resolveText) {
|
|
181
|
+
t7$1 = config.description ? resolveText(config.description) : void 0;
|
|
182
|
+
$[42] = config.description;
|
|
183
|
+
$[43] = resolveText;
|
|
184
|
+
$[44] = t7$1;
|
|
185
|
+
} else t7$1 = $[44];
|
|
186
|
+
const t8$1 = isFetching && !isLoading;
|
|
120
187
|
let t9$1;
|
|
121
|
-
if ($[
|
|
188
|
+
if ($[45] !== refetch) {
|
|
122
189
|
t9$1 = () => refetch();
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else t9$1 = $[
|
|
126
|
-
|
|
190
|
+
$[45] = refetch;
|
|
191
|
+
$[46] = t9$1;
|
|
192
|
+
} else t9$1 = $[46];
|
|
193
|
+
let t10$1;
|
|
194
|
+
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
195
|
+
t10$1 = /* @__PURE__ */ jsx(WidgetEmptyState, {
|
|
196
|
+
iconName: "ph:gauge",
|
|
197
|
+
title: "No value to display",
|
|
198
|
+
description: "There is no value for this card yet."
|
|
199
|
+
});
|
|
200
|
+
$[47] = t10$1;
|
|
201
|
+
} else t10$1 = $[47];
|
|
127
202
|
let t11$1;
|
|
128
|
-
if ($[
|
|
203
|
+
if ($[48] !== config.actions || $[49] !== config.cardVariant || $[50] !== config.className || $[51] !== config.icon || $[52] !== t6$1 || $[53] !== t7$1 || $[54] !== t8$1 || $[55] !== t9$1) {
|
|
129
204
|
t11$1 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
130
205
|
title: t6$1,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
206
|
+
description: t7$1,
|
|
207
|
+
icon: config.icon,
|
|
208
|
+
variant: config.cardVariant,
|
|
209
|
+
isRefreshing: t8$1,
|
|
134
210
|
onRefresh: t9$1,
|
|
135
|
-
|
|
211
|
+
actions: config.actions,
|
|
212
|
+
className: config.className,
|
|
213
|
+
children: t10$1
|
|
136
214
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
|
|
215
|
+
$[48] = config.actions;
|
|
216
|
+
$[49] = config.cardVariant;
|
|
217
|
+
$[50] = config.className;
|
|
218
|
+
$[51] = config.icon;
|
|
219
|
+
$[52] = t6$1;
|
|
220
|
+
$[53] = t7$1;
|
|
221
|
+
$[54] = t8$1;
|
|
222
|
+
$[55] = t9$1;
|
|
223
|
+
$[56] = t11$1;
|
|
224
|
+
} else t11$1 = $[56];
|
|
145
225
|
return t11$1;
|
|
146
226
|
}
|
|
147
227
|
let T0;
|
|
@@ -152,160 +232,189 @@ function ValueWidget(t0) {
|
|
|
152
232
|
let t11;
|
|
153
233
|
let t12;
|
|
154
234
|
let t13;
|
|
235
|
+
let t14;
|
|
236
|
+
let t15;
|
|
237
|
+
let t16;
|
|
155
238
|
let t6;
|
|
156
239
|
let t7;
|
|
157
240
|
let t8;
|
|
158
241
|
let t9;
|
|
159
|
-
if ($[
|
|
242
|
+
if ($[57] !== config.actions || $[58] !== config.cardVariant || $[59] !== config.className || $[60] !== config.description || $[61] !== config.title || $[62] !== data.classNames || $[63] !== data.footer || $[64] !== data.formatted || $[65] !== data.icon || $[66] !== data.label || $[67] !== data.subtitle || $[68] !== data.trend || $[69] !== data.value || $[70] !== isFetching || $[71] !== isLoading || $[72] !== refetch || $[73] !== resolveText) {
|
|
160
243
|
cls = data.classNames ?? {};
|
|
161
244
|
const Icon = data.icon;
|
|
162
245
|
const TrendIcon = data.trend?.icon;
|
|
163
|
-
let
|
|
164
|
-
if ($[
|
|
165
|
-
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
$
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
$
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
|
|
186
|
-
|
|
246
|
+
let t17$1;
|
|
247
|
+
if ($[89] !== config.title || $[90] !== data.label || $[91] !== resolveText) {
|
|
248
|
+
t17$1 = data.label ? resolveText(data.label) : config.title ? resolveText(config.title) : void 0;
|
|
249
|
+
$[89] = config.title;
|
|
250
|
+
$[90] = data.label;
|
|
251
|
+
$[91] = resolveText;
|
|
252
|
+
$[92] = t17$1;
|
|
253
|
+
} else t17$1 = $[92];
|
|
254
|
+
const label = t17$1;
|
|
255
|
+
let t18$1;
|
|
256
|
+
if ($[93] !== data.subtitle || $[94] !== resolveText) {
|
|
257
|
+
t18$1 = data.subtitle ? resolveText(data.subtitle) : void 0;
|
|
258
|
+
$[93] = data.subtitle;
|
|
259
|
+
$[94] = resolveText;
|
|
260
|
+
$[95] = t18$1;
|
|
261
|
+
} else t18$1 = $[95];
|
|
262
|
+
subtitle = t18$1;
|
|
263
|
+
let t19$1;
|
|
264
|
+
if ($[96] !== data.footer || $[97] !== resolveText) {
|
|
265
|
+
t19$1 = data.footer ? resolveText(data.footer) : void 0;
|
|
266
|
+
$[96] = data.footer;
|
|
267
|
+
$[97] = resolveText;
|
|
268
|
+
$[98] = t19$1;
|
|
269
|
+
} else t19$1 = $[98];
|
|
270
|
+
footer = t19$1;
|
|
187
271
|
T0 = WidgetCard;
|
|
188
272
|
t9 = label;
|
|
189
273
|
t10 = Icon;
|
|
190
|
-
if ($[
|
|
191
|
-
t11 = ()
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
274
|
+
if ($[99] !== config.description || $[100] !== resolveText) {
|
|
275
|
+
t11 = config.description ? resolveText(config.description) : void 0;
|
|
276
|
+
$[99] = config.description;
|
|
277
|
+
$[100] = resolveText;
|
|
278
|
+
$[101] = t11;
|
|
279
|
+
} else t11 = $[101];
|
|
280
|
+
t12 = config.cardVariant;
|
|
281
|
+
if ($[102] !== refetch) {
|
|
282
|
+
t13 = () => refetch();
|
|
283
|
+
$[102] = refetch;
|
|
284
|
+
$[103] = t13;
|
|
285
|
+
} else t13 = $[103];
|
|
286
|
+
t14 = isFetching && !isLoading;
|
|
287
|
+
t15 = config.actions;
|
|
288
|
+
t16 = cn(config.className, cls.root);
|
|
197
289
|
t6 = cn("space-y-1", cls.content);
|
|
198
|
-
let
|
|
199
|
-
if ($[
|
|
200
|
-
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
} else
|
|
290
|
+
let t20$1;
|
|
291
|
+
if ($[104] !== data.formatted || $[105] !== data.value) {
|
|
292
|
+
t20$1 = data.formatted ?? formatValue(data.value);
|
|
293
|
+
$[104] = data.formatted;
|
|
294
|
+
$[105] = data.value;
|
|
295
|
+
$[106] = t20$1;
|
|
296
|
+
} else t20$1 = $[106];
|
|
205
297
|
t7 = /* @__PURE__ */ jsx("div", {
|
|
206
298
|
className: cn("text-2xl font-bold", cls.value),
|
|
207
|
-
children:
|
|
299
|
+
children: t20$1
|
|
208
300
|
});
|
|
209
301
|
t8 = data.trend && /* @__PURE__ */ jsxs("div", {
|
|
210
302
|
className: cn("flex items-center gap-1 text-sm", cls.trend),
|
|
211
303
|
children: [resolveIconElement(TrendIcon, { className: cn("h-3 w-3", cls.trendIcon) }), /* @__PURE__ */ jsx("span", { children: data.trend.value })]
|
|
212
304
|
});
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
305
|
+
$[57] = config.actions;
|
|
306
|
+
$[58] = config.cardVariant;
|
|
307
|
+
$[59] = config.className;
|
|
308
|
+
$[60] = config.description;
|
|
309
|
+
$[61] = config.title;
|
|
310
|
+
$[62] = data.classNames;
|
|
311
|
+
$[63] = data.footer;
|
|
312
|
+
$[64] = data.formatted;
|
|
313
|
+
$[65] = data.icon;
|
|
314
|
+
$[66] = data.label;
|
|
315
|
+
$[67] = data.subtitle;
|
|
316
|
+
$[68] = data.trend;
|
|
317
|
+
$[69] = data.value;
|
|
318
|
+
$[70] = isFetching;
|
|
319
|
+
$[71] = isLoading;
|
|
320
|
+
$[72] = refetch;
|
|
321
|
+
$[73] = resolveText;
|
|
322
|
+
$[74] = T0;
|
|
323
|
+
$[75] = cls;
|
|
324
|
+
$[76] = footer;
|
|
325
|
+
$[77] = subtitle;
|
|
326
|
+
$[78] = t10;
|
|
327
|
+
$[79] = t11;
|
|
328
|
+
$[80] = t12;
|
|
329
|
+
$[81] = t13;
|
|
330
|
+
$[82] = t14;
|
|
331
|
+
$[83] = t15;
|
|
332
|
+
$[84] = t16;
|
|
333
|
+
$[85] = t6;
|
|
334
|
+
$[86] = t7;
|
|
335
|
+
$[87] = t8;
|
|
336
|
+
$[88] = t9;
|
|
237
337
|
} else {
|
|
238
|
-
T0 = $[
|
|
239
|
-
cls = $[
|
|
240
|
-
footer = $[
|
|
241
|
-
subtitle = $[
|
|
242
|
-
t10 = $[
|
|
243
|
-
t11 = $[
|
|
244
|
-
t12 = $[
|
|
245
|
-
t13 = $[
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
338
|
+
T0 = $[74];
|
|
339
|
+
cls = $[75];
|
|
340
|
+
footer = $[76];
|
|
341
|
+
subtitle = $[77];
|
|
342
|
+
t10 = $[78];
|
|
343
|
+
t11 = $[79];
|
|
344
|
+
t12 = $[80];
|
|
345
|
+
t13 = $[81];
|
|
346
|
+
t14 = $[82];
|
|
347
|
+
t15 = $[83];
|
|
348
|
+
t16 = $[84];
|
|
349
|
+
t6 = $[85];
|
|
350
|
+
t7 = $[86];
|
|
351
|
+
t8 = $[87];
|
|
352
|
+
t9 = $[88];
|
|
250
353
|
}
|
|
251
|
-
let
|
|
252
|
-
if ($[
|
|
253
|
-
|
|
354
|
+
let t17;
|
|
355
|
+
if ($[107] !== cls || $[108] !== subtitle) {
|
|
356
|
+
t17 = subtitle && /* @__PURE__ */ jsx("p", {
|
|
254
357
|
className: cn("text-muted-foreground text-xs", cls.subtitle),
|
|
255
358
|
children: subtitle
|
|
256
359
|
});
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
} else
|
|
261
|
-
let
|
|
262
|
-
if ($[
|
|
263
|
-
|
|
360
|
+
$[107] = cls;
|
|
361
|
+
$[108] = subtitle;
|
|
362
|
+
$[109] = t17;
|
|
363
|
+
} else t17 = $[109];
|
|
364
|
+
let t18;
|
|
365
|
+
if ($[110] !== cls || $[111] !== footer) {
|
|
366
|
+
t18 = footer && /* @__PURE__ */ jsx("p", {
|
|
264
367
|
className: cn("text-muted-foreground pt-2 text-xs", cls.footer),
|
|
265
368
|
children: footer
|
|
266
369
|
});
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
} else
|
|
271
|
-
let
|
|
272
|
-
if ($[
|
|
273
|
-
|
|
370
|
+
$[110] = cls;
|
|
371
|
+
$[111] = footer;
|
|
372
|
+
$[112] = t18;
|
|
373
|
+
} else t18 = $[112];
|
|
374
|
+
let t19;
|
|
375
|
+
if ($[113] !== t17 || $[114] !== t18 || $[115] !== t6 || $[116] !== t7 || $[117] !== t8) {
|
|
376
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
274
377
|
className: t6,
|
|
275
378
|
children: [
|
|
276
379
|
t7,
|
|
277
380
|
t8,
|
|
278
|
-
|
|
279
|
-
|
|
381
|
+
t17,
|
|
382
|
+
t18
|
|
280
383
|
]
|
|
281
384
|
});
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
} else
|
|
289
|
-
let
|
|
290
|
-
if ($[
|
|
291
|
-
|
|
385
|
+
$[113] = t17;
|
|
386
|
+
$[114] = t18;
|
|
387
|
+
$[115] = t6;
|
|
388
|
+
$[116] = t7;
|
|
389
|
+
$[117] = t8;
|
|
390
|
+
$[118] = t19;
|
|
391
|
+
} else t19 = $[118];
|
|
392
|
+
let t20;
|
|
393
|
+
if ($[119] !== T0 || $[120] !== t10 || $[121] !== t11 || $[122] !== t12 || $[123] !== t13 || $[124] !== t14 || $[125] !== t15 || $[126] !== t16 || $[127] !== t19 || $[128] !== t9) {
|
|
394
|
+
t20 = /* @__PURE__ */ jsx(T0, {
|
|
292
395
|
title: t9,
|
|
293
396
|
icon: t10,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
397
|
+
description: t11,
|
|
398
|
+
variant: t12,
|
|
399
|
+
onRefresh: t13,
|
|
400
|
+
isRefreshing: t14,
|
|
401
|
+
actions: t15,
|
|
402
|
+
className: t16,
|
|
403
|
+
children: t19
|
|
298
404
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
|
|
308
|
-
|
|
405
|
+
$[119] = T0;
|
|
406
|
+
$[120] = t10;
|
|
407
|
+
$[121] = t11;
|
|
408
|
+
$[122] = t12;
|
|
409
|
+
$[123] = t13;
|
|
410
|
+
$[124] = t14;
|
|
411
|
+
$[125] = t15;
|
|
412
|
+
$[126] = t16;
|
|
413
|
+
$[127] = t19;
|
|
414
|
+
$[128] = t9;
|
|
415
|
+
$[129] = t20;
|
|
416
|
+
} else t20 = $[129];
|
|
417
|
+
return t20;
|
|
309
418
|
}
|
|
310
419
|
|
|
311
420
|
//#endregion
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/client/components/widgets/widget-empty-state.tsx
|
|
7
|
+
function WidgetEmptyState(t0) {
|
|
8
|
+
const $ = c(18);
|
|
9
|
+
const { title, description, iconName: t1, action, className } = t0;
|
|
10
|
+
const iconName = t1 === void 0 ? "ph:tray" : t1;
|
|
11
|
+
let t2;
|
|
12
|
+
if ($[0] !== className) {
|
|
13
|
+
t2 = cn("qa-widget-empty-state flex min-h-28 flex-col items-center justify-center px-4 py-6 text-center", className);
|
|
14
|
+
$[0] = className;
|
|
15
|
+
$[1] = t2;
|
|
16
|
+
} else t2 = $[1];
|
|
17
|
+
let t3;
|
|
18
|
+
if ($[2] !== iconName) {
|
|
19
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "border-border-subtle bg-surface-low text-muted-foreground mb-3 flex size-9 items-center justify-center rounded-md border",
|
|
21
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
22
|
+
icon: iconName,
|
|
23
|
+
className: "size-4"
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
$[2] = iconName;
|
|
27
|
+
$[3] = t3;
|
|
28
|
+
} else t3 = $[3];
|
|
29
|
+
let t4;
|
|
30
|
+
if ($[4] !== title) {
|
|
31
|
+
t4 = /* @__PURE__ */ jsx("p", {
|
|
32
|
+
className: "text-foreground text-sm leading-5 font-medium text-balance",
|
|
33
|
+
children: title
|
|
34
|
+
});
|
|
35
|
+
$[4] = title;
|
|
36
|
+
$[5] = t4;
|
|
37
|
+
} else t4 = $[5];
|
|
38
|
+
let t5;
|
|
39
|
+
if ($[6] !== description) {
|
|
40
|
+
t5 = description && /* @__PURE__ */ jsx("p", {
|
|
41
|
+
className: "text-muted-foreground mt-1 max-w-60 text-xs/5 text-pretty",
|
|
42
|
+
children: description
|
|
43
|
+
});
|
|
44
|
+
$[6] = description;
|
|
45
|
+
$[7] = t5;
|
|
46
|
+
} else t5 = $[7];
|
|
47
|
+
let t6;
|
|
48
|
+
if ($[8] !== action) {
|
|
49
|
+
t6 = action && /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: "mt-4",
|
|
51
|
+
children: action
|
|
52
|
+
});
|
|
53
|
+
$[8] = action;
|
|
54
|
+
$[9] = t6;
|
|
55
|
+
} else t6 = $[9];
|
|
56
|
+
let t7;
|
|
57
|
+
if ($[10] !== t3 || $[11] !== t4 || $[12] !== t5 || $[13] !== t6) {
|
|
58
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "flex max-w-64 flex-col items-center",
|
|
60
|
+
children: [
|
|
61
|
+
t3,
|
|
62
|
+
t4,
|
|
63
|
+
t5,
|
|
64
|
+
t6
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
$[10] = t3;
|
|
68
|
+
$[11] = t4;
|
|
69
|
+
$[12] = t5;
|
|
70
|
+
$[13] = t6;
|
|
71
|
+
$[14] = t7;
|
|
72
|
+
} else t7 = $[14];
|
|
73
|
+
let t8;
|
|
74
|
+
if ($[15] !== t2 || $[16] !== t7) {
|
|
75
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
76
|
+
"data-slot": "widget-empty-state",
|
|
77
|
+
className: t2,
|
|
78
|
+
children: t7
|
|
79
|
+
});
|
|
80
|
+
$[15] = t2;
|
|
81
|
+
$[16] = t7;
|
|
82
|
+
$[17] = t8;
|
|
83
|
+
} else t8 = $[17];
|
|
84
|
+
return t8;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { WidgetEmptyState };
|