import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React$1 from 'react'; import React__default, { ReactNode, SVGProps } from 'react'; import { D as DialogMode, B as BaseTableData, a as DialogType, T as TableColumn, E as ExportConfig, b as ExportFormat, c as TableSize, d as TableThemeConfig, F as FilterConfig, U as UseDataTableOptions, e as UseDataTableReturn, f as DataTableProps, L as LoadingType$1, g as TableProps, C as ColumnAlignment, S as SortDirection, h as DialogConfig, i as LoadingVariant$1, j as SpinnerType, k as SpinnerSize } from './index-DD0L7oC3.cjs'; export { v as ActionConfig, A as ActionPosition, Z as AppendableDialogProps, w as BuiltInActionsConfig, x as BulkActionConfig, o as ButtonVariant, q as ColorScheme, Q as ColumnVisibilityToggleProps, l as DataTableFormProps, _ as DataTableLocalization, X as DataTableState, H as EventHandlersConfig, J as ExportOptions, s as FilterOption, n as FilterType, a1 as FormAPI, $ as FormLibraryIntegration, G as GlobalSearchConfig, y as LoadingConfig, P as PaginationConfig, W as PersistStateOptions, R as RowExpansionConfig, t as SelectionConfig, z as ServerDataConfig, V as ServerSideFetchOptions, u as SortConfig, m as SortingState, r as StickyPosition, Y as TableDialogProps, O as TableHeaderProps, N as TablePaginationProps, p as TablePosition, a0 as TableToolbarProps, K as UseColumnVisibilityOptions, M as UseColumnVisibilityReturn, I as UseTableExportOptions } from './index-DD0L7oC3.cjs'; import { HTMLMotionProps } from 'framer-motion'; import { HeaderGroup, Header } from '@tanstack/react-table'; export { ColumnFiltersState, ExpandedState, PaginationState, RowSelectionState, VisibilityState } from '@tanstack/react-table'; type FormRef = React__default.RefObject; interface FormAPI { getValues: () => Record; getValidatedValues: () => Promise>; reset: (values?: Record) => void; validate: () => Promise; isDirty: () => boolean; isValid: () => boolean; getErrors: () => Record; setError?: (field: string, message: string) => void; submit?: () => Promise; } interface FormHandlingContextType { registerForm: (type: DialogMode, api: FormAPI) => void; unregisterForm: (type: DialogMode) => void; isFormDirty: (type: DialogMode) => boolean; isFormValid: (type: DialogMode) => boolean; getFormValues: (type: DialogMode) => Record; getFormErrors: (type: DialogMode) => Record; setFormDirty: (isDirty: boolean, type: DialogMode) => void; setFormValid: (isValid: boolean, type: DialogMode) => void; setFormErrors: (errors: Record, type: DialogMode) => void; resetForm: (type: DialogMode, values?: Record) => void; validateForm: (type: DialogMode) => Promise; validateAndGetFormData: (type: DialogMode) => Promise<{ isValid: boolean; data: Record | null; errors: Record | null; }>; submitForm: (type: DialogMode) => Promise; activeFormType: DialogMode | null; setActiveFormType: (type: DialogMode | null) => void; } /** * Provider component for form handling functionality */ declare function FormHandlingProvider({ children }: { children: ReactNode; }): react_jsx_runtime.JSX.Element; /** * Hook to access the form handling context * @throws Error if used outside FormHandlingProvider */ declare const useFormHandling: () => FormHandlingContextType; /** * Higher-order component to wrap form components * Works with both regular components and ref-forwarded components */ declare function withFormHandling

(Component: React__default.ComponentType

, formType: DialogMode): { (props: P): react_jsx_runtime.JSX.Element; displayName: string; }; interface DialogState$1 { open: boolean; type?: DialogType; title?: string; description?: string; data?: T | null; loading: boolean; error: Error | string | null; } interface UseTableDialogReturn { open: boolean; dialogType: DialogType | null; dialogData?: T | null; dialogTitle?: string; dialogDescription?: string; loading: boolean; error: Error | string | null; openCreateDialog: (data?: T, title?: string, description?: string) => void; openEditDialog: (data: T, title?: string, description?: string) => void; openViewDialog: (data: T, title?: string, description?: string) => void; openDeleteDialog: (data: T, title?: string, description?: string) => void; openCustomDialog: (type: string, data: any, title?: string, description?: string) => void; closeDialog: () => void; submitDialog: (data: any, type: DialogType | null) => Promise; } interface UseTableDialogProps { onSubmit?: (data: any, type: DialogType | null) => Promise | boolean; onClose?: () => void; initialState?: Partial>; } /** * useTableDialog - Hook for managing dialog state and actions */ declare function useTableDialog({ onSubmit, onClose, initialState }?: UseTableDialogProps): UseTableDialogReturn; interface DialogState { open: boolean; type?: DialogType; title?: string; description?: string; data?: T | null; loading: boolean; error: Error | string | null; } interface UseOptimizedDialogReturn { dialogState: DialogState; openCreateDialog: (data?: Partial, title?: string, description?: string) => void; openEditDialog: (data: T, title?: string, description?: string) => void; openViewDialog: (data: T, title?: string, description?: string) => void; openDeleteDialog: (data: T, title?: string, description?: string) => void; openCustomDialog: (type: string, data: any, title?: string, description?: string) => void; closeDialog: () => void; setDialogLoading: (loading: boolean) => void; setDialogError: (error: Error | string | null) => void; submitDialog: (data: any, type: DialogType) => Promise; } /** * useOptimizedDialog - A hook to manage dialog state with improved performance * * @param onSubmit Callback function when dialog form is submitted */ declare function useOptimizedDialog(onSubmit?: (data: any, type: DialogType) => Promise | boolean): UseOptimizedDialogReturn; interface UseTableExportOptions { data: T[]; columns: TableColumn[]; filteredData?: T[]; filename?: string; title?: string; exportConfig?: ExportConfig | boolean; } interface ExportOptions { includeHeaders?: boolean; customHeaders?: Record; dateFormat?: string; numberFormat?: string; filterData?: (data: T[]) => T[]; data?: T[]; } declare function useTableExport({ data, columns, filteredData, filename, title, exportConfig, }: UseTableExportOptions): { exportData: (format: ExportFormat, options?: ExportOptions) => void; exportToCSV: (options?: ExportOptions) => void; exportToExcel: (options?: ExportOptions) => void; exportToPDF: (options?: ExportOptions) => void; getPreviewData: (options?: ExportOptions) => { headers: string[]; rows: string[][]; data: T[]; }; availableFormats: ExportFormat[]; exportableColumns: TableColumn[]; exportSelected: (format: ExportFormat, selectedRows: T[]) => void; exportCurrentView: (format: ExportFormat) => void; showSelectedOnly: boolean; }; interface TableSettings { size?: TableSize; theme?: string; variant?: 'default' | 'modern' | 'minimal' | 'bordered'; colorScheme?: 'default' | 'primary' | 'neutral' | 'custom'; borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'full'; striped?: boolean; bordered?: boolean; hover?: boolean; sticky?: boolean; emptyState?: { title?: string; message?: string; action?: React.ReactNode; }; } interface UseTableSettingsOptions { tableId?: string; initialSettings?: Partial; persistKey?: string; onChange?: (settings: TableSettings) => void; /** * When true, uses current URL pathname as part of the storage key * @default true */ useUrlAsKey?: boolean; /** * Custom identifier for this table when multiple tables exist on the same page */ tableIdentifier?: string; } /** * Hook to manage table settings * Avoids direct localStorage access during render to be SSR-compatible */ declare function useTableSettings({ tableId, initialSettings, persistKey, onChange, useUrlAsKey, tableIdentifier }?: UseTableSettingsOptions): { settings: TableSettings; updateSetting: (key: K, value: TableSettings[K]) => void; updateSettings: (newSettings: Partial) => void; resetSettings: () => void; getThemeConfig: () => TableThemeConfig; getCurrentStorageKey: () => string; saveSettingsWithIdentifier: (identifier: string) => boolean; extractTableIdentifier: () => string; getSavedConfigurations: () => { id: string; name?: string; }[]; getSystemPreference: () => "light" | "dark"; isClient: boolean; }; interface UseSafeTableSettingsProps { initialSettings: TableSettings; tableId?: string; useUrlAsKey?: boolean; tableIdentifier?: string; persistKey?: string; onChange?: (settings: TableSettings) => void; } declare function useSafeTableSettings({ initialSettings, tableId, useUrlAsKey, tableIdentifier, persistKey, onChange }: UseSafeTableSettingsProps): { settings: TableSettings; updateSetting: (key: keyof TableSettings, value: any) => void; resetSettings: () => void; getThemeConfig: () => { theme: string; variant: "default" | "bordered" | "modern" | "minimal"; colorScheme: "custom" | "default" | "primary" | "neutral"; borderRadius: "none" | "sm" | "md" | "lg" | "full"; }; getCurrentStorageKey: () => string; saveSettingsWithIdentifier: (identifier: string) => boolean; isClient: boolean; }; interface UseColumnVisibilityProps { columns: TableColumn[]; defaultVisibility?: Record; defaultHidden?: string[]; storageKey?: string; persist?: boolean; persistKey?: string; onVisibilityChange?: (visibility: Record) => void; } interface UseColumnVisibilityReturn { columnVisibility: Record; visibleColumns: TableColumn[]; hiddenColumns: string[]; toggleColumnVisibility: (columnId: string) => void; setColumnVisibility: (columnId: string, isVisible: boolean) => void; resetColumnVisibility: () => void; toggleAllColumns: (visible?: boolean) => void; showAllColumns: () => void; hideAllColumns: () => void; resetColumns: () => void; isColumnHidden: (columnId: string) => boolean; } /** * Hook to manage column visibility state in a data table * * @param props.columns - Array of column definitions * @param props.defaultVisibility - Default visibility state for columns * @param props.defaultHidden - Array of column IDs to hide by default * @param props.storageKey - Key to use for persisting state in localStorage * @param props.persist - Whether to persist state to localStorage * @param props.persistKey - Alternative key for localStorage (alias for storageKey) * @param props.onVisibilityChange - Callback when visibility changes * @returns Object with column visibility state and methods */ declare function useColumnVisibility({ columns, defaultVisibility, defaultHidden, storageKey, persist, persistKey, onVisibilityChange, }: UseColumnVisibilityProps): UseColumnVisibilityReturn; interface UseTableFilterOptions { /** * Data to be filtered */ data: T[]; /** * Column definitions */ columns: TableColumn[]; /** * Filter configurations */ filterConfigs?: FilterConfig[]; /** * Initial filter values */ initialFilters?: Record; /** * Whether filtering is server-side */ serverSide?: boolean; /** * Callback when filters change */ onFilterChange?: (filters: Record) => void; /** * Enable persistence of filters */ persist?: boolean; /** * Key for persisting filters */ persistKey?: string; } interface FilterPreset$1 { id: string; name: string; filters: Record; isDefault?: boolean; createdAt: string | number; } interface UseTableFilterReturn { /** * Current filter values */ filters: Record; /** * Set filter for a specific field */ setFilter: (field: string, value: any) => void; /** * Set multiple filters at once */ setFilters: (filters: Record) => void; /** * Remove filter for a specific field */ removeFilter: (field: string) => void; /** * Clear all filters */ clearFilters: () => void; /** * Reset filters to initial values */ resetFilters: () => void; /** * Filtered data based on current filters */ filteredData: T[]; /** * Whether any filters are active */ hasActiveFilters: boolean; /** * Count of active filters */ activeFilterCount: number; /** * Available filter configurations */ filterConfigs: FilterConfig[]; /** * Save current filters as a preset */ saveFilterPreset: (name: string, filters?: Record) => FilterPreset$1; /** * Load filters from a preset */ loadFilterPreset: (presetId: string) => Record | null; /** * Available filter presets */ filterPresets: FilterPreset$1[]; /** * Delete a filter preset */ deleteFilterPreset: (presetId: string) => boolean; /** * Set default filter preset */ setDefaultFilterPreset: (presetId: string) => boolean; /** * Check if a filter supports multiple values */ supportsMultipleValues: (field: string) => boolean; } /** * Hook for managing table filtering */ declare function useTableFilter({ data, columns, filterConfigs, initialFilters, serverSide, onFilterChange, persist, persistKey, }: UseTableFilterOptions): UseTableFilterReturn; /** * Main hook for table data management * Provides sorting, filtering, pagination, and selection functionality */ declare function useDataTable({ data, columns: userColumns, tableId: userTableId, pagination, total: totalProp, selection, sorting: initialSorting, filters: filterConfigs, filterValues: initialFilterValues, globalSearch: globalSearchConfig, eventHandlers, serverData, serverPagination, serverSorting, serverFiltering, }: UseDataTableOptions): UseDataTableReturn; interface UseAnimationPreferenceOptions { /** * Whether animations are enabled by default * @default true */ enabled?: boolean; /** * Duration of animations in milliseconds * @default 300 */ duration?: number; /** * Whether to respect user's reduced motion preference * @default true */ respectReducedMotion?: boolean; } declare function useAnimationPreference({ enabled, duration, respectReducedMotion, }?: UseAnimationPreferenceOptions): { enabled: boolean; prefersReducedMotion: boolean; duration: number; getAnimationProps: () => { animate: boolean; transition: { duration: number; }; }; getStaggeredDelay: (index: number, baseDelay?: number) => number; }; /** * Custom hook for integrating any form library with FormHandlingContext */ declare const useAutoForm: (form: any, { dialogType, onFormDirty, skipInitialValidation, onValuesChange, onErrorsChange, onSubmit, domRef }?: { dialogType?: DialogMode; onFormDirty?: (isDirty: boolean) => void; skipInitialValidation?: boolean; onValuesChange?: (values: Record) => void; onErrorsChange?: (errors: Record) => void; onSubmit?: (data: any) => void; domRef?: React.RefObject; }) => { isDirty: boolean; isValid: boolean; hasInteracted: boolean; markInteracted: () => void; getValues: any; reset: (values?: Record) => void; validate: any; submit: () => Promise; domRef: React$1.RefObject; }; declare global { interface Window { __REACT_TABLE_POWER_COMPONENTS?: Record; } } declare const DataTable: (props: DataTableProps & { ref?: React__default.Ref; }) => React__default.ReactElement; interface TableContainerProps extends React__default.HTMLAttributes { /** * Enable responsive behavior with horizontal scrolling * @default true */ responsive?: boolean; /** * Maximum height of the table container */ maxHeight?: number | string; /** * Border radius applied to container * @default true */ rounded?: boolean; /** * Add box shadow to the container * @default true */ shadow?: boolean; /** * Add border to the container * @default true */ bordered?: boolean; /** * Whether the container is in loading state * @default false */ loading?: boolean; /** * Loading state overlay content */ loadingContent?: React__default.ReactNode; /** * Loading state variant */ loadingVariant?: 'spinner' | 'skeleton' | 'pulse'; /** * Sticky header for the table */ stickyHeader?: boolean; /** * Zebra striping for the table rows */ zebra?: boolean; /** * Striped rows for the table */ striped?: boolean; /** * Hover effect for the table rows */ hover?: boolean; } /** * TableContainer - Wraps the table component with proper styling and responsive behavior */ declare const TableContainer: React__default.FC; interface FilterPreset { id: string; name: string; filters: Record; createdAt: number; } interface TableToolbarProps { className?: string; title?: string; description?: string; searchValue?: string; onSearch?: (value: string) => void; searchPlaceholder?: string; isSearchActive?: boolean; onClearSearch?: () => void; filters?: FilterConfig[]; activeFilters?: Record; filterValues?: Record; onFilterChange?: (field: string, value: any) => void; onClearFilters?: () => void; hasActiveFilters?: boolean; advancedFiltering?: { enabled?: boolean; allowPresets?: boolean; allowComplexFilters?: boolean; initialPresets?: FilterPreset[]; onPresetsChange?: (presets: FilterPreset[]) => void; persistKey?: string; }; selectedCount?: number; isAllSelected?: boolean; isSomeSelected?: boolean; onSelectAll?: () => void; onSelectNone?: () => void; bulkActions?: { label: string; value: string; icon?: React__default.ReactNode; }[]; onBulkAction?: (action: string) => void; export?: { enabled: boolean; } | undefined; exportFormats?: ExportFormat[]; onExport?: (format: ExportFormat) => void; onExportCurrentView?: () => void; onExportSelected?: () => void; onRefresh?: () => void; columns?: TableColumn[]; visibleColumns?: TableColumn[]; onToggleColumn?: (columnId: string) => void; onHideAllColumns?: () => void; onShowAllColumns?: () => void; onResetColumns?: () => void; hasCreated?: boolean; createButton?: React__default.ReactNode; columnVisibility?: Record; size?: 'sm' | 'md' | 'lg'; variant?: 'default' | 'bg-gray' | 'borderless' | 'shadow'; onUpdateTableSettings?: (key: K, value: TableSettings[K]) => void; onTableSettingsChange?: (settings: TableSettings) => void; tableTheme?: TableThemeConfig; tableSize?: TableSize; tableStriped?: boolean; tableHover?: boolean; tableBordered?: boolean; tableStickyHeader?: boolean; /** * Current table identifier used for saving settings */ currentTableIdentifier?: string; /** * Callback when a new table identifier is saved */ onSaveTableIdentifier?: (identifier: string) => void; /** * Selected rows data */ selectedRows?: T[]; } declare function TableToolbar({ className, title, description, searchValue, onSearch, searchPlaceholder, isSearchActive, onClearSearch, filters, activeFilters, filterValues, onFilterChange, onClearFilters, hasActiveFilters, advancedFiltering, selectedCount, isAllSelected, isSomeSelected, onSelectAll, onSelectNone, bulkActions, onBulkAction, export: exportConfig, exportFormats, onExport, onExportCurrentView, onExportSelected, onRefresh, columns, visibleColumns, onToggleColumn, onHideAllColumns, onShowAllColumns, onResetColumns, hasCreated, createButton, columnVisibility, size, variant, onUpdateTableSettings, onTableSettingsChange, tableTheme, tableSize, tableStriped, tableHover, tableBordered, tableStickyHeader, currentTableIdentifier, onSaveTableIdentifier, selectedRows, }: TableToolbarProps): React__default.ReactElement; interface TablePaginationProps { /** * Current page number (1-based) */ currentPage: number; /** * Number of items per page */ pageSize: number; /** * Total number of records */ totalRecords: number; /** * Page size options */ pageSizeOptions?: number[]; /** * Whether to show page size dropdown */ showPageSizeOptions?: boolean; /** * Whether to show jump to page input */ showJumpToPage?: boolean; /** * Whether to show total records count */ showTotalRecords?: boolean; /** * Number of pages to show in pagination */ siblingCount?: number; /** * Handle page change */ onPageChange: (page: number) => void; /** * Handle page size change */ onPageSizeChange?: (pageSize: number) => void; /** * Visual variant of the pagination * @default 'default' */ variant?: 'default' | 'compact' | 'simple' | 'bordered'; /** * Custom className */ className?: string; } /** * TablePagination component - Provides pagination controls for the table */ declare const TablePagination: ({ currentPage, pageSize, totalRecords, pageSizeOptions, showPageSizeOptions, showJumpToPage, showTotalRecords, siblingCount, onPageChange, onPageSizeChange, variant, className }: TablePaginationProps) => react_jsx_runtime.JSX.Element; type LoadingType = 'spinner' | 'dots' | 'progress' | 'slide' | 'circle' | 'pulse' | 'wave'; interface LoadingSpinnerProps { /** * Type of loading animation * @default 'spinner' */ type?: LoadingType; /** * Size of the loading indicator * @default 'md' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Color of the loading indicator */ color?: string; /** * CSS class to apply to the loading container */ className?: string; /** * ARIA label for accessibility * @default 'Loading' */ ariaLabel?: string; } /** * LoadingSpinner component - Displays various loading animations */ declare const LoadingSpinner: React__default.FC; type LoadingVariant = 'overlay' | 'inline' | 'contained' | 'full'; interface LoadingStateProps { /** * Whether content is currently loading */ loading?: boolean; /** * Content to display when not loading */ children?: React__default.ReactNode; /** * Type of loading indicator to display */ loadingType?: LoadingType; /** * Size of the loading indicator */ size?: 'sm' | 'md' | 'lg' | 'xl'; /** * Whether to show overlay on top of content */ overlay?: boolean; /** * Custom class for loading container */ className?: string; /** * Custom loading text to display */ loadingText?: string; /** * Whether to center the loading indicator */ center?: boolean; /** * Custom color for the loading indicator */ color?: string; /** * Variant of loading state display * @default 'overlay' */ variant?: LoadingVariant; } /** * LoadingState component - displays a loading indicator when content is loading */ declare const LoadingState: React__default.FC; interface TableDialogProps { /** * Whether the dialog is open */ open: boolean; /** * Dialog title */ title?: string; /** * Dialog description/subtitle */ description?: string; /** * Type of dialog (create, edit, view, delete) */ type: DialogType; /** * Data to be passed to the form */ data?: any; /** * Form component to render inside dialog */ formComponent?: React__default.ComponentType; /** * Callback when dialog is closed */ onClose?: () => void; /** * Callback when form is submitted * Fixed signature to accept a single data parameter */ onSubmit?: (data: Record | undefined, type: DialogType) => Promise | boolean | void | Promise; /** * Whether the dialog is in loading state */ loading?: boolean; /** * Error message to display */ error?: string | Error | null; /** * Width of the dialog */ width?: string | number; /** * Max width of the dialog */ maxWidth?: string | number; /** * Whether to close on click outside * @default true */ closeOnClickOutside?: boolean; /** * Whether to close on ESC key * @default true */ closeOnEsc?: boolean; /** * Dialog content (can be used instead of formComponent) */ children?: React__default.ReactNode; /** * Additional CSS class for the dialog */ className?: string; /** * Additional CSS class for the backdrop */ backdropClassName?: string; /** * Additional CSS class for the content */ contentClassName?: string; /** * Custom dialog footer */ footer?: React__default.ReactNode; /** * Whether to show the submit button * @default true */ showSubmitButton?: boolean; /** * Label for the submit button */ submitButtonLabel?: string; /** * Label for the cancel button */ cancelButtonLabel?: string; /** * Type of loading animation */ loadingAnimationType?: LoadingType$1; /** * Type of loading indicator */ loadingIndicatorType?: 'spinner' | 'dots' | 'progress' | 'pulse'; /** * Size of loading indicator */ loadingIndicatorSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Loading text */ loadingText?: string; /** * Style of loading effect * @default 'overlay' */ loadingEffect?: 'overlay' | 'blur' | 'skeleton' | 'fade' | 'none'; /** * Whether the footer is sticky */ stickyFooter?: boolean; /** * Size of buttons */ buttonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Whether buttons are elevated */ elevatedButtons?: boolean; /** * Position of action buttons */ actionsPosition?: 'left' | 'right' | 'center' | 'between'; /** * Validation mode */ validationMode?: 'onSubmit' | 'onChange' | 'onBlur'; /** * Whether to show inline errors */ showInlineErrors?: boolean; /** * Whether to show error summary */ showErrorSummary?: boolean; /** * Function to transform errors */ transformErrors?: (errors: Record) => Record; /** * Custom error renderer */ renderError?: (error: string | Error | null) => React__default.ReactNode; /** * Error handler */ onError?: (error: Error) => void; /** * Whether to disable form fields when loading */ disableFieldsWhenLoading?: boolean; /** * Whether to auto-focus the first field */ autoFocusFirstField?: boolean; /** * Additional props to pass to the form */ formProps?: Record; } /** * TableDialog component - Used for CRUD operations */ declare const TableDialog: React__default.FC; interface DialogFormComponentProps { data?: any; loading?: boolean; error?: Error | null | string; onSubmit?: (data: any) => Promise | boolean; onClose?: () => void; dialogType?: DialogType; formRef?: React__default.MutableRefObject; /** * Validation errors from form validation */ validationErrors?: Record; /** * Form reference for accessing form methods * This can be forwarded by React.forwardRef */ ref?: React__default.Ref; /** * Whether the form is read-only (for view mode) */ isReadOnly?: boolean; } interface AppendableDialogProps { /** * Active record data */ activeRecord?: T | null; /** * Active dialog type */ activeDialog?: DialogType; /** * Dialog title */ dialogTitle?: string; /** * Dialog description */ dialogDescription?: string; /** * Form component for each dialog type */ formComponents?: { create?: React__default.ComponentType; edit?: React__default.ComponentType; view?: React__default.ComponentType; delete?: React__default.ComponentType; [key: string]: React__default.ComponentType | undefined; }; /** * Callback when form is submitted */ onSubmit?: (data: any, type: DialogType) => Promise | boolean; /** * Callback when dialog is closed */ onClose?: () => void; /** * Error to show in the dialog */ error?: Error | null | string; /** * Loading state */ loading?: boolean; /** * Whether the dialog can be closed by clicking outside */ closeOnClickOutside?: boolean; /** * Whether the dialog can be closed by pressing Escape */ closeOnEsc?: boolean; /** * Width of the dialog */ width?: string | number; /** * Position of action buttons */ actionsPosition?: 'left' | 'right' | 'center' | 'between'; /** * Size of buttons */ buttonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Whether buttons are elevated */ elevatedButtons?: boolean; /** * Loading effect style */ loadingEffect?: 'overlay' | 'blur' | 'skeleton' | 'fade' | 'none'; /** * Whether to use reduced motion for animations */ reducedMotion?: boolean; } /** * Optimized AppendableDialog component with robust validation support */ declare function AppendableDialog({ activeRecord, activeDialog, dialogTitle, dialogDescription, formComponents, onSubmit, onClose, error, loading, closeOnClickOutside, closeOnEsc, width, actionsPosition, buttonSize, elevatedButtons, loadingEffect, reducedMotion, }: AppendableDialogProps): react_jsx_runtime.JSX.Element | null; interface ThemeProviderProps { /** * Theme configuration */ themeConfig?: TableThemeConfig; /** * Children content */ children: React__default.ReactNode; } /** * ThemeProvider - Component for applying themes to the table * Fixed to avoid hydration errors in SSR environments like Next.js */ declare const ThemeProvider: React__default.FC; interface EmptyStateProps { /** * Title of the empty state * @default 'Không có dữ liệu' */ title?: string; /** * Detailed message explaining the empty state * @default 'Không tìm thấy kết quả nào phù hợp với tiêu chí tìm kiếm.' */ message?: string; /** * Custom icon to display */ icon?: React__default.ReactNode; /** * Additional CSS class */ className?: string; /** * Whether to animate the empty state * @default true */ animate?: boolean; /** * Animation style for the empty state * @default 'fade-in' */ animationStyle?: 'fade-in' | 'slide-up' | 'scale-in' | 'none'; /** * Custom action button */ action?: React__default.ReactNode; /** * Icon size * @default 64 */ iconSize?: number | "sm" | "md" | "lg" | "xl"; /** * Disable the icon entirely * @default false */ hideIcon?: boolean; } declare function EmptyState({ title, message, icon, className, animate, animationStyle, action, iconSize, hideIcon }: EmptyStateProps): React__default.ReactElement; interface ErrorStateProps { /** * Error object or message */ error?: Error | string | null; /** * Additional CSS class */ className?: string; /** * Whether to show a retry button * @default false */ showRetry?: boolean; /** * Handler for retry button click */ onRetry?: () => void; /** * Custom renderer for error message */ renderMessage?: (error: Error | string) => React__default.ReactNode; /** * Default error message if no error is provided */ defaultMessage?: string; } /** * ErrorState component - Display error message with optional retry button */ declare const ErrorState: React__default.FC; interface AutoFormProps { form: any; dialogType?: DialogMode; children: React__default.ReactNode; values?: Record; onFormDirty?: (isDirty: boolean) => void; onValuesChange?: (values: Record) => void; onErrorsChange?: (errors: Record) => void; onSubmit?: (data: any) => void; skipInitialValidation?: boolean; } declare const _default: React__default.MemoExoticComponent>>; /** * Form adapter interface to standardize interactions with different form libraries */ interface FormAdapter { /** * Get form values without validation */ getValues: () => Record | null; /** * Validate form and return errors if any */ validate: () => Promise>; /** * Get validated form values (throws if validation fails) */ getValidatedValues: () => Promise>; /** * Reset form to initial values or new values */ reset: (values?: Record) => void; /** * Submit form programmatically */ submit: () => Promise; /** * Set form values programmatically */ setValues: (values: Record) => void; /** * Set form errors programmatically */ setErrors: (errors: Record) => void; /** * Clear all form errors */ clearErrors: () => void; /** * Get current form errors */ getErrors: () => Record; /** * Check if form is dirty (has changes) */ isDirty: () => boolean; /** * Check if form is currently submitting */ isSubmitting: () => boolean; /** * Check if form is valid */ isValid: () => boolean; } /** * Create an adapter for React Hook Form */ declare function createReactHookFormAdapter(formRef: FormRef): FormAdapter; /** * Create an adapter for Formik */ declare function createFormikAdapter(formRef: FormRef): FormAdapter; /** * Create a generic adapter for a form with basic methods */ declare function createGenericFormAdapter(formRef: FormRef): FormAdapter; /** * Detect the form library from the form ref and create the appropriate adapter */ declare function createFormAdapter(formRef: FormRef): FormAdapter; interface OptimizedFormComponentProps { data?: any; onSubmit?: (data: any, type: DialogType | null) => Promise | boolean; onClose?: () => void; dialogType: DialogType | null; loading?: boolean; error?: string | Error | null; isReadOnly?: boolean; ref?: React__default.Ref; onFormDirty?: (isDirty: boolean) => void; skipInitialValidation?: boolean; dialogRef?: React__default.RefObject; } interface OptimizedDialogProps { open?: boolean; dialogType: DialogType | null; dialogTitle?: string; dialogDescription?: string; data?: T | null; formComponent?: React__default.ComponentType; onClose?: () => void; onSubmit?: (data: any, type: DialogType | null) => Promise | boolean; loading?: boolean; error?: string | Error | null; width?: string | number; closeOnClickOutside?: boolean; closeOnEsc?: boolean; actionsPosition?: 'left' | 'right' | 'center' | 'between'; buttonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; elevatedButtons?: boolean; reducedMotion?: boolean; disableSubmitUntilDirty?: boolean; validateOnMount?: boolean; skipInitialValidation?: boolean; } declare function OptimizedDialog(props: OptimizedDialogProps): react_jsx_runtime.JSX.Element; interface FormDialogState { open: boolean; type: DialogType | null; title?: string; description?: string; data?: T | null; } interface FormDialogManagerProps { formComponents?: { create?: React__default.ComponentType; edit?: React__default.ComponentType; view?: React__default.ComponentType; delete?: React__default.ComponentType; custom?: React__default.ComponentType; [key: string]: React__default.ComponentType | undefined; }; onSubmit?: (data: any, type: DialogType) => Promise | boolean; closeOnClickOutside?: boolean; closeOnEsc?: boolean; width?: string | number; actionsPosition?: 'left' | 'right' | 'center' | 'between'; buttonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; elevatedButtons?: boolean; reducedMotion?: boolean; children: (methods: { openCreateDialog: (data?: Partial, title?: string, description?: string) => void; openEditDialog: (data: T, title?: string, description?: string) => void; openViewDialog: (data: T, title?: string, description?: string) => void; openDeleteDialog: (data: T, title?: string, description?: string) => void; openCustomDialog: (type: string, data: any, title?: string, description?: string) => void; closeDialog: () => void; dialogProps: FormDialogState; }) => React__default.ReactNode; } /** * FormDialogManager - A component to manage form dialogs with optimized rendering */ declare function FormDialogManager({ formComponents, onSubmit, closeOnClickOutside, closeOnEsc, width, actionsPosition, buttonSize, elevatedButtons, reducedMotion, children }: FormDialogManagerProps): react_jsx_runtime.JSX.Element; interface DialogLoadingStateProps { /** * Whether the loading state is active */ loading: boolean; /** * Type of loading indicator to show * @default 'spinner' */ type?: LoadingType$1; /** * Variant of loading display * @default 'overlay' */ variant?: 'overlay' | 'blur' | 'skeleton' | 'fade' | 'none'; /** * Size of the loading indicator * @default 'md' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Text to display during loading * @default 'Loading...' */ text?: string; /** * Whether to blur the content behind the loading indicator * @default true */ blur?: boolean; /** * Whether to disable pointer events during loading * @default true */ disablePointerEvents?: boolean; /** * Children content that will be overlaid with the loading state */ children: React__default.ReactNode; /** * Error state to display */ error?: React__default.ReactNode; } /** * DialogLoadingState - Component to show loading state over dialog content */ declare const DialogLoadingState: React__default.FC; declare function Table({ data, columns, children, size, striped, bordered, highlightOnHover, stickyHeader, dense, fullWidth, zebra, rounded, className, variant, ...props }: TableProps): react_jsx_runtime.JSX.Element; interface TableHeadProps extends React__default.HTMLAttributes { /** * Enables sticky positioning of the header */ sticky?: boolean; /** * Additional class names */ className?: string; } declare const TableHead: React__default.ForwardRefExoticComponent>; interface TableBodyProps extends React__default.HTMLAttributes { /** * Whether the table is in loading state * @default false */ loading?: boolean; /** * Whether to apply zebra striping to rows * @default false */ striped?: boolean; } /** * TableBody component - Container for table rows */ declare const TableBody: React__default.FC; interface TableFooterProps extends React__default.HTMLAttributes { /** * Whether the footer should stick to the bottom * @default false */ sticky?: boolean; /** * Whether to render a summary row * @default false */ showSummary?: boolean; /** * Background color class for the footer */ bgColor?: string; } /** * TableFooter component - Container for table footer content */ declare const TableFooter: React__default.FC; type HTMLTableRowProps = Omit, 'onClick' | 'onDoubleClick'>; type MotionTableRowProps = Omit, 'onClick' | 'onDoubleClick'>; interface TableRowProps { /** * Row data object */ rowData?: T; /** * Whether the row is selected * @default false */ isSelected?: boolean; /** * Whether the row is expanded * @default false */ isExpanded?: boolean; /** * Whether the row is clickable * @default false */ clickable?: boolean; /** * Whether the row should highlight on hover * @default true */ highlightOnHover?: boolean; /** * Index of the row in the dataset */ rowIndex?: number; /** * Row click handler */ onClick?: (rowData: T, index: number, event: React__default.MouseEvent) => void; /** * Double click handler */ onDoubleClick?: (rowData: T, index: number, event: React__default.MouseEvent) => void; /** * Animation enabled * @default true */ animate?: boolean; /** * Animation delay (in milliseconds) for staggered entrance * @default 0 */ animationDelay?: number; /** * Whether this row was just updated * @default false */ isUpdated?: boolean; /** * Children elements */ children?: React__default.ReactNode; /** * Additional CSS classes */ className?: string; } /** * TableRow component - Enhanced table row with animations and selection states */ declare const TableRow: ({ children, rowData, isSelected, isExpanded, clickable, highlightOnHover, rowIndex, onClick, onDoubleClick, animate, animationDelay, isUpdated, className, ...props }: TableRowProps & (HTMLTableRowProps | MotionTableRowProps)) => react_jsx_runtime.JSX.Element; interface TableCellProps extends React__default.TdHTMLAttributes { /** * Whether this cell is an action cell */ isAction?: boolean; /** * Whether to truncate text in this cell */ truncate?: boolean; /** * Maximum width for truncated text */ maxWidth?: number | string; /** * Text alignment */ align?: ColumnAlignment; /** * Custom class name */ className?: string; /** * Cell value (from row data) */ value?: any; /** * Column definition associated with this cell */ column?: TableColumn; /** * Row data associated with this cell */ rowData?: T; /** * Row index */ rowIndex?: number; } declare const TableCell: React__default.ForwardRefExoticComponent & React__default.RefAttributes>; interface TableHeadCellProps extends React__default.ThHTMLAttributes { /** * Is this header cell sortable */ sortable?: boolean; /** * Current sort direction */ sortDirection?: SortDirection; /** * Whether this cell contains actions */ isAction?: boolean; /** * Whether this cell contains selection controls */ isSelect?: boolean; /** * Width of the column (CSS width value) */ width?: string | number; /** * Text alignment */ align?: ColumnAlignment; /** * Custom class name */ className?: string; } declare const TableHeadCell: React__default.ForwardRefExoticComponent>; interface TableHeaderRowProps extends React__default.HTMLAttributes { /** * Header group data from TanStack Table */ headerGroup?: HeaderGroup; /** * Function to render header cells */ renderHeaderCell?: (header: Header, index: number) => React__default.ReactNode; } /** * TableHeaderRow component - Used for complex header structures, especially with column groups */ declare const TableHeaderRow: ({ headerGroup, renderHeaderCell, children, className, ...props }: TableHeaderRowProps) => react_jsx_runtime.JSX.Element; interface TableEmptyProps { /** * Empty state title text * @default 'No data' */ title?: string; /** * Empty state message text * @default 'No data available' */ message?: string; /** * Custom icon to display */ icon?: React__default.ReactNode; /** * Number of columns to span * @default 1 */ colSpan?: number; /** * Whether to display a refresh/reload button * @default false */ showRefresh?: boolean; /** * Function to call when refresh button is clicked */ onRefresh?: () => void; /** * Custom refresh button text * @default 'Refresh' */ refreshText?: string; /** * Additional CSS classes */ className?: string; /** * Custom content to render instead of the default empty state */ children?: React__default.ReactNode; } /** * TableEmpty component - Shown when table has no data */ declare const TableEmpty: React__default.FC; /** * TableRowMemo component - Memoized version of TableRow to prevent unnecessary re-renders * * This component should be used when dealing with large datasets to optimize rendering performance */ declare const TableRowMemo: React__default.NamedExoticComponent>; interface TableFilterProps { /** * Filter configuration */ filter: FilterConfig; /** * Current filter value */ value: any; /** * Callback when filter value changes */ onChange: (value: any) => void; /** * Custom CSS class */ className?: string; } declare const TableFilter: React__default.FC; interface IconProps$5 extends SVGProps { /** * Icon size in pixels */ size?: number; /** * CSS class name for styling */ className?: string; /** * Color of the icon (uses currentColor by default) */ color?: string; } declare const Settings: React__default.NamedExoticComponent; declare const EyeOff: React__default.NamedExoticComponent; declare const SortIcon: React__default.NamedExoticComponent; declare const SortAsc: React__default.NamedExoticComponent; declare const SortDesc: React__default.NamedExoticComponent; declare const ChevronRight: React__default.NamedExoticComponent; declare const ChevronLeft: React__default.NamedExoticComponent; declare const ChevronDown: React__default.NamedExoticComponent; declare const ChevronUp: React__default.NamedExoticComponent; interface IconProps$4 { size?: number; color?: string; strokeWidth?: number; className?: string; } /** * Search icon component */ declare const Search: React__default.FC; declare const Filter: React__default.NamedExoticComponent; declare const Refresh: React__default.NamedExoticComponent; declare const Download: React__default.NamedExoticComponent; declare const MoreVertical: React__default.NamedExoticComponent; declare const MoreHorizontal: React__default.NamedExoticComponent; declare const Columns: React__default.NamedExoticComponent; interface IconProps$3 { size?: number; color?: string; strokeWidth?: number; className?: string; } /** * Edit icon component */ declare const Edit: React__default.FC; interface IconProps$2 { size?: number; color?: string; strokeWidth?: number; className?: string; } /** * Trash icon component */ declare const Trash: React__default.FC; declare const Eye: React__default.NamedExoticComponent; interface IconProps$1 { size?: number; color?: string; strokeWidth?: number; className?: string; } /** * Check icon component */ declare const Check: React__default.FC; interface IconProps { size?: number; color?: string; strokeWidth?: number; className?: string; } /** * Plus icon component */ declare const Plus: React__default.FC; /** * Configuration options for DataTable that can be set at the provider level */ interface DataTableProviderConfig { /** * Default table size */ size?: TableSize; /** * Default theme configuration */ theme?: TableThemeConfig; /** * Default pagination configuration */ pagination?: { showSizeChanger?: boolean; showQuickJumper?: boolean; showTotal?: boolean; pageSizeOptions?: number[]; } | boolean; /** * Whether striped rows are enabled by default */ striped?: boolean; /** * Whether bordered cells are enabled by default */ bordered?: boolean; /** * Whether hover highlight is enabled by default */ hover?: boolean; /** * Whether sticky headers are enabled by default */ sticky?: boolean; /** * Whether to enable row animations by default */ animate?: boolean; /** * Default dialog configuration */ dialog?: DialogConfig; /** * Default loading configuration */ loading?: { variant?: LoadingVariant$1; spinnerType?: SpinnerType; spinnerSize?: SpinnerSize; text?: string; skeletonRows?: number; skeletonColumns?: number; }; /** * Default labels and translations */ labels?: { search?: string; filter?: string; noResults?: string; loading?: string; error?: string; rowsPerPage?: string; create?: string; edit?: string; delete?: string; view?: string; actions?: string; save?: string; cancel?: string; confirm?: string; selectAll?: string; deselectAll?: string; export?: string; }; /** * Default date format for date columns */ dateFormat?: string; /** * Default number format for numeric columns */ numberFormat?: string; /** * Whether to persist table settings by default */ persistSettings?: boolean | { persistKey?: string; useUrlAsKey?: boolean; tableIdentifier?: string; }; /** * Default animation settings */ animations?: { enabled?: boolean; rowEnter?: Record; rowExit?: Record; duration?: number; }; /** * Default filter configurations */ filterDefaults?: { debounceMs?: number; advancedFiltering?: boolean; allowPresets?: boolean; allowComplexFilters?: boolean; persistFilters?: boolean; }; emptyState?: { title?: string; message?: string; action?: React__default.ReactNode; }; } /** * Provider component for setting default DataTable configurations */ declare const DataTableProvider: React__default.FC<{ config: DataTableProviderConfig; children: React__default.ReactNode; }>; /** * Hook to access DataTable configuration from context * Safe to use in both client and server components */ declare const useDataTableConfig: () => DataTableProviderConfig; /** * Higher-order component that merges provider config with component props * Works with both client and server components */ declare function withDataTableConfig>(Component: React__default.ComponentType

): React__default.FC

; /** * Theme utility functions for managing CSS variables */ /** * Updates CSS variables for the table component * @param variables - Record of CSS variable names and their values * @param selector - CSS selector to apply the variables to (defaults to :root) */ declare function setCssVariables(variables: Record, selector?: string): void; /** * Apply a dark mode theme to the table * @param selector - CSS selector for the table container element */ declare function applyDarkTheme(selector?: string): void; /** * Apply a light mode theme to the table * @param selector - CSS selector for the table container element */ declare function applyLightTheme(selector?: string): void; /** * Create a theme object with custom colors * @param theme - Partial theme configuration * @returns Complete theme object with defaults for missing values */ declare function createTheme(theme: Partial>): Record; /** * Apply a custom theme to the table * @param theme - Theme object with CSS variable values * @param selector - CSS selector for the component */ declare function applyCustomTheme(theme: Record, selector?: string): void; /** * Detect if the browser is in dark mode * @returns True if the browser is in dark mode */ declare function isDarkMode(): boolean; /** * Apply appropriate theme based on browser color scheme preference * @param selector - CSS selector for the table container element */ declare function applyThemeBasedOnColorScheme(selector?: string): void; type ThemeVariables = Partial>; declare const injectCSS: () => void; export { AppendableDialog, _default as AutoForm, BaseTableData, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ColumnAlignment, Columns, DataTable, DataTableProps, DataTableProvider, type DataTableProviderConfig, DialogConfig, DialogLoadingState, DialogMode, DialogType, Download, Edit, EmptyState, ErrorState, ExportConfig, ExportFormat, Eye, EyeOff, Filter, FilterConfig, type FormAdapter, FormDialogManager, FormHandlingProvider, LoadingSpinner, LoadingState, LoadingType$1 as LoadingType, LoadingVariant$1 as LoadingVariant, MoreHorizontal, MoreVertical, OptimizedDialog, Plus, Refresh, Search, Settings, SortAsc, SortDesc, SortDirection, SortIcon, SpinnerSize, SpinnerType, Table, TableBody, TableCell, TableColumn, TableContainer, TableDialog, TableEmpty, TableFilter, TableFooter, TableHead, TableHeadCell, TableHeaderRow, TablePagination, TableProps, TableRow, TableRowMemo, type TableSettings, TableSize, TableThemeConfig, TableToolbar, ThemeProvider, type ThemeVariables, Trash, UseDataTableOptions, UseDataTableReturn, applyCustomTheme, applyDarkTheme, applyLightTheme, applyThemeBasedOnColorScheme, createFormAdapter, createFormikAdapter, createGenericFormAdapter, createReactHookFormAdapter, createTheme, injectCSS, isDarkMode, setCssVariables, useAnimationPreference, useAutoForm, useColumnVisibility, useDataTable, useDataTableConfig, useFormHandling, useOptimizedDialog, useSafeTableSettings, useTableDialog, useTableExport, useTableFilter, useTableSettings, withDataTableConfig, withFormHandling };