This commit is contained in:
ValueOn AG 2026-01-13 21:21:59 +01:00
parent 71666d2891
commit de98b863a0
2 changed files with 14 additions and 8 deletions

View file

@ -54,11 +54,11 @@ export interface FormGeneratorListProps<T = any> {
actionButtons?: {
type: 'edit' | 'delete' | 'download' | 'view' | 'copy' | 'connect' | 'play';
onAction?: (row: T) => Promise<void> | void;
disabled?: (row: T) => boolean | { disabled: boolean; message?: string };
loading?: (row: T) => boolean;
disabled?: (row: T, hookData?: any) => boolean | { disabled: boolean; message?: string };
loading?: (row: T, hookData?: any) => boolean;
title?: string | ((row: T) => string);
className?: string;
isProcessing?: (row: T) => boolean;
isProcessing?: (row: T, hookData?: any) => boolean;
idField?: string;
nameField?: string;
typeField?: string;
@ -69,6 +69,8 @@ export interface FormGeneratorListProps<T = any> {
refreshOperationName?: string;
loadingStateName?: string;
navigateTo?: string;
mode?: string; // Mode to set (e.g., 'prompt', 'workflow')
fetchItemFunctionName?: string; // Name of the function to fetch a single item (for edit button)
}[];
onDelete?: (row: T) => void;
onDeleteMultiple?: (rows: T[]) => void;

View file

@ -104,25 +104,29 @@ export interface FormGeneratorTableProps<T = any> {
onInlineUpdate?: (row: T, field: string, newValue: any) => Promise<void> | void; // Called when inline edit occurs
inlineEditingRows?: Set<string>; // Set of row IDs currently being edited (for loading state)
idField?: string; // Field name for unique row identifier (default: 'id')
// Standard action buttons (edit, delete, view, copy)
// Standard action buttons (edit, delete, view, copy, connect, play)
actionButtons?: {
type: 'edit' | 'delete' | 'view' | 'copy';
type: 'edit' | 'delete' | 'view' | 'copy' | 'connect' | 'play';
onAction?: (row: T) => Promise<void> | void; // Optional for delete buttons since they handle their own logic
disabled?: (row: T) => boolean | { disabled: boolean; message?: string };
loading?: (row: T) => boolean;
disabled?: (row: T, hookData?: any) => boolean | { disabled: boolean; message?: string };
loading?: (row: T, hookData?: any) => boolean;
title?: string | ((row: T) => string);
className?: string;
// For view buttons
isProcessing?: (row: T) => boolean;
isProcessing?: (row: T, hookData?: any) => boolean;
// Field mappings for flexible data access
idField?: string; // Field name for the unique identifier
nameField?: string; // Field name for display name
typeField?: string; // Field name for type/mime type
contentField?: string; // Field name for content (used by copy button)
statusField?: string; // Field name for status (used by connect action)
// Operation and loading state names
operationName?: string; // Name of the operation function in hookData
loadingStateName?: string; // Name of the loading state in hookData
fetchItemFunctionName?: string; // Name of the function to fetch a single item (for edit button)
// Navigation and mode (for play action)
navigateTo?: string; // Path to navigate to after action
mode?: string; // Mode to set (e.g., 'prompt', 'workflow')
}[];
// Custom action buttons (entity-specific actions like download, connect, play, sendPasswordLink)
customActions?: {