import Async from "typescene-async"; import Block from "./Block"; import { ControlElement } from "../"; import TableRow, { TableHeader } from "./TableRow"; import Component from "../Component"; import { ComponentFactory } from "../ComponentFactory"; /** Represents a table block component */ export declare class Table extends Block { /** Create a table with given header and rows, if any */ constructor(headerColumns?: (string | ControlElement | Block)[], widths?: string[], rows?: TableRowT[] | Async.ObservableArray); /** Initialize a table factory with given values */ static with(values: Table.Initializer): ComponentFactory>; /** Initialize a table factory with given rows */ static withRows(rows: ComponentFactory.SpecList): ComponentFactory>; /** Initialize with given (observable) values; returns this */ initializeWith: (values: Table.Initializer) => this; /** Header row; not rendered if null or TableHeader without columns, OR if table has no columns (observed) */ header: TableHeader | null; /** Set of rows; each should have the same number of columns (observed) */ rows: (TableRowT | null)[]; /** Table style (observed, including properties) */ options: Table.TableOptions; /** Set to a string value to have getFormValues add an ObservableArray with form values of table rows */ name: string | undefined; /** Returns an array of directly contained UI components (observable) */ getChildren(): Component[]; /** Returns an object containing all current values of input elements (observable) */ getFormValues(result?: {}): {}; /** Sets all input values by element name (will not trigger observable) */ setFormValues(values: any): void; private _observeOptions; private _thead; private _tbody; } export declare namespace Table { /** Options to be set for table components */ interface TableOptions { /** Table display option */ striped?: boolean; /** Table display option */ bordered?: boolean; /** Table display option */ hover?: boolean; /** Table display option */ condensed?: boolean; } } export declare namespace Table { /** Initializer for .with({ ... }) */ interface Initializer extends Block.Initializer { /** Property initializer */ rows: ComponentFactory.SpecList2TCol; /** Property initializer */ header?: ComponentFactory.SpecEltOrListTCol | null; /** Property initializer */ options?: Table.TableOptions; /** Property initializer */ name?: string; } } export default Table;