@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
|
@@ -2,6 +2,8 @@ import { useResolveText } from "../../i18n/hooks.mjs";
|
|
|
2
2
|
import { formatLabel } from "../../lib/utils.mjs";
|
|
3
3
|
import { useCollectionList } from "../../hooks/use-collection.mjs";
|
|
4
4
|
import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
|
|
5
|
+
import { useServerWidgetData } from "../../hooks/use-server-widget-data.mjs";
|
|
6
|
+
import { WidgetEmptyState } from "./widget-empty-state.mjs";
|
|
5
7
|
import { RecentItemsWidgetSkeleton } from "./widget-skeletons.mjs";
|
|
6
8
|
import { c } from "react/compiler-runtime";
|
|
7
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -22,55 +24,76 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
22
24
|
* - Links to edit each item
|
|
23
25
|
*/
|
|
24
26
|
function RecentItemsWidget(t0) {
|
|
25
|
-
const $ = c(
|
|
27
|
+
const $ = c(52);
|
|
26
28
|
const { config } = t0;
|
|
27
29
|
const resolveText = useResolveText();
|
|
28
|
-
const { collection, limit: t1, label, titleField: t2, dateField: t3, subtitleFields, onItemClick, realtime } = config;
|
|
30
|
+
const { collection, limit: t1, label, titleField: t2, dateField: t3, subtitleFields, onItemClick, realtime, hasLoader, refreshInterval } = config;
|
|
29
31
|
const limit = t1 === void 0 ? 5 : t1;
|
|
30
32
|
const titleField = t2 === void 0 ? "_title" : t2;
|
|
31
33
|
const dateField = t3 === void 0 ? "createdAt" : t3;
|
|
32
|
-
|
|
33
|
-
if ($[0] !== dateField) {
|
|
34
|
-
t4 = { [dateField]: "desc" };
|
|
35
|
-
$[0] = dateField;
|
|
36
|
-
$[1] = t4;
|
|
37
|
-
} else t4 = $[1];
|
|
34
|
+
const t4 = !!hasLoader;
|
|
38
35
|
let t5;
|
|
39
|
-
if ($[
|
|
36
|
+
if ($[0] !== refreshInterval || $[1] !== t4) {
|
|
40
37
|
t5 = {
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
enabled: t4,
|
|
39
|
+
refreshInterval
|
|
43
40
|
};
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
} else t5 = $[
|
|
41
|
+
$[0] = refreshInterval;
|
|
42
|
+
$[1] = t4;
|
|
43
|
+
$[2] = t5;
|
|
44
|
+
} else t5 = $[2];
|
|
45
|
+
const serverQuery = useServerWidgetData(config.id, t5);
|
|
48
46
|
let t6;
|
|
49
|
-
if ($[
|
|
50
|
-
t6 = {
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
} else t6 = $[
|
|
54
|
-
const { data, isLoading, error, refetch } = useCollectionList(collection, t5, void 0, t6);
|
|
47
|
+
if ($[3] !== dateField) {
|
|
48
|
+
t6 = { [dateField]: "desc" };
|
|
49
|
+
$[3] = dateField;
|
|
50
|
+
$[4] = t6;
|
|
51
|
+
} else t6 = $[4];
|
|
55
52
|
let t7;
|
|
56
|
-
if ($[
|
|
57
|
-
t7 =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
$[10] = label;
|
|
67
|
-
$[11] = resolveText;
|
|
68
|
-
$[12] = t8;
|
|
69
|
-
} else t8 = $[12];
|
|
70
|
-
const displayLabel = t8;
|
|
53
|
+
if ($[5] !== limit || $[6] !== t6) {
|
|
54
|
+
t7 = {
|
|
55
|
+
orderBy: t6,
|
|
56
|
+
limit
|
|
57
|
+
};
|
|
58
|
+
$[5] = limit;
|
|
59
|
+
$[6] = t6;
|
|
60
|
+
$[7] = t7;
|
|
61
|
+
} else t7 = $[7];
|
|
62
|
+
const t8 = !hasLoader;
|
|
71
63
|
let t9;
|
|
72
|
-
if ($[
|
|
73
|
-
t9 =
|
|
64
|
+
if ($[8] !== t8) {
|
|
65
|
+
t9 = { enabled: t8 };
|
|
66
|
+
$[8] = t8;
|
|
67
|
+
$[9] = t9;
|
|
68
|
+
} else t9 = $[9];
|
|
69
|
+
let t10;
|
|
70
|
+
if ($[10] !== realtime) {
|
|
71
|
+
t10 = { realtime };
|
|
72
|
+
$[10] = realtime;
|
|
73
|
+
$[11] = t10;
|
|
74
|
+
} else t10 = $[11];
|
|
75
|
+
const collectionQuery = useCollectionList(collection, t7, t9, t10);
|
|
76
|
+
const { data, isLoading, error, refetch, isFetching } = hasLoader ? serverQuery : collectionQuery;
|
|
77
|
+
let t11;
|
|
78
|
+
if ($[12] !== data) {
|
|
79
|
+
t11 = Array.isArray(data) ? data : Array.isArray(data?.docs) ? data.docs : [];
|
|
80
|
+
$[12] = data;
|
|
81
|
+
$[13] = t11;
|
|
82
|
+
} else t11 = $[13];
|
|
83
|
+
const items = t11;
|
|
84
|
+
let t12;
|
|
85
|
+
if ($[14] !== collection || $[15] !== config.title || $[16] !== label || $[17] !== resolveText) {
|
|
86
|
+
t12 = config.title ? resolveText(config.title) : label ? resolveText(label) : `Recent ${formatLabel(collection)}`;
|
|
87
|
+
$[14] = collection;
|
|
88
|
+
$[15] = config.title;
|
|
89
|
+
$[16] = label;
|
|
90
|
+
$[17] = resolveText;
|
|
91
|
+
$[18] = t12;
|
|
92
|
+
} else t12 = $[18];
|
|
93
|
+
const displayLabel = t12;
|
|
94
|
+
let t13;
|
|
95
|
+
if ($[19] !== titleField) {
|
|
96
|
+
t13 = (item) => {
|
|
74
97
|
if (titleField && item[titleField]) return String(item[titleField]);
|
|
75
98
|
if (item._title) return String(item._title);
|
|
76
99
|
if (item.name) return String(item.name);
|
|
@@ -78,34 +101,35 @@ function RecentItemsWidget(t0) {
|
|
|
78
101
|
if (item.label) return String(item.label);
|
|
79
102
|
return `Item #${item.id}`;
|
|
80
103
|
};
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else
|
|
84
|
-
const getTitleValue =
|
|
85
|
-
let
|
|
86
|
-
if ($[
|
|
87
|
-
|
|
104
|
+
$[19] = titleField;
|
|
105
|
+
$[20] = t13;
|
|
106
|
+
} else t13 = $[20];
|
|
107
|
+
const getTitleValue = t13;
|
|
108
|
+
let t14;
|
|
109
|
+
if ($[21] !== subtitleFields) {
|
|
110
|
+
t14 = (item_0) => {
|
|
88
111
|
if (!subtitleFields?.length) return null;
|
|
89
112
|
return subtitleFields.map((field) => item_0[field]).filter(Boolean).join(" - ");
|
|
90
113
|
};
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
} else
|
|
94
|
-
const getSubtitle =
|
|
95
|
-
let
|
|
96
|
-
if ($[
|
|
97
|
-
|
|
114
|
+
$[21] = subtitleFields;
|
|
115
|
+
$[22] = t14;
|
|
116
|
+
} else t14 = $[22];
|
|
117
|
+
const getSubtitle = t14;
|
|
118
|
+
let t15;
|
|
119
|
+
if ($[23] !== onItemClick) {
|
|
120
|
+
t15 = (item_1) => {
|
|
98
121
|
if (onItemClick) onItemClick(item_1);
|
|
99
122
|
};
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
} else
|
|
103
|
-
const handleItemClick =
|
|
104
|
-
let
|
|
105
|
-
if ($[
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
123
|
+
$[23] = onItemClick;
|
|
124
|
+
$[24] = t15;
|
|
125
|
+
} else t15 = $[24];
|
|
126
|
+
const handleItemClick = t15;
|
|
127
|
+
let t16;
|
|
128
|
+
if ($[25] !== dateField || $[26] !== getSubtitle || $[27] !== getTitleValue || $[28] !== handleItemClick || $[29] !== items) {
|
|
129
|
+
t16 = items.length === 0 ? /* @__PURE__ */ jsx(WidgetEmptyState, {
|
|
130
|
+
iconName: "ph:clock-counter-clockwise",
|
|
131
|
+
title: "No recent items",
|
|
132
|
+
description: "There are no recent records to show."
|
|
109
133
|
}) : /* @__PURE__ */ jsx("div", {
|
|
110
134
|
className: "space-y-1",
|
|
111
135
|
children: items.map((item_2) => {
|
|
@@ -131,51 +155,69 @@ function RecentItemsWidget(t0) {
|
|
|
131
155
|
}, item_2.id);
|
|
132
156
|
})
|
|
133
157
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
} else
|
|
141
|
-
const listContent =
|
|
142
|
-
let
|
|
143
|
-
if ($[
|
|
144
|
-
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
$[25] = dateField;
|
|
159
|
+
$[26] = getSubtitle;
|
|
160
|
+
$[27] = getTitleValue;
|
|
161
|
+
$[28] = handleItemClick;
|
|
162
|
+
$[29] = items;
|
|
163
|
+
$[30] = t16;
|
|
164
|
+
} else t16 = $[30];
|
|
165
|
+
const listContent = t16;
|
|
166
|
+
let t17;
|
|
167
|
+
if ($[31] !== config.description || $[32] !== resolveText) {
|
|
168
|
+
t17 = config.description ? resolveText(config.description) : void 0;
|
|
169
|
+
$[31] = config.description;
|
|
170
|
+
$[32] = resolveText;
|
|
171
|
+
$[33] = t17;
|
|
172
|
+
} else t17 = $[33];
|
|
173
|
+
const t18 = isFetching && !isLoading;
|
|
174
|
+
let t19;
|
|
175
|
+
if ($[34] !== limit) {
|
|
176
|
+
t19 = /* @__PURE__ */ jsx(RecentItemsWidgetSkeleton, { count: limit });
|
|
177
|
+
$[34] = limit;
|
|
178
|
+
$[35] = t19;
|
|
179
|
+
} else t19 = $[35];
|
|
180
|
+
let t20;
|
|
181
|
+
if ($[36] !== error) {
|
|
182
|
+
t20 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
183
|
+
$[36] = error;
|
|
184
|
+
$[37] = t20;
|
|
185
|
+
} else t20 = $[37];
|
|
186
|
+
let t21;
|
|
187
|
+
if ($[38] !== refetch) {
|
|
188
|
+
t21 = () => refetch();
|
|
189
|
+
$[38] = refetch;
|
|
190
|
+
$[39] = t21;
|
|
191
|
+
} else t21 = $[39];
|
|
192
|
+
let t22;
|
|
193
|
+
if ($[40] !== config.actions || $[41] !== config.cardVariant || $[42] !== config.className || $[43] !== displayLabel || $[44] !== isLoading || $[45] !== listContent || $[46] !== t17 || $[47] !== t18 || $[48] !== t19 || $[49] !== t20 || $[50] !== t21) {
|
|
194
|
+
t22 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
163
195
|
title: displayLabel,
|
|
196
|
+
description: t17,
|
|
197
|
+
variant: config.cardVariant,
|
|
164
198
|
isLoading,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
199
|
+
isRefreshing: t18,
|
|
200
|
+
loadingSkeleton: t19,
|
|
201
|
+
error: t20,
|
|
202
|
+
onRefresh: t21,
|
|
203
|
+
actions: config.actions,
|
|
204
|
+
className: config.className,
|
|
168
205
|
children: listContent
|
|
169
206
|
});
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
|
|
178
|
-
|
|
207
|
+
$[40] = config.actions;
|
|
208
|
+
$[41] = config.cardVariant;
|
|
209
|
+
$[42] = config.className;
|
|
210
|
+
$[43] = displayLabel;
|
|
211
|
+
$[44] = isLoading;
|
|
212
|
+
$[45] = listContent;
|
|
213
|
+
$[46] = t17;
|
|
214
|
+
$[47] = t18;
|
|
215
|
+
$[48] = t19;
|
|
216
|
+
$[49] = t20;
|
|
217
|
+
$[50] = t21;
|
|
218
|
+
$[51] = t22;
|
|
219
|
+
} else t22 = $[51];
|
|
220
|
+
return t22;
|
|
179
221
|
}
|
|
180
222
|
/**
|
|
181
223
|
* Format relative time
|
|
@@ -75,16 +75,9 @@ function getDateRange(preset) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const variantStyles = {
|
|
79
|
-
default: "",
|
|
80
|
-
primary: "border-primary/30 bg-primary/5",
|
|
81
|
-
success: "border-success/30 bg-success/5",
|
|
82
|
-
warning: "border-warning/30 bg-warning/5",
|
|
83
|
-
danger: "border-destructive/30 bg-destructive/5"
|
|
84
|
-
};
|
|
85
78
|
const variantValueStyles = {
|
|
86
79
|
default: "",
|
|
87
|
-
primary: "text-
|
|
80
|
+
primary: "text-foreground",
|
|
88
81
|
success: "text-success",
|
|
89
82
|
warning: "text-warning",
|
|
90
83
|
danger: "text-destructive"
|
|
@@ -98,7 +91,7 @@ const variantValueStyles = {
|
|
|
98
91
|
* - Color variant for visual distinction
|
|
99
92
|
*/
|
|
100
93
|
function StatsWidget(t0) {
|
|
101
|
-
const $ = c(
|
|
94
|
+
const $ = c(53);
|
|
102
95
|
const { config } = t0;
|
|
103
96
|
const resolveText = useResolveText();
|
|
104
97
|
const { collection, label, filter, filterFn, dateFilter, icon: Icon, variant: t1, realtime, hasLoader, refreshInterval } = config;
|
|
@@ -174,87 +167,113 @@ function StatsWidget(t0) {
|
|
|
174
167
|
$[15] = computedFilter;
|
|
175
168
|
$[16] = t5;
|
|
176
169
|
} else t5 = $[16];
|
|
177
|
-
|
|
178
|
-
if ($[17] !== realtime) {
|
|
179
|
-
t6 = { realtime };
|
|
180
|
-
$[17] = realtime;
|
|
181
|
-
$[18] = t6;
|
|
182
|
-
} else t6 = $[18];
|
|
183
|
-
const collectionQuery = useCollectionCount(collection, t5, void 0, t6);
|
|
184
|
-
const { data: rawData, isLoading, error, refetch } = hasLoader ? serverQuery : collectionQuery;
|
|
185
|
-
const count = hasLoader ? rawData?.count ?? 0 : rawData ?? 0;
|
|
170
|
+
const t6 = !hasLoader;
|
|
186
171
|
let t7;
|
|
187
|
-
if ($[
|
|
188
|
-
t7 =
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
|
|
192
|
-
$[22] = t7;
|
|
193
|
-
} else t7 = $[22];
|
|
194
|
-
const displayLabel = t7;
|
|
172
|
+
if ($[17] !== t6) {
|
|
173
|
+
t7 = { enabled: t6 };
|
|
174
|
+
$[17] = t6;
|
|
175
|
+
$[18] = t7;
|
|
176
|
+
} else t7 = $[18];
|
|
195
177
|
let t8;
|
|
196
|
-
if ($[
|
|
197
|
-
t8 =
|
|
198
|
-
$[
|
|
199
|
-
|
|
178
|
+
if ($[19] !== realtime) {
|
|
179
|
+
t8 = { realtime };
|
|
180
|
+
$[19] = realtime;
|
|
181
|
+
$[20] = t8;
|
|
182
|
+
} else t8 = $[20];
|
|
183
|
+
const collectionQuery = useCollectionCount(collection, t5, t7, t8);
|
|
184
|
+
const { data: rawData, isLoading, error, refetch, isFetching } = hasLoader ? serverQuery : collectionQuery;
|
|
185
|
+
const count = hasLoader ? rawData?.count ?? 0 : rawData ?? 0;
|
|
200
186
|
let t9;
|
|
201
|
-
if ($[24] !==
|
|
202
|
-
t9 =
|
|
203
|
-
$[
|
|
187
|
+
if ($[21] !== collection || $[22] !== config.title || $[23] !== label || $[24] !== resolveText) {
|
|
188
|
+
t9 = config.title ? resolveText(config.title) : label ? resolveText(label) : formatLabel(collection);
|
|
189
|
+
$[21] = collection;
|
|
190
|
+
$[22] = config.title;
|
|
191
|
+
$[23] = label;
|
|
192
|
+
$[24] = resolveText;
|
|
204
193
|
$[25] = t9;
|
|
205
194
|
} else t9 = $[25];
|
|
195
|
+
const displayLabel = t9;
|
|
206
196
|
let t10;
|
|
207
|
-
if ($[26] !==
|
|
208
|
-
t10 = ()
|
|
209
|
-
$[26] =
|
|
210
|
-
$[27] =
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const
|
|
197
|
+
if ($[26] !== config.description || $[27] !== resolveText) {
|
|
198
|
+
t10 = config.description ? resolveText(config.description) : void 0;
|
|
199
|
+
$[26] = config.description;
|
|
200
|
+
$[27] = resolveText;
|
|
201
|
+
$[28] = t10;
|
|
202
|
+
} else t10 = $[28];
|
|
203
|
+
const t11 = config.cardVariant;
|
|
204
|
+
const t12 = isFetching && !isLoading;
|
|
214
205
|
let t13;
|
|
215
|
-
if ($[
|
|
216
|
-
t13 =
|
|
217
|
-
$[28] = t12;
|
|
206
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
207
|
+
t13 = /* @__PURE__ */ jsx(StatsWidgetSkeleton, {});
|
|
218
208
|
$[29] = t13;
|
|
219
209
|
} else t13 = $[29];
|
|
220
210
|
let t14;
|
|
221
|
-
if ($[30] !==
|
|
222
|
-
t14 =
|
|
223
|
-
$[30] =
|
|
211
|
+
if ($[30] !== error) {
|
|
212
|
+
t14 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
213
|
+
$[30] = error;
|
|
224
214
|
$[31] = t14;
|
|
225
215
|
} else t14 = $[31];
|
|
226
216
|
let t15;
|
|
227
|
-
if ($[32] !==
|
|
228
|
-
t15 =
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
if ($[32] !== refetch) {
|
|
218
|
+
t15 = () => refetch();
|
|
219
|
+
$[32] = refetch;
|
|
220
|
+
$[33] = t15;
|
|
221
|
+
} else t15 = $[33];
|
|
222
|
+
const t16 = config.actions;
|
|
223
|
+
const t17 = config.className;
|
|
224
|
+
const t18 = variantValueStyles[variant];
|
|
225
|
+
let t19;
|
|
226
|
+
if ($[34] !== t18) {
|
|
227
|
+
t19 = cn("text-2xl font-bold", t18);
|
|
228
|
+
$[34] = t18;
|
|
229
|
+
$[35] = t19;
|
|
230
|
+
} else t19 = $[35];
|
|
231
|
+
let t20;
|
|
232
|
+
if ($[36] !== count) {
|
|
233
|
+
t20 = count.toLocaleString();
|
|
234
|
+
$[36] = count;
|
|
235
|
+
$[37] = t20;
|
|
236
|
+
} else t20 = $[37];
|
|
237
|
+
let t21;
|
|
238
|
+
if ($[38] !== t19 || $[39] !== t20) {
|
|
239
|
+
t21 = /* @__PURE__ */ jsx("div", {
|
|
240
|
+
className: t19,
|
|
241
|
+
children: t20
|
|
231
242
|
});
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else
|
|
236
|
-
let
|
|
237
|
-
if ($[
|
|
238
|
-
|
|
243
|
+
$[38] = t19;
|
|
244
|
+
$[39] = t20;
|
|
245
|
+
$[40] = t21;
|
|
246
|
+
} else t21 = $[40];
|
|
247
|
+
let t22;
|
|
248
|
+
if ($[41] !== Icon || $[42] !== config.actions || $[43] !== config.cardVariant || $[44] !== config.className || $[45] !== displayLabel || $[46] !== isLoading || $[47] !== t10 || $[48] !== t12 || $[49] !== t14 || $[50] !== t15 || $[51] !== t21) {
|
|
249
|
+
t22 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
239
250
|
title: displayLabel,
|
|
251
|
+
description: t10,
|
|
240
252
|
icon: Icon,
|
|
253
|
+
variant: t11,
|
|
241
254
|
isLoading,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
255
|
+
isRefreshing: t12,
|
|
256
|
+
loadingSkeleton: t13,
|
|
257
|
+
error: t14,
|
|
258
|
+
onRefresh: t15,
|
|
259
|
+
actions: t16,
|
|
260
|
+
className: t17,
|
|
261
|
+
children: t21
|
|
247
262
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
|
|
257
|
-
|
|
263
|
+
$[41] = Icon;
|
|
264
|
+
$[42] = config.actions;
|
|
265
|
+
$[43] = config.cardVariant;
|
|
266
|
+
$[44] = config.className;
|
|
267
|
+
$[45] = displayLabel;
|
|
268
|
+
$[46] = isLoading;
|
|
269
|
+
$[47] = t10;
|
|
270
|
+
$[48] = t12;
|
|
271
|
+
$[49] = t14;
|
|
272
|
+
$[50] = t15;
|
|
273
|
+
$[51] = t21;
|
|
274
|
+
$[52] = t22;
|
|
275
|
+
} else t22 = $[52];
|
|
276
|
+
return t22;
|
|
258
277
|
}
|
|
259
278
|
|
|
260
279
|
//#endregion
|