import React, { Component } from "react"; import CSS from "csstype"; import DataStoreProps from "../DataStoreProps"; /** * */ export declare const defaultColumnRendererStyle: { padding: number; }; export declare const defaultColumnRendererClass: { padding: number; }; /** * */ export interface ColumnProps { /** * summaries */ summaries?: any; /** * Align cell content direction */ align?: "left" | "center" | "right"; /** * Data grid column definitions. * * TODO remove these and use JSX children */ columns?: ColumnProps[]; /** * Define how to bind the column to a specfic data model property returning the value of that property. * For example. If the data model is { col1: 'value1', col2: 'value2' }, then the dataIndex could be 'col1' or 'col2'. */ field: string; xtype?: string; /** * Allow the cell to be editable with cell editor or row editor. Default is false. */ editable?: boolean; /** * Datepicker Column editor * * TODO resolve any to interface */ editor?: string | any; /** * Flex the cell. */ flex?: number | string | any; /** * Formatter */ formatter?: string; /** * Datepicker Column format */ format?: string; /** * Turn on filtering for column */ filter?: true | false | "string" | "boolean" | "date" | "number"; /** * */ groupable?: boolean; /** * */ headerCheckbox?: boolean; /** * */ hidden?: boolean; /** * */ hideable?: boolean; /** * This config can be used with Locking Grid Determines whether the column is locked or not. * Configure as true to lock the column to default locked region. String values contains one of the defined locking regions - "left", "right" or "center" */ locked?: boolean | string; /** * A renderer is a React component with RenderProps which can be used to transform data (value, appearance, etc.) before it is rendered. */ renderer?: React.ReactElement; /** * */ resizable?: boolean; /** * Summary cell... * * TODO resolve any to interface */ summaryCell?: string | any; /** * */ summary?: "none" | "average" | "count" | "max" | "min" | "sum"; /** * */ sortable?: boolean; /** * TODO resolve any to interface */ summaryType?: any; /** * */ summaryRenderer?: ((value?: any, summaryData?: any, dataIndex?: any) => {}) | React.ReactElement; /** * TODO why are both value and data returned. */ validator?(value?: any, data?: any): any; /** * Column name */ text?: string; /** * Column width */ width?: string | number; /** * TODO resolve any to interface */ menu?: any[]; /** * Disabled column menu */ menuDisabled?: boolean; /** * Column sorter */ sorter?: string | any; /** * Data grid css style properties. */ style?: CSS.Properties; className?: string; filterType?: string; } /** * This is used to retrieve the column config from the Column component. */ export interface ColumnConfig { getColumnConfig(): T; } /** * The Sencha Grid component. */ export declare class Column extends Component implements ColumnConfig { constructor(props: ColumnProps); sorterFn(a: any, b: any): any; getColumnConfig(): ColumnProps; render(): JSX.Element; } export default Column; /** * */ export interface RowElement { /** * */ style: CSS.Properties; /** * */ class: string; } export interface CellElement { /** * */ style: CSS.Properties; /** * */ class: string; } /** * The Sencha Grid column renderer properties. */ export interface RendererProps { /** * */ data?: any; /** * */ rowIndex?: number; /** * */ colIndex?: number; /** * TODO remove this */ store?: DataStoreProps; /** * */ row?: RowElement; /** * */ validator?(value?: any, data?: any): any; /** * */ style?: CSS.Properties; /** * Cell Dom element */ cell?: CellElement; className?: string; /** * Have the data of the entire row */ record?: any; } /** * The Sencha Grid SummaryRenderer Properties */ export interface SummaryRendererProps { data?: number; isGrouped?: boolean; store?: DataStoreProps; groupName?: string; } /** * Default column renderer, which renders data as a string. */ export declare class ColumnRenderer extends Component { render(): JSX.Element; }