@questpie/admin 3.2.4 → 3.2.6
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 +103 -230
- 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 +94 -296
- 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 -180
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
- 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 +61 -72
- 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 +285 -605
- 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 +176 -476
- package/dist/client/components/preview/live-preview-mode.mjs +233 -458
- 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 +229 -572
- package/dist/client/components/primitives/select-single.mjs +179 -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.mjs +63 -146
- 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.mjs +14 -36
- package/dist/client/preview/preview-banner.d.mts +2 -2
- 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 +167 -348
- package/dist/client/preview/use-collection-preview.mjs +121 -215
- 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.mjs +86 -321
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
- 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.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- 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 -379
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +116 -356
- 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 +58 -182
- package/dist/client/views/collection/form-view.mjs +284 -518
- package/dist/client/views/collection/table-view.mjs +231 -463
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -560
- 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 +477 -1301
- 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 +458 -1274
- 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.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.d.mts +2 -2
- 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.mjs +9 -33
- package/dist/server/adapters/index.d.mts +2 -0
- package/dist/server/adapters/nextjs.d.mts +1 -0
- package/dist/server/auth-helpers.d.mts +1 -0
- package/dist/server/modules/admin/.generated/module.d.mts +1 -0
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- 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 +39 -39
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +62 -62
- package/dist/server/modules/admin/collections/verification.d.mts +23 -23
- package/dist/server/modules/admin/index.d.mts +20 -19
- 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 +45 -45
- package/dist/server/modules/audit/.generated/module.d.mts +6 -6
- package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
- package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
- package/dist/server.d.mts +2 -0
- package/package.json +3 -5
|
@@ -6,7 +6,6 @@ import { resolveIconElement } from "../../components/component-renderer.mjs";
|
|
|
6
6
|
import { Button } from "../../components/ui/button.mjs";
|
|
7
7
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../components/ui/dropdown-menu.mjs";
|
|
8
8
|
import { ConfirmationDialog } from "../../components/actions/confirmation-dialog.mjs";
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
9
|
import { Icon } from "@iconify/react";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
import { useQueryClient } from "@tanstack/react-query";
|
|
@@ -46,10 +45,7 @@ function getSelectedIds(items) {
|
|
|
46
45
|
* )}
|
|
47
46
|
* ```
|
|
48
47
|
*/
|
|
49
|
-
function BulkActionToolbar(
|
|
50
|
-
const $ = c(83);
|
|
51
|
-
const { table, actions, collection, helpers, totalCount, pageCount, onOpenDialog, onSelectAllMatching, onBulkDelete, onBulkRestore, filterCount: t1, onClearFilters, onOpenFilters } = t0;
|
|
52
|
-
const filterCount = t1 === void 0 ? 0 : t1;
|
|
48
|
+
function BulkActionToolbar({ table, actions, collection, helpers, totalCount, pageCount, onOpenDialog, onSelectAllMatching, onBulkDelete, onBulkRestore, filterCount = 0, onClearFilters, onOpenFilters }) {
|
|
53
49
|
const { t } = useTranslation();
|
|
54
50
|
const resolveText = useResolveText();
|
|
55
51
|
const authClient = useAdminStore(selectAuthClient);
|
|
@@ -57,214 +53,139 @@ function BulkActionToolbar(t0) {
|
|
|
57
53
|
const [confirmAction, setConfirmAction] = React.useState(null);
|
|
58
54
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
59
55
|
const [isSelectingAll, setIsSelectingAll] = React.useState(false);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
$[0] = queryClient;
|
|
68
|
-
$[1] = t2;
|
|
69
|
-
} else t2 = $[1];
|
|
70
|
-
const actionQueryClient = t2;
|
|
71
|
-
let t3;
|
|
72
|
-
if ($[2] !== table) {
|
|
73
|
-
t3 = table.getSelectedRowModel();
|
|
74
|
-
$[2] = table;
|
|
75
|
-
$[3] = t3;
|
|
76
|
-
} else t3 = $[3];
|
|
77
|
-
const selectedRows = t3.rows;
|
|
78
|
-
let t4;
|
|
79
|
-
if ($[4] !== selectedRows) {
|
|
80
|
-
t4 = selectedRows.map(_temp);
|
|
81
|
-
$[4] = selectedRows;
|
|
82
|
-
$[5] = t4;
|
|
83
|
-
} else t4 = $[5];
|
|
84
|
-
const selectedItems = t4;
|
|
56
|
+
const actionQueryClient = React.useMemo(() => ({
|
|
57
|
+
invalidateQueries: (filters) => queryClient.invalidateQueries(filters),
|
|
58
|
+
refetchQueries: (filters) => queryClient.refetchQueries(filters),
|
|
59
|
+
resetQueries: (filters) => queryClient.resetQueries(filters)
|
|
60
|
+
}), [queryClient]);
|
|
61
|
+
const selectedRows = table.getSelectedRowModel().rows;
|
|
62
|
+
const selectedItems = React.useMemo(() => selectedRows.map((row) => row.original), [selectedRows]);
|
|
85
63
|
const selectedCount = selectedItems.length;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if ($[15] !== ctx) {
|
|
107
|
-
t7$1 = (action) => {
|
|
108
|
-
if (action.visible === void 0) return true;
|
|
109
|
-
if (typeof action.visible === "function") return action.visible(ctx);
|
|
110
|
-
return action.visible;
|
|
111
|
-
};
|
|
112
|
-
$[15] = ctx;
|
|
113
|
-
$[16] = t7$1;
|
|
114
|
-
} else t7$1 = $[16];
|
|
115
|
-
t6 = actions.filter(t7$1);
|
|
116
|
-
$[12] = actions;
|
|
117
|
-
$[13] = ctx;
|
|
118
|
-
$[14] = t6;
|
|
119
|
-
} else t6 = $[14];
|
|
120
|
-
const visibleActions = t6;
|
|
64
|
+
const ctx = React.useMemo(() => ({
|
|
65
|
+
item: selectedItems,
|
|
66
|
+
collection,
|
|
67
|
+
helpers,
|
|
68
|
+
queryClient: actionQueryClient,
|
|
69
|
+
authClient
|
|
70
|
+
}), [
|
|
71
|
+
selectedItems,
|
|
72
|
+
collection,
|
|
73
|
+
helpers,
|
|
74
|
+
actionQueryClient,
|
|
75
|
+
authClient
|
|
76
|
+
]);
|
|
77
|
+
const visibleActions = React.useMemo(() => {
|
|
78
|
+
return actions.filter((action) => {
|
|
79
|
+
if (action.visible === void 0) return true;
|
|
80
|
+
if (typeof action.visible === "function") return action.visible(ctx);
|
|
81
|
+
return action.visible;
|
|
82
|
+
});
|
|
83
|
+
}, [actions, ctx]);
|
|
121
84
|
const hasFilters = filterCount > 0;
|
|
122
85
|
const hasSelection = selectedCount > 0;
|
|
123
86
|
const isVisible = hasSelection || hasFilters;
|
|
124
87
|
if (!isVisible) return null;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
88
|
+
const executeBulkAction = async (action) => {
|
|
89
|
+
const { handler } = action;
|
|
90
|
+
if (action.id === "deleteMany" && onBulkDelete) {
|
|
91
|
+
setIsLoading(true);
|
|
92
|
+
const ids = getSelectedIds(selectedItems);
|
|
93
|
+
try {
|
|
94
|
+
await onBulkDelete(ids);
|
|
95
|
+
table.resetRowSelection();
|
|
96
|
+
setIsLoading(false);
|
|
97
|
+
} catch {
|
|
98
|
+
helpers.toast.error(t("collection.bulkDeleteError"));
|
|
99
|
+
setIsLoading(false);
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (action.id === "restoreMany" && onBulkRestore) {
|
|
104
|
+
setIsLoading(true);
|
|
105
|
+
const ids = getSelectedIds(selectedItems);
|
|
106
|
+
try {
|
|
107
|
+
await onBulkRestore(ids);
|
|
108
|
+
table.resetRowSelection();
|
|
109
|
+
setIsLoading(false);
|
|
110
|
+
} catch {
|
|
111
|
+
helpers.toast.error(t("collection.bulkRestoreError"));
|
|
112
|
+
setIsLoading(false);
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
switch (handler.type) {
|
|
117
|
+
case "api": {
|
|
130
118
|
setIsLoading(true);
|
|
131
119
|
const ids = getSelectedIds(selectedItems);
|
|
120
|
+
const method = handler.method ? handler.method : "POST";
|
|
132
121
|
try {
|
|
133
|
-
|
|
122
|
+
helpers.toast.info(`Bulk API call: ${method} ${handler.endpoint} (${ids.length} items)`);
|
|
123
|
+
helpers.refresh();
|
|
134
124
|
table.resetRowSelection();
|
|
135
125
|
setIsLoading(false);
|
|
136
126
|
} catch {
|
|
137
|
-
helpers.toast.error(t("collection.
|
|
127
|
+
helpers.toast.error(t("collection.bulkActionFailed"));
|
|
138
128
|
setIsLoading(false);
|
|
139
129
|
}
|
|
140
|
-
|
|
130
|
+
break;
|
|
141
131
|
}
|
|
142
|
-
|
|
132
|
+
case "custom":
|
|
143
133
|
setIsLoading(true);
|
|
144
|
-
const ids_0 = getSelectedIds(selectedItems);
|
|
145
134
|
try {
|
|
146
|
-
await
|
|
135
|
+
await handler.fn(ctx);
|
|
147
136
|
table.resetRowSelection();
|
|
148
137
|
setIsLoading(false);
|
|
149
138
|
} catch {
|
|
150
|
-
helpers.toast.error(t("collection.
|
|
139
|
+
helpers.toast.error(t("collection.bulkActionFailed"));
|
|
151
140
|
setIsLoading(false);
|
|
152
141
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
$[25] = t7;
|
|
201
|
-
} else t7 = $[25];
|
|
202
|
-
const executeBulkAction = t7;
|
|
203
|
-
let t8;
|
|
204
|
-
if ($[26] !== executeBulkAction) {
|
|
205
|
-
t8 = (action_1) => {
|
|
206
|
-
if (action_1.confirmation) setConfirmAction(action_1);
|
|
207
|
-
else executeBulkAction(action_1);
|
|
208
|
-
};
|
|
209
|
-
$[26] = executeBulkAction;
|
|
210
|
-
$[27] = t8;
|
|
211
|
-
} else t8 = $[27];
|
|
212
|
-
const handleActionClick = t8;
|
|
213
|
-
let t9;
|
|
214
|
-
if ($[28] !== confirmAction || $[29] !== executeBulkAction) {
|
|
215
|
-
t9 = async () => {
|
|
216
|
-
if (confirmAction) {
|
|
217
|
-
await executeBulkAction(confirmAction);
|
|
218
|
-
setConfirmAction(null);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
$[28] = confirmAction;
|
|
222
|
-
$[29] = executeBulkAction;
|
|
223
|
-
$[30] = t9;
|
|
224
|
-
} else t9 = $[30];
|
|
225
|
-
const handleConfirm = t9;
|
|
226
|
-
let t10;
|
|
227
|
-
if ($[31] !== onSelectAllMatching) {
|
|
228
|
-
t10 = async () => {
|
|
229
|
-
if (!onSelectAllMatching) return;
|
|
230
|
-
setIsSelectingAll(true);
|
|
231
|
-
try {
|
|
232
|
-
await onSelectAllMatching();
|
|
233
|
-
setIsSelectingAll(false);
|
|
234
|
-
} catch (t11$1) {
|
|
235
|
-
const _err = t11$1;
|
|
236
|
-
setIsSelectingAll(false);
|
|
237
|
-
throw _err;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
$[31] = onSelectAllMatching;
|
|
241
|
-
$[32] = t10;
|
|
242
|
-
} else t10 = $[32];
|
|
243
|
-
const handleSelectAllMatching = t10;
|
|
244
|
-
let t11;
|
|
245
|
-
if ($[33] !== ctx) {
|
|
246
|
-
t11 = (action_2) => {
|
|
247
|
-
if (action_2.disabled === void 0) return false;
|
|
248
|
-
if (typeof action_2.disabled === "function") return action_2.disabled(ctx);
|
|
249
|
-
return action_2.disabled;
|
|
250
|
-
};
|
|
251
|
-
$[33] = ctx;
|
|
252
|
-
$[34] = t11;
|
|
253
|
-
} else t11 = $[34];
|
|
254
|
-
const isDisabled = t11;
|
|
255
|
-
let t12;
|
|
256
|
-
let t13;
|
|
257
|
-
let t14;
|
|
258
|
-
let t15;
|
|
259
|
-
let t16;
|
|
260
|
-
if ($[35] !== filterCount || $[36] !== handleActionClick || $[37] !== handleSelectAllMatching || $[38] !== hasFilters || $[39] !== hasSelection || $[40] !== isDisabled || $[41] !== isLoading || $[42] !== isSelectingAll || $[43] !== isVisible || $[44] !== onClearFilters || $[45] !== onOpenFilters || $[46] !== onSelectAllMatching || $[47] !== pageCount || $[48] !== resolveText || $[49] !== selectedCount || $[50] !== t || $[51] !== table || $[52] !== totalCount || $[53] !== visibleActions) {
|
|
261
|
-
const regularActions = visibleActions.filter(_temp2);
|
|
262
|
-
const destructiveActions = visibleActions.filter(_temp3);
|
|
263
|
-
t15 = isVisible ? "open" : "closed";
|
|
264
|
-
t16 = "qa-bulk-toolbar fixed bottom-6 left-1/2 z-50 max-w-[calc(100%-2rem)] -translate-x-1/2 transition-[opacity,translate,scale] duration-[var(--motion-duration-slow)] ease-[var(--motion-ease-enter)] data-[state=closed]:pointer-events-none data-[state=closed]:translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0 data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100 motion-reduce:transition-none sm:max-w-none";
|
|
265
|
-
t12 = "qa-bulk-toolbar__bar bg-background border-border flex items-center gap-2 overflow-x-auto rounded-full border px-3 py-2 shadow-lg transition-[gap,padding] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] sm:gap-3 sm:px-4 sm:py-2.5";
|
|
266
|
-
if ($[59] !== filterCount || $[60] !== hasFilters || $[61] !== hasSelection || $[62] !== onClearFilters || $[63] !== onOpenFilters || $[64] !== t) {
|
|
267
|
-
t13 = hasFilters && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
142
|
+
break;
|
|
143
|
+
case "dialog":
|
|
144
|
+
case "form":
|
|
145
|
+
onOpenDialog?.(action, selectedItems);
|
|
146
|
+
break;
|
|
147
|
+
case "navigate":
|
|
148
|
+
helpers.toast.error("Navigate action not supported for bulk operations");
|
|
149
|
+
break;
|
|
150
|
+
case "server":
|
|
151
|
+
onOpenDialog?.(action, selectedItems);
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const handleActionClick = (action) => {
|
|
156
|
+
if (action.confirmation) setConfirmAction(action);
|
|
157
|
+
else executeBulkAction(action);
|
|
158
|
+
};
|
|
159
|
+
const handleConfirm = async () => {
|
|
160
|
+
if (confirmAction) {
|
|
161
|
+
await executeBulkAction(confirmAction);
|
|
162
|
+
setConfirmAction(null);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const handleSelectAllMatching = async () => {
|
|
166
|
+
if (!onSelectAllMatching) return;
|
|
167
|
+
setIsSelectingAll(true);
|
|
168
|
+
try {
|
|
169
|
+
await onSelectAllMatching();
|
|
170
|
+
setIsSelectingAll(false);
|
|
171
|
+
} catch (_err) {
|
|
172
|
+
setIsSelectingAll(false);
|
|
173
|
+
throw _err;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const isDisabled = (action) => {
|
|
177
|
+
if (action.disabled === void 0) return false;
|
|
178
|
+
if (typeof action.disabled === "function") return action.disabled(ctx);
|
|
179
|
+
return action.disabled;
|
|
180
|
+
};
|
|
181
|
+
const regularActions = visibleActions.filter((a) => a.variant !== "destructive");
|
|
182
|
+
const destructiveActions = visibleActions.filter((a) => a.variant === "destructive");
|
|
183
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
184
|
+
"data-state": isVisible ? "open" : "closed",
|
|
185
|
+
className: "qa-bulk-toolbar fixed bottom-6 left-1/2 z-50 max-w-[calc(100%-2rem)] -translate-x-1/2 transition-[opacity,translate,scale] duration-[var(--motion-duration-slow)] ease-[var(--motion-ease-enter)] data-[state=closed]:pointer-events-none data-[state=closed]:translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0 data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100 motion-reduce:transition-none sm:max-w-none",
|
|
186
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
187
|
+
className: "qa-bulk-toolbar__bar bg-background border-border flex items-center gap-2 overflow-x-auto rounded-full border px-3 py-2 shadow-lg transition-[gap,padding] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] sm:gap-3 sm:px-4 sm:py-2.5",
|
|
188
|
+
children: [hasFilters && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
268
189
|
className: "flex shrink-0 items-center gap-2",
|
|
269
190
|
children: [onOpenFilters ? /* @__PURE__ */ jsxs(Button, {
|
|
270
191
|
variant: "ghost",
|
|
@@ -295,197 +216,109 @@ function BulkActionToolbar(t0) {
|
|
|
295
216
|
}), hasSelection && /* @__PURE__ */ jsx("div", {
|
|
296
217
|
className: "qa-bulk-toolbar__divider bg-border h-4 w-px shrink-0",
|
|
297
218
|
"aria-hidden": "true"
|
|
298
|
-
})] })
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
$[62] = onClearFilters;
|
|
303
|
-
$[63] = onOpenFilters;
|
|
304
|
-
$[64] = t;
|
|
305
|
-
$[65] = t13;
|
|
306
|
-
} else t13 = $[65];
|
|
307
|
-
t14 = hasSelection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
308
|
-
/* @__PURE__ */ jsx("span", {
|
|
309
|
-
className: "shrink-0 text-sm font-medium whitespace-nowrap",
|
|
310
|
-
children: t("collection.selected", { count: selectedCount })
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ jsx("div", {
|
|
313
|
-
className: "qa-bulk-toolbar__divider bg-border h-4 w-px shrink-0",
|
|
314
|
-
"aria-hidden": "true"
|
|
315
|
-
}),
|
|
316
|
-
/* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
317
|
-
nativeButton: false,
|
|
318
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
319
|
-
variant: "ghost",
|
|
320
|
-
size: "sm",
|
|
321
|
-
className: "h-7 shrink-0 gap-1 px-2"
|
|
219
|
+
})] }), hasSelection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
/* @__PURE__ */ jsx("span", {
|
|
221
|
+
className: "shrink-0 text-sm font-medium whitespace-nowrap",
|
|
222
|
+
children: t("collection.selected", { count: selectedCount })
|
|
322
223
|
}),
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
334
|
-
onClick: () => table.toggleAllPageRowsSelected(true),
|
|
335
|
-
children: [t("collection.selectOnPage"), pageCount ? ` (${pageCount})` : ""]
|
|
224
|
+
/* @__PURE__ */ jsx("div", {
|
|
225
|
+
className: "qa-bulk-toolbar__divider bg-border h-4 w-px shrink-0",
|
|
226
|
+
"aria-hidden": "true"
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
229
|
+
nativeButton: false,
|
|
230
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
231
|
+
variant: "ghost",
|
|
232
|
+
size: "sm",
|
|
233
|
+
className: "h-7 shrink-0 gap-1 px-2"
|
|
336
234
|
}),
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
235
|
+
disabled: isSelectingAll,
|
|
236
|
+
children: [t("common.selectAll").split(" ")[0], /* @__PURE__ */ jsx(Icon, {
|
|
237
|
+
icon: "ph:caret-down",
|
|
238
|
+
className: "size-3"
|
|
239
|
+
})]
|
|
240
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
241
|
+
align: "center",
|
|
242
|
+
side: "top",
|
|
243
|
+
sideOffset: 8,
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
246
|
+
onClick: () => table.toggleAllPageRowsSelected(true),
|
|
247
|
+
children: [t("collection.selectOnPage"), pageCount ? ` (${pageCount})` : ""]
|
|
248
|
+
}),
|
|
249
|
+
onSelectAllMatching && totalCount && totalCount > (pageCount ?? 0) && /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
250
|
+
onClick: handleSelectAllMatching,
|
|
251
|
+
children: t("collection.selectAllMatching", { count: totalCount })
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
254
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
255
|
+
onClick: () => table.resetRowSelection(),
|
|
256
|
+
children: t("collection.clearSelection")
|
|
257
|
+
})
|
|
258
|
+
]
|
|
259
|
+
})] }),
|
|
260
|
+
visibleActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
261
|
+
nativeButton: false,
|
|
262
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
263
|
+
variant: "outline",
|
|
264
|
+
size: "sm",
|
|
265
|
+
className: "h-7 shrink-0 gap-1 px-2"
|
|
340
266
|
}),
|
|
341
|
-
|
|
342
|
-
/* @__PURE__ */ jsx(
|
|
343
|
-
|
|
267
|
+
disabled: isLoading,
|
|
268
|
+
children: [t("common.actions"), /* @__PURE__ */ jsx(Icon, {
|
|
269
|
+
icon: "ph:caret-down",
|
|
270
|
+
className: "size-3"
|
|
271
|
+
})]
|
|
272
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
273
|
+
align: "center",
|
|
274
|
+
side: "top",
|
|
275
|
+
sideOffset: 8,
|
|
276
|
+
children: [
|
|
277
|
+
regularActions.map((action) => {
|
|
278
|
+
const iconElement = resolveIconElement(action.icon, { className: "mr-2 size-4" });
|
|
279
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
280
|
+
onClick: () => handleActionClick(action),
|
|
281
|
+
disabled: isDisabled(action) || isLoading,
|
|
282
|
+
children: [iconElement, resolveText(action.label)]
|
|
283
|
+
}, action.id);
|
|
284
|
+
}),
|
|
285
|
+
regularActions.length > 0 && destructiveActions.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
286
|
+
destructiveActions.map((action) => {
|
|
287
|
+
const iconElement = resolveIconElement(action.icon, { className: "mr-2 size-4" });
|
|
288
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
289
|
+
variant: "destructive",
|
|
290
|
+
onClick: () => handleActionClick(action),
|
|
291
|
+
disabled: isDisabled(action) || isLoading,
|
|
292
|
+
children: [iconElement, resolveText(action.label)]
|
|
293
|
+
}, action.id);
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
})] }),
|
|
297
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
298
|
+
variant: "ghost",
|
|
299
|
+
size: "icon-sm",
|
|
300
|
+
onClick: () => table.resetRowSelection(),
|
|
301
|
+
className: "size-7 shrink-0",
|
|
302
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
303
|
+
icon: "ph:x",
|
|
304
|
+
className: "size-4"
|
|
305
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
306
|
+
className: "sr-only",
|
|
344
307
|
children: t("collection.clearSelection")
|
|
345
|
-
})
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
})]
|
|
360
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
361
|
-
align: "center",
|
|
362
|
-
side: "top",
|
|
363
|
-
sideOffset: 8,
|
|
364
|
-
children: [
|
|
365
|
-
regularActions.map((action_3) => {
|
|
366
|
-
const iconElement = resolveIconElement(action_3.icon, { className: "mr-2 size-4" });
|
|
367
|
-
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
368
|
-
onClick: () => handleActionClick(action_3),
|
|
369
|
-
disabled: isDisabled(action_3) || isLoading,
|
|
370
|
-
children: [iconElement, resolveText(action_3.label)]
|
|
371
|
-
}, action_3.id);
|
|
372
|
-
}),
|
|
373
|
-
regularActions.length > 0 && destructiveActions.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
374
|
-
destructiveActions.map((action_4) => {
|
|
375
|
-
const iconElement_0 = resolveIconElement(action_4.icon, { className: "mr-2 size-4" });
|
|
376
|
-
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
377
|
-
variant: "destructive",
|
|
378
|
-
onClick: () => handleActionClick(action_4),
|
|
379
|
-
disabled: isDisabled(action_4) || isLoading,
|
|
380
|
-
children: [iconElement_0, resolveText(action_4.label)]
|
|
381
|
-
}, action_4.id);
|
|
382
|
-
})
|
|
383
|
-
]
|
|
384
|
-
})] }),
|
|
385
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
386
|
-
variant: "ghost",
|
|
387
|
-
size: "icon-sm",
|
|
388
|
-
onClick: () => table.resetRowSelection(),
|
|
389
|
-
className: "size-7 shrink-0",
|
|
390
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
391
|
-
icon: "ph:x",
|
|
392
|
-
className: "size-4"
|
|
393
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
394
|
-
className: "sr-only",
|
|
395
|
-
children: t("collection.clearSelection")
|
|
396
|
-
})]
|
|
397
|
-
})
|
|
398
|
-
] });
|
|
399
|
-
$[35] = filterCount;
|
|
400
|
-
$[36] = handleActionClick;
|
|
401
|
-
$[37] = handleSelectAllMatching;
|
|
402
|
-
$[38] = hasFilters;
|
|
403
|
-
$[39] = hasSelection;
|
|
404
|
-
$[40] = isDisabled;
|
|
405
|
-
$[41] = isLoading;
|
|
406
|
-
$[42] = isSelectingAll;
|
|
407
|
-
$[43] = isVisible;
|
|
408
|
-
$[44] = onClearFilters;
|
|
409
|
-
$[45] = onOpenFilters;
|
|
410
|
-
$[46] = onSelectAllMatching;
|
|
411
|
-
$[47] = pageCount;
|
|
412
|
-
$[48] = resolveText;
|
|
413
|
-
$[49] = selectedCount;
|
|
414
|
-
$[50] = t;
|
|
415
|
-
$[51] = table;
|
|
416
|
-
$[52] = totalCount;
|
|
417
|
-
$[53] = visibleActions;
|
|
418
|
-
$[54] = t12;
|
|
419
|
-
$[55] = t13;
|
|
420
|
-
$[56] = t14;
|
|
421
|
-
$[57] = t15;
|
|
422
|
-
$[58] = t16;
|
|
423
|
-
} else {
|
|
424
|
-
t12 = $[54];
|
|
425
|
-
t13 = $[55];
|
|
426
|
-
t14 = $[56];
|
|
427
|
-
t15 = $[57];
|
|
428
|
-
t16 = $[58];
|
|
429
|
-
}
|
|
430
|
-
let t17;
|
|
431
|
-
if ($[66] !== t12 || $[67] !== t13 || $[68] !== t14) {
|
|
432
|
-
t17 = /* @__PURE__ */ jsxs("div", {
|
|
433
|
-
className: t12,
|
|
434
|
-
children: [t13, t14]
|
|
435
|
-
});
|
|
436
|
-
$[66] = t12;
|
|
437
|
-
$[67] = t13;
|
|
438
|
-
$[68] = t14;
|
|
439
|
-
$[69] = t17;
|
|
440
|
-
} else t17 = $[69];
|
|
441
|
-
let t18;
|
|
442
|
-
if ($[70] !== t15 || $[71] !== t16 || $[72] !== t17) {
|
|
443
|
-
t18 = /* @__PURE__ */ jsx("div", {
|
|
444
|
-
"data-state": t15,
|
|
445
|
-
className: t16,
|
|
446
|
-
children: t17
|
|
447
|
-
});
|
|
448
|
-
$[70] = t15;
|
|
449
|
-
$[71] = t16;
|
|
450
|
-
$[72] = t17;
|
|
451
|
-
$[73] = t18;
|
|
452
|
-
} else t18 = $[73];
|
|
453
|
-
let t19;
|
|
454
|
-
if ($[74] !== confirmAction || $[75] !== handleConfirm || $[76] !== isLoading || $[77] !== resolveText || $[78] !== selectedCount) {
|
|
455
|
-
t19 = confirmAction?.confirmation && /* @__PURE__ */ jsx(ConfirmationDialog, {
|
|
456
|
-
open: !!confirmAction,
|
|
457
|
-
onOpenChange: (open) => !open && setConfirmAction(null),
|
|
458
|
-
config: {
|
|
459
|
-
...confirmAction.confirmation,
|
|
460
|
-
description: confirmAction.confirmation.description ? `${resolveText(confirmAction.confirmation.description)} (${selectedCount} items)` : `This will affect ${selectedCount} items.`
|
|
461
|
-
},
|
|
462
|
-
onConfirm: handleConfirm,
|
|
463
|
-
loading: isLoading
|
|
464
|
-
});
|
|
465
|
-
$[74] = confirmAction;
|
|
466
|
-
$[75] = handleConfirm;
|
|
467
|
-
$[76] = isLoading;
|
|
468
|
-
$[77] = resolveText;
|
|
469
|
-
$[78] = selectedCount;
|
|
470
|
-
$[79] = t19;
|
|
471
|
-
} else t19 = $[79];
|
|
472
|
-
let t20;
|
|
473
|
-
if ($[80] !== t18 || $[81] !== t19) {
|
|
474
|
-
t20 = /* @__PURE__ */ jsxs(Fragment, { children: [t18, t19] });
|
|
475
|
-
$[80] = t18;
|
|
476
|
-
$[81] = t19;
|
|
477
|
-
$[82] = t20;
|
|
478
|
-
} else t20 = $[82];
|
|
479
|
-
return t20;
|
|
480
|
-
}
|
|
481
|
-
function _temp3(a_0) {
|
|
482
|
-
return a_0.variant === "destructive";
|
|
483
|
-
}
|
|
484
|
-
function _temp2(a) {
|
|
485
|
-
return a.variant !== "destructive";
|
|
486
|
-
}
|
|
487
|
-
function _temp(row) {
|
|
488
|
-
return row.original;
|
|
308
|
+
})]
|
|
309
|
+
})
|
|
310
|
+
] })]
|
|
311
|
+
})
|
|
312
|
+
}), confirmAction?.confirmation && /* @__PURE__ */ jsx(ConfirmationDialog, {
|
|
313
|
+
open: !!confirmAction,
|
|
314
|
+
onOpenChange: (open) => !open && setConfirmAction(null),
|
|
315
|
+
config: {
|
|
316
|
+
...confirmAction.confirmation,
|
|
317
|
+
description: confirmAction.confirmation.description ? `${resolveText(confirmAction.confirmation.description)} (${selectedCount} items)` : `This will affect ${selectedCount} items.`
|
|
318
|
+
},
|
|
319
|
+
onConfirm: handleConfirm,
|
|
320
|
+
loading: isLoading
|
|
321
|
+
})] });
|
|
489
322
|
}
|
|
490
323
|
|
|
491
324
|
//#endregion
|