@nccirtu/tablefy 0.7.4 → 0.7.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.
@@ -4,5 +4,7 @@ export interface ConfirmOptions {
4
4
  confirmLabel?: string;
5
5
  cancelLabel?: string;
6
6
  variant?: "destructive" | "default";
7
+ icon?: React.ReactNode;
8
+ image?: string;
7
9
  }
8
10
  export type ConfirmHandler = (options: ConfirmOptions) => Promise<boolean>;
@@ -4,5 +4,7 @@ export interface ConfirmOptions {
4
4
  confirmLabel?: string;
5
5
  cancelLabel?: string;
6
6
  variant?: "destructive" | "default";
7
+ icon?: React.ReactNode;
8
+ image?: string;
7
9
  }
8
10
  export type ConfirmHandler = (options: ConfirmOptions) => Promise<boolean>;
package/dist/index.esm.js CHANGED
@@ -12,7 +12,7 @@ import { Badge } from '@/components/ui/badge';
12
12
  import { Checkbox } from '@/components/ui/checkbox';
13
13
  import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@/components/ui/tooltip';
14
14
  import { Progress } from '@/components/ui/progress';
15
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@/components/ui/dialog';
15
+ import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from '@/components/ui/alert-dialog';
16
16
 
17
17
  function DataTableHeader({ title, description, actions = [], search, searchValue = "", onSearchChange, table, selectedCount = 0, enableColumnVisibility = false, columnVisibilityLabel = "Spalten", className, }) {
18
18
  const normalActions = actions.filter((a) => !a.bulk && !a.hidden);
@@ -1750,7 +1750,10 @@ function ConfirmProvider({ children }) {
1750
1750
  setQueue((q) => q.slice(1));
1751
1751
  }
1752
1752
  };
1753
- return (jsxs(Fragment, { children: [children, jsx(Dialog, { open: !!currentRequest, onOpenChange: (open) => !open && handleCancel(), children: jsxs(DialogContent, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: currentRequest?.options?.title || "Bestätigung erforderlich" }), currentRequest?.options?.description && (jsx(DialogDescription, { children: currentRequest.options.description }))] }), jsxs(DialogFooter, { children: [jsx(Button, { variant: "outline", onClick: handleCancel, children: currentRequest?.options.cancelLabel || "Abbrechen" }), jsx(Button, { variant: currentRequest?.options.variant || "default", onClick: handleConfirm, children: currentRequest?.options.confirmLabel || "Bestätigen" })] })] }) })] }));
1753
+ const { title, description, confirmLabel, cancelLabel, variant, icon, image, } = currentRequest?.options || {};
1754
+ return (jsxs(Fragment, { children: [children, jsx(AlertDialog, { open: !!currentRequest, onOpenChange: (open) => !open && handleCancel(), children: jsxs(AlertDialogContent, { className: "max-w-md", children: [jsxs(AlertDialogHeader, { children: [image && (jsx("div", { className: "mb-4 flex justify-center", children: jsx("img", { src: image, alt: "Confirmation", className: "h-24 w-24 object-contain" }) })), icon && !image && (jsx("div", { className: "mb-4 flex justify-center text-6xl", children: icon })), jsx(AlertDialogTitle, { className: "text-center", children: title || "Bestätigung erforderlich" }), description && (jsx(AlertDialogDescription, { className: "text-center", children: description }))] }), jsxs(AlertDialogFooter, { className: "sm:justify-center", children: [jsx(AlertDialogCancel, { onClick: handleCancel, children: cancelLabel || "Abbrechen" }), jsx(AlertDialogAction, { onClick: handleConfirm, className: variant === "destructive"
1755
+ ? "bg-destructive text-destructive-foreground hover:bg-destructive/90"
1756
+ : "", children: confirmLabel || "Bestätigen" })] })] }) })] }));
1754
1757
  }
1755
1758
 
1756
1759
  export { AvatarGroupColumn, BadgeColumn, ButtonColumn, CheckboxColumn, ConfirmProvider, DataTable, DataTableSchema, DateColumn, DropdownColumn, EmptyStateBuilder, EnumColumn, IconColumn, ImageColumn, InputColumn, LinkColumn, NumberColumn, ProgressColumn, SelectColumn, TableSchema, AvatarGroupColumn as avatarGroupColumn, BadgeColumn as badgeColumn, ButtonColumn as buttonColumn, CheckboxColumn as checkboxColumn, confirm, DateColumn as dateColumn, DropdownColumn as dropdownColumn, EnumColumn as enumColumn, IconColumn as iconColumn, InputColumn as inputColumn };