@questpie/admin 3.2.3 → 3.2.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/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +106 -220
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +107 -313
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -182
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +196 -530
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +39 -74
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +306 -611
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +177 -494
- package/dist/client/components/preview/live-preview-mode.mjs +240 -438
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +200 -559
- package/dist/client/components/primitives/select-single.mjs +165 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.d.mts +4 -0
- package/dist/client/contexts/focus-context.mjs +87 -150
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/diff.mjs +110 -0
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +166 -409
- package/dist/client/preview/use-collection-preview.mjs +135 -201
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +11 -24
- package/dist/client/views/collection/form-view.mjs +288 -560
- package/dist/client/views/collection/table-view.mjs +239 -469
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -543
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +478 -1298
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +457 -1289
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- 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 +34 -34
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +53 -53
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/index.d.mts +21 -20
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/package.json +3 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
3
|
import { Checkbox } from "../ui/checkbox.mjs";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
4
|
import { Icon } from "@iconify/react";
|
|
6
5
|
import { useState } from "react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,129 +9,44 @@ import { SortableContext, arrayMove, sortableKeyboardCoordinates, useSortable, v
|
|
|
10
9
|
import { CSS } from "@dnd-kit/utilities";
|
|
11
10
|
|
|
12
11
|
//#region src/client/components/filter-builder/columns-tab.tsx
|
|
13
|
-
function SortableColumnItem(
|
|
14
|
-
const $ = c(33);
|
|
15
|
-
const { field, isVisible, onToggle } = t0;
|
|
12
|
+
function SortableColumnItem({ field, isVisible, onToggle }) {
|
|
16
13
|
const resolveText = useResolveText();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} else t1 = $[1];
|
|
23
|
-
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t1);
|
|
24
|
-
let t2;
|
|
25
|
-
if ($[2] !== transform) {
|
|
26
|
-
t2 = CSS.Transform.toString(transform);
|
|
27
|
-
$[2] = transform;
|
|
28
|
-
$[3] = t2;
|
|
29
|
-
} else t2 = $[3];
|
|
30
|
-
let t3;
|
|
31
|
-
if ($[4] !== t2 || $[5] !== transition) {
|
|
32
|
-
t3 = {
|
|
33
|
-
transform: t2,
|
|
14
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: field.name });
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
ref: setNodeRef,
|
|
17
|
+
style: {
|
|
18
|
+
transform: CSS.Transform.toString(transform),
|
|
34
19
|
transition
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
$[6] = t3;
|
|
39
|
-
} else t3 = $[6];
|
|
40
|
-
const style = t3;
|
|
41
|
-
const t4 = isDragging && "opacity-75";
|
|
42
|
-
let t5;
|
|
43
|
-
if ($[7] !== t4) {
|
|
44
|
-
t5 = cn("border-border-subtle bg-surface-low hover:border-border-strong hover:bg-surface-high flex items-center gap-2 rounded-md border p-2.5 transition-[background-color,border-color,opacity]", t4);
|
|
45
|
-
$[7] = t4;
|
|
46
|
-
$[8] = t5;
|
|
47
|
-
} else t5 = $[8];
|
|
48
|
-
let t6;
|
|
49
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
-
t6 = /* @__PURE__ */ jsx(Icon, {
|
|
51
|
-
icon: "ph:dots-six-vertical-bold",
|
|
52
|
-
width: 16,
|
|
53
|
-
height: 16
|
|
54
|
-
});
|
|
55
|
-
$[9] = t6;
|
|
56
|
-
} else t6 = $[9];
|
|
57
|
-
let t7;
|
|
58
|
-
if ($[10] !== attributes || $[11] !== listeners) {
|
|
59
|
-
t7 = /* @__PURE__ */ jsx("button", {
|
|
20
|
+
},
|
|
21
|
+
className: cn("border-border-subtle bg-surface-low hover:border-border-strong hover:bg-surface-high flex items-center gap-2 rounded-md border p-2.5 transition-[background-color,border-color,opacity]", isDragging && "opacity-75"),
|
|
22
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
60
23
|
type: "button",
|
|
61
24
|
className: "text-muted-foreground hover:text-foreground cursor-grab touch-none active:cursor-grabbing",
|
|
62
25
|
...attributes,
|
|
63
26
|
...listeners,
|
|
64
|
-
children:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
let t8;
|
|
71
|
-
if ($[13] !== isVisible || $[14] !== onToggle) {
|
|
72
|
-
t8 = /* @__PURE__ */ jsx(Checkbox, {
|
|
73
|
-
checked: isVisible,
|
|
74
|
-
onCheckedChange: onToggle
|
|
75
|
-
});
|
|
76
|
-
$[13] = isVisible;
|
|
77
|
-
$[14] = onToggle;
|
|
78
|
-
$[15] = t8;
|
|
79
|
-
} else t8 = $[15];
|
|
80
|
-
let t9;
|
|
81
|
-
if ($[16] !== field.label || $[17] !== resolveText) {
|
|
82
|
-
t9 = resolveText(field.label);
|
|
83
|
-
$[16] = field.label;
|
|
84
|
-
$[17] = resolveText;
|
|
85
|
-
$[18] = t9;
|
|
86
|
-
} else t9 = $[18];
|
|
87
|
-
let t10;
|
|
88
|
-
if ($[19] !== t9) {
|
|
89
|
-
t10 = /* @__PURE__ */ jsx("span", {
|
|
90
|
-
className: "text-sm font-medium",
|
|
91
|
-
children: t9
|
|
92
|
-
});
|
|
93
|
-
$[19] = t9;
|
|
94
|
-
$[20] = t10;
|
|
95
|
-
} else t10 = $[20];
|
|
96
|
-
let t11;
|
|
97
|
-
if ($[21] !== field.type) {
|
|
98
|
-
t11 = /* @__PURE__ */ jsx("span", {
|
|
99
|
-
className: "text-muted-foreground ml-auto text-xs",
|
|
100
|
-
children: field.type
|
|
101
|
-
});
|
|
102
|
-
$[21] = field.type;
|
|
103
|
-
$[22] = t11;
|
|
104
|
-
} else t11 = $[22];
|
|
105
|
-
let t12;
|
|
106
|
-
if ($[23] !== t10 || $[24] !== t11 || $[25] !== t8) {
|
|
107
|
-
t12 = /* @__PURE__ */ jsxs("label", {
|
|
27
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
28
|
+
icon: "ph:dots-six-vertical-bold",
|
|
29
|
+
width: 16,
|
|
30
|
+
height: 16
|
|
31
|
+
})
|
|
32
|
+
}), /* @__PURE__ */ jsxs("label", {
|
|
108
33
|
className: "flex flex-1 cursor-pointer items-center gap-3",
|
|
109
34
|
children: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
35
|
+
/* @__PURE__ */ jsx(Checkbox, {
|
|
36
|
+
checked: isVisible,
|
|
37
|
+
onCheckedChange: onToggle
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "text-sm font-medium",
|
|
41
|
+
children: resolveText(field.label)
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: "text-muted-foreground ml-auto text-xs",
|
|
45
|
+
children: field.type
|
|
46
|
+
})
|
|
113
47
|
]
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
$[24] = t11;
|
|
117
|
-
$[25] = t8;
|
|
118
|
-
$[26] = t12;
|
|
119
|
-
} else t12 = $[26];
|
|
120
|
-
let t13;
|
|
121
|
-
if ($[27] !== setNodeRef || $[28] !== style || $[29] !== t12 || $[30] !== t5 || $[31] !== t7) {
|
|
122
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
123
|
-
ref: setNodeRef,
|
|
124
|
-
style,
|
|
125
|
-
className: t5,
|
|
126
|
-
children: [t7, t12]
|
|
127
|
-
});
|
|
128
|
-
$[27] = setNodeRef;
|
|
129
|
-
$[28] = style;
|
|
130
|
-
$[29] = t12;
|
|
131
|
-
$[30] = t5;
|
|
132
|
-
$[31] = t7;
|
|
133
|
-
$[32] = t13;
|
|
134
|
-
} else t13 = $[32];
|
|
135
|
-
return t13;
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
136
50
|
}
|
|
137
51
|
/**
|
|
138
52
|
* Sort fields by visibleColumns order:
|
|
@@ -150,182 +64,68 @@ function sortFieldsByVisibleColumns(fields, visibleColumns) {
|
|
|
150
64
|
const hiddenFields = fields.filter((f) => !visibleSet.has(f.name));
|
|
151
65
|
return [...visibleFields, ...hiddenFields];
|
|
152
66
|
}
|
|
153
|
-
function ColumnsTab(
|
|
154
|
-
const
|
|
155
|
-
const { fields, visibleColumns, onVisibleColumnsChange } = t0;
|
|
156
|
-
let t1;
|
|
157
|
-
if ($[0] !== fields || $[1] !== visibleColumns) {
|
|
158
|
-
t1 = () => sortFieldsByVisibleColumns(fields, visibleColumns);
|
|
159
|
-
$[0] = fields;
|
|
160
|
-
$[1] = visibleColumns;
|
|
161
|
-
$[2] = t1;
|
|
162
|
-
} else t1 = $[2];
|
|
163
|
-
const [orderedFields, setOrderedFields] = useState(t1);
|
|
67
|
+
function ColumnsTab({ fields, visibleColumns, onVisibleColumnsChange }) {
|
|
68
|
+
const [orderedFields, setOrderedFields] = useState(() => sortFieldsByVisibleColumns(fields, visibleColumns));
|
|
164
69
|
const [prevFields, setPrevFields] = useState(fields);
|
|
165
70
|
if (prevFields !== fields) {
|
|
166
71
|
setPrevFields(fields);
|
|
167
|
-
const existingNames = new Set(orderedFields.map(
|
|
168
|
-
const newNames = new Set(fields.map(
|
|
169
|
-
const kept = orderedFields.filter((
|
|
170
|
-
const added = fields.filter((
|
|
72
|
+
const existingNames = new Set(orderedFields.map((f) => f.name));
|
|
73
|
+
const newNames = new Set(fields.map((f) => f.name));
|
|
74
|
+
const kept = orderedFields.filter((f) => newNames.has(f.name));
|
|
75
|
+
const added = fields.filter((f) => !existingNames.has(f.name));
|
|
171
76
|
const merged = [...kept, ...added];
|
|
172
|
-
if (merged.length !== orderedFields.length || merged.some((
|
|
77
|
+
if (merged.length !== orderedFields.length || merged.some((f, i) => f.name !== orderedFields[i]?.name)) setOrderedFields(merged);
|
|
173
78
|
}
|
|
174
79
|
const [prevVisible, setPrevVisible] = useState(visibleColumns);
|
|
175
80
|
if (prevVisible !== visibleColumns) {
|
|
176
81
|
setPrevVisible(visibleColumns);
|
|
177
82
|
const sorted = sortFieldsByVisibleColumns(orderedFields, visibleColumns);
|
|
178
|
-
if (orderedFields.map(
|
|
83
|
+
if (orderedFields.map((f) => f.name).join(",") !== sorted.map((f) => f.name).join(",")) setOrderedFields(sorted);
|
|
179
84
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
$[5] = orderedFields;
|
|
197
|
-
$[6] = visibleColumns;
|
|
198
|
-
$[7] = t3;
|
|
199
|
-
} else t3 = $[7];
|
|
200
|
-
const toggleColumn = t3;
|
|
201
|
-
let t4;
|
|
202
|
-
if ($[8] !== onVisibleColumnsChange || $[9] !== orderedFields || $[10] !== visibleColumns) {
|
|
203
|
-
t4 = (event) => {
|
|
204
|
-
const { active, over } = event;
|
|
205
|
-
if (over && active.id !== over.id) {
|
|
206
|
-
const reorderedFields = arrayMove(orderedFields, orderedFields.findIndex((f_7) => f_7.name === active.id), orderedFields.findIndex((f_8) => f_8.name === over.id));
|
|
207
|
-
setOrderedFields(reorderedFields);
|
|
208
|
-
onVisibleColumnsChange(reorderedFields.map(_temp6).filter((name_0) => visibleColumns.includes(name_0)));
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
$[8] = onVisibleColumnsChange;
|
|
212
|
-
$[9] = orderedFields;
|
|
213
|
-
$[10] = visibleColumns;
|
|
214
|
-
$[11] = t4;
|
|
215
|
-
} else t4 = $[11];
|
|
216
|
-
const handleDragEnd = t4;
|
|
85
|
+
const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
86
|
+
const toggleColumn = (fieldName) => {
|
|
87
|
+
if (visibleColumns.includes(fieldName)) onVisibleColumnsChange(visibleColumns.filter((c) => c !== fieldName));
|
|
88
|
+
else {
|
|
89
|
+
const newVisible = [...visibleColumns, fieldName];
|
|
90
|
+
onVisibleColumnsChange(orderedFields.map((f) => f.name).filter((name) => newVisible.includes(name)));
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const handleDragEnd = (event) => {
|
|
94
|
+
const { active, over } = event;
|
|
95
|
+
if (over && active.id !== over.id) {
|
|
96
|
+
const reorderedFields = arrayMove(orderedFields, orderedFields.findIndex((f) => f.name === active.id), orderedFields.findIndex((f) => f.name === over.id));
|
|
97
|
+
setOrderedFields(reorderedFields);
|
|
98
|
+
onVisibleColumnsChange(reorderedFields.map((f) => f.name).filter((name) => visibleColumns.includes(name)));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
217
101
|
const { t } = useTranslation();
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
isVisible: visibleColumns.includes(field.name),
|
|
246
|
-
onToggle: () => toggleColumn(field.name)
|
|
247
|
-
}, field.name);
|
|
248
|
-
$[22] = toggleColumn;
|
|
249
|
-
$[23] = visibleColumns;
|
|
250
|
-
$[24] = t9$1;
|
|
251
|
-
} else t9$1 = $[24];
|
|
252
|
-
t8 = orderedFields.map(t9$1);
|
|
253
|
-
$[18] = orderedFields;
|
|
254
|
-
$[19] = toggleColumn;
|
|
255
|
-
$[20] = visibleColumns;
|
|
256
|
-
$[21] = t8;
|
|
257
|
-
} else t8 = $[21];
|
|
258
|
-
let t9;
|
|
259
|
-
if ($[25] !== t7 || $[26] !== t8) {
|
|
260
|
-
t9 = /* @__PURE__ */ jsx(SortableContext, {
|
|
261
|
-
items: t7,
|
|
262
|
-
strategy: verticalListSortingStrategy,
|
|
263
|
-
children: t8
|
|
264
|
-
});
|
|
265
|
-
$[25] = t7;
|
|
266
|
-
$[26] = t8;
|
|
267
|
-
$[27] = t9;
|
|
268
|
-
} else t9 = $[27];
|
|
269
|
-
let t10;
|
|
270
|
-
if ($[28] !== handleDragEnd || $[29] !== sensors || $[30] !== t9) {
|
|
271
|
-
t10 = /* @__PURE__ */ jsx(DndContext, {
|
|
272
|
-
sensors,
|
|
273
|
-
collisionDetection: closestCenter,
|
|
274
|
-
onDragEnd: handleDragEnd,
|
|
275
|
-
children: t9
|
|
276
|
-
});
|
|
277
|
-
$[28] = handleDragEnd;
|
|
278
|
-
$[29] = sensors;
|
|
279
|
-
$[30] = t9;
|
|
280
|
-
$[31] = t10;
|
|
281
|
-
} else t10 = $[31];
|
|
282
|
-
let t11;
|
|
283
|
-
if ($[32] !== orderedFields.length || $[33] !== t) {
|
|
284
|
-
t11 = orderedFields.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
285
|
-
className: "text-muted-foreground py-2 text-sm",
|
|
286
|
-
children: t("viewOptions.noFieldsAvailable")
|
|
287
|
-
});
|
|
288
|
-
$[32] = orderedFields.length;
|
|
289
|
-
$[33] = t;
|
|
290
|
-
$[34] = t11;
|
|
291
|
-
} else t11 = $[34];
|
|
292
|
-
let t12;
|
|
293
|
-
if ($[35] !== t10 || $[36] !== t11 || $[37] !== t6) {
|
|
294
|
-
t12 = /* @__PURE__ */ jsxs("div", {
|
|
295
|
-
className: "space-y-2 py-4",
|
|
296
|
-
children: [
|
|
297
|
-
t6,
|
|
298
|
-
t10,
|
|
299
|
-
t11
|
|
300
|
-
]
|
|
301
|
-
});
|
|
302
|
-
$[35] = t10;
|
|
303
|
-
$[36] = t11;
|
|
304
|
-
$[37] = t6;
|
|
305
|
-
$[38] = t12;
|
|
306
|
-
} else t12 = $[38];
|
|
307
|
-
return t12;
|
|
308
|
-
}
|
|
309
|
-
function _temp7(f_10) {
|
|
310
|
-
return f_10.name;
|
|
311
|
-
}
|
|
312
|
-
function _temp6(f_9) {
|
|
313
|
-
return f_9.name;
|
|
314
|
-
}
|
|
315
|
-
function _temp5(f_6) {
|
|
316
|
-
return f_6.name;
|
|
317
|
-
}
|
|
318
|
-
function _temp4(f_5) {
|
|
319
|
-
return f_5.name;
|
|
320
|
-
}
|
|
321
|
-
function _temp3(f_4) {
|
|
322
|
-
return f_4.name;
|
|
323
|
-
}
|
|
324
|
-
function _temp2(f_0) {
|
|
325
|
-
return f_0.name;
|
|
326
|
-
}
|
|
327
|
-
function _temp(f) {
|
|
328
|
-
return f.name;
|
|
102
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
103
|
+
className: "space-y-2 py-4",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx("p", {
|
|
106
|
+
className: "text-muted-foreground mb-4 text-xs",
|
|
107
|
+
children: t("viewOptions.columnsDragHint")
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(DndContext, {
|
|
110
|
+
sensors,
|
|
111
|
+
collisionDetection: closestCenter,
|
|
112
|
+
onDragEnd: handleDragEnd,
|
|
113
|
+
children: /* @__PURE__ */ jsx(SortableContext, {
|
|
114
|
+
items: orderedFields.map((f) => f.name),
|
|
115
|
+
strategy: verticalListSortingStrategy,
|
|
116
|
+
children: orderedFields.map((field) => /* @__PURE__ */ jsx(SortableColumnItem, {
|
|
117
|
+
field,
|
|
118
|
+
isVisible: visibleColumns.includes(field.name),
|
|
119
|
+
onToggle: () => toggleColumn(field.name)
|
|
120
|
+
}, field.name))
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
orderedFields.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
124
|
+
className: "text-muted-foreground py-2 text-sm",
|
|
125
|
+
children: t("viewOptions.noFieldsAvailable")
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
329
129
|
}
|
|
330
130
|
|
|
331
131
|
//#endregion
|