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