/**
 * Collaboration form data table component
 * Provides a dynamic data table with inline editing, configurable columns,
 * validation, file uploads, and aggregation support
 */
import React from 'react';
import type { FormFileAttachment } from '../types/file_attachment.js';
import { type CollabFormFieldBaseProps, type FileData, type NoteEntry } from './hazo_collab_form_base.js';
/**
 * Column field types supported by the data table
 */
export type DataTableFieldType = 'text' | 'numeric' | 'dropdown' | 'files' | 'checkbox' | 'radiobutton' | 'date' | 'currency' | 'percentage';
/**
 * Aggregation types for column totals
 */
export type AggregationType = 'sum' | 'average' | 'count' | 'none';
/**
 * Option type for dropdown/radio columns
 */
export interface DataTableOption {
    label: string;
    value: string;
}
/**
 * Header styling configuration
 */
export interface HeaderStyling {
    bold?: boolean;
    italic?: boolean;
    size?: string;
    color?: string;
}
/**
 * Constraints for field validation
 */
export interface ColumnConstraints {
    min?: number;
    max?: number;
    length?: number;
    regex?: string;
    required?: boolean;
    num_decimals?: number;
}
/**
 * File upload configuration for files column
 */
export interface FilesColumnConfig {
    target_path: string;
    max_files?: number;
    file_accept?: string;
    max_size?: number;
}
/**
 * Aggregation configuration
 */
export interface AggregationConfig {
    type: AggregationType;
    label?: string;
}
/**
 * Tooltip configuration using shadcn HoverCard
 */
export interface TooltipConfig {
    enabled: boolean;
    title?: string;
    content: string;
}
/**
 * Column configuration
 */
export interface DataTableColumn {
    /**
     * Unique identifier for the column
     */
    id: string;
    /**
     * Display label for the column header
     */
    label: string;
    /**
     * Field type for the column cells
     */
    field_type: DataTableFieldType;
    /**
     * Whether cells in this column are editable
     * Default: true
     */
    editable?: boolean;
    /**
     * Background color class for cells (Tailwind class)
     */
    background_color?: string;
    /**
     * Header styling configuration
     */
    header_styling?: HeaderStyling;
    /**
     * Width class for the column (Tailwind class, e.g., 'w-32', 'w-48')
     */
    width?: string;
    /**
     * Validation constraints for text/numeric fields
     */
    constraints?: ColumnConstraints;
    /**
     * Options for dropdown/radiobutton fields
     */
    options?: DataTableOption[];
    /**
     * File upload configuration for files field type
     */
    files_config?: FilesColumnConfig;
    /**
     * Aggregation configuration for subtotal row
     */
    aggregation?: AggregationConfig;
    /**
     * Tooltip configuration for column header
     */
    tooltip?: TooltipConfig;
    /**
     * Default value for new rows in this column
     */
    default_value?: string | number | boolean;
}
/**
 * Table configuration
 */
export interface DataTableConfig {
    /**
     * Array of column definitions
     */
    columns: DataTableColumn[];
    /**
     * Whether to show add row button
     * Default: true
     */
    allow_add_row?: boolean;
    /**
     * Whether to show delete row button on each row
     * Default: true
     */
    allow_delete_row?: boolean;
    /**
     * Whether to show row numbers column
     * Default: false
     */
    show_row_numbers?: boolean;
    /**
     * Whether to show subtotal/aggregation row at bottom
     * Default: true (if any column has aggregation configured)
     */
    show_subtotal_row?: boolean;
    /**
     * Message to display when table has no rows
     */
    empty_message?: string;
    /**
     * Maximum number of rows allowed
     */
    max_rows?: number;
    /**
     * Whether to enable row-level collaboration features (chat, notes, data-ok)
     * Default: true
     */
    enable_row_collab?: boolean;
    /**
     * Whether to show file icon per row in the actions column.
     * Requires file_manager to be provided on the parent component.
     * Default: false
     */
    enable_row_files?: boolean;
    /**
     * Maximum number of files per row (when enable_row_files is true).
     * Default: 10
     */
    max_row_files?: number;
}
/**
 * Row data structure
 */
export interface DataTableRow {
    /**
     * Unique identifier for the row (auto-generated)
     */
    _row_id: string;
    /**
     * Row-level data-ok state
     */
    _data_ok?: boolean;
    /**
     * Row-level files data (keyed by column id)
     */
    _files?: Record<string, FileData[]>;
    /**
     * Whether this row has chat messages (for highlighting)
     */
    _has_chat_messages?: boolean;
    /**
     * Row-level notes entries
     */
    _notes?: NoteEntry[];
    /**
     * Whether this row has notes
     */
    _has_notes?: boolean;
    /**
     * Row-level file attachments (e.g. source documents linked by autofill)
     */
    _row_files?: FormFileAttachment[];
    /**
     * Dynamic column values
     */
    [column_id: string]: any;
}
/**
 * Props for HazoCollabFormDataTable
 */
export interface HazoCollabFormDataTableProps extends CollabFormFieldBaseProps {
    /**
     * Table configuration (columns, settings)
     */
    table_config: DataTableConfig;
    /**
     * Current table data (array of rows)
     */
    value: DataTableRow[];
    /**
     * Callback when table data changes
     */
    onChange: (rows: DataTableRow[]) => void;
    /**
     * Custom className for the table element
     */
    table_class_name?: string;
    /**
     * Custom className for header row
     */
    header_class_name?: string;
    /**
     * Custom className for data rows
     */
    row_class_name?: string;
    /**
     * Custom className for cells
     */
    cell_class_name?: string;
    /**
     * Whether the entire table is disabled
     */
    disabled?: boolean;
    /**
     * Callback when row-level chat icon is clicked
     * Receives the row_id and row_index
     */
    on_row_chat_click?: (row_id: string, row_index: number) => void;
    /**
     * Callback when row-level notes change
     * Receives the row_id and notes entries
     */
    on_row_notes_change?: (row_id: string, notes: NoteEntry[]) => void;
}
/**
 * Exposed methods for HazoCollabFormDataTable
 */
export interface HazoCollabFormDataTableRef {
    /**
     * Get all file data from the table
     */
    get_file_data: () => FileData[];
    /**
     * Add a new row to the table
     */
    add_row: () => void;
    /**
     * Delete a row by its row ID
     */
    delete_row: (row_id: string) => void;
    /**
     * Get computed aggregation values
     */
    get_aggregations: () => Record<string, number>;
}
/**
 * Collaboration form data table component
 */
export declare const HazoCollabFormDataTable: React.ForwardRefExoticComponent<HazoCollabFormDataTableProps & React.RefAttributes<HazoCollabFormDataTableRef>>;
//# sourceMappingURL=hazo_collab_form_data_table.d.ts.map