UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

74 lines (73 loc) 3.11 kB
import React from 'react'; import type { ActionObject, RendererData, ScopedComponentType } from 'jamis-core'; import { SimpleMap } from 'jamis-core'; import type { FormProps, InputTableProps, SchemaObject } from '../types'; interface TableState { items: Array<any>; raw?: any; columns: Array<any>; editIndex: number; isCreateMode?: boolean; page?: number; queryObj?: { orderBy?: string; orderDir?: 'desc' | 'asc'; [key: string]: string | undefined | Record<string, any>; }; } export default class InputTable extends React.Component<InputTableProps, TableState> { static defaultProps: Partial<InputTableProps>; static propsList: Array<string>; entries: SimpleMap<any, string | number>; entityId: number; subForms: Record<string, ScopedComponentType<FormProps>>; subFormItems: Record<string, any>; rowPrinstine: Array<any>; editting: any; constructor(props: InputTableProps); componentDidUpdate(prevProps: InputTableProps): void; componentWillUnmount(): void; resolveVariableProps: (key: "minLength" | "maxLength") => any; subFormRef: (formRef: any, colIndex: number, rowIndex: number) => void; subFormItemRef: (form: any, colIndex: number, rowIndex: number) => void; validate: () => Promise<string | void>; emitValue: () => void; doAction(action: ActionObject, ctx: RendererData, ...rest: Array<any>): Promise<void>; copyItem: (index: number) => Promise<void>; addItem: (index: number) => Promise<void>; startEdit(index: number, isCreate?: boolean): Promise<void>; confirmEdit: () => Promise<void>; cancelEdit: () => void; removeItem(index: number): Promise<void>; matchQueryObj: (query: Record<string, string | undefined | Record<string, string | undefined | Record<string, string>>> | undefined, item: Record<string, any>) => boolean; buildItemProps: (item: { data: Record<string, any>; [key: string]: any; }, index: number) => Record<string, any>; buildColumns: (props: InputTableProps, isCreateMode?: boolean) => Array<any>; columnToQuickEdit(column: any): SchemaObject; handleTableSave: (rows: Array<object> | object, diff: Array<object> | object, rowIndexes: Array<string> | string) => void; handleSaveTableOrder: (moved: Array<object>, rows: Array<object>) => void; handlePageChange: (page: number) => void; getEntryId: (rowData: any, rowIndex: number) => string; tableRef: (ref: any) => void; handleQuery: (query: Record<string, string>) => void; sortItems: (items: any[], queryObj?: { [key: string]: string | Record<string, any> | undefined; orderBy?: string; orderDir?: "desc" | "asc"; } | undefined) => any[]; filterItems: () => { pageItems: any[]; filterItems: any[]; adjustPage: number; lastPage: number; total: number; offset: number; }; render(): JSX.Element | null; } export declare class TableControlRenderer extends InputTable { reload(subPath?: string, query?: any): void; } export {};