UNPKG

@glyphtek/unspecd

Version:

A declarative UI framework for building internal tools and dashboards with TypeScript. Create interactive tables, forms, and dashboards using simple specifications.

37 lines 1.64 kB
/** * Smart Table Component for Unspec'd Framework * * This component renders a data table with fetching capabilities. It displays * tabular data in a clean, professional format with loading states and error handling. * This is the initial read-only version that will be extended with editing capabilities. */ import type { EditableTableContent } from '../dsl-schema.js'; /** * Renders a smart table component that fetches and displays tabular data. * This component handles the complete lifecycle from data loading to table display, * with proper error handling and loading states. * * @param content - The EditableTableContent configuration specifying data source and table structure * @param specFunctions - Record of functions available from the ToolSpec * @param targetElement - The HTML element where the component should be rendered * * @example * ```typescript * const content: EditableTableContent = { * type: 'editableTable', * dataLoader: { functionName: 'getUserList' }, * tableConfig: { * columns: [ * { field: 'id', label: 'ID' }, * { field: 'name', label: 'Name' }, * { field: 'email', label: 'Email' } * ], * pagination: { defaultPageSize: 10 } * } * }; * * renderSmartTableComponent(content, spec.functions, containerElement); * ``` */ export declare function renderSmartTableComponent(content: EditableTableContent, specFunctions: Record<string, (params: any) => Promise<any>>, targetElement: HTMLElement, getInputValues?: () => Record<string, any>, setRefreshCallback?: (refresh: () => void) => void): void; //# sourceMappingURL=smart-table.d.ts.map