@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
105 lines (104 loc) • 4.18 kB
TypeScript
import { TableProps as TablePropsSUI } from 'semantic-ui-react';
import { DataSet, FormComponent, JSONSchema7TypeName, BoundProp } from '@tomino/dynamic-form';
export declare function createDataset(items: Column[], parent: any): import("mobx-state-tree").ModelInstanceTypeProps<{}> & {
errors: import("mobx").ObservableMap<any, any>;
} & {
readonly parent: DataSet<{}>;
readonly immediateParent: DataSet<{}>;
reset(): void;
getValue(item: string): any;
getError(item: string): string;
setError(item: string, error: string): void;
} & {
getSchema(_key?: string, _throwError?: boolean): import("@tomino/dynamic-form").Schema;
} & {
addRow(key: string, data?: any): void;
mapRemove(key: string, mapKey: string): void;
detach(node: any): void;
isRequired(key: string): boolean;
parseValue(key: string, value: any): any;
insertRow<T>(key: string, index: number, data: T): any;
replaceRow<T>(key: string, index: number, data: T): any;
moveRow(key: string, from: number, to: number): void;
removeRow(key: string, index: number): void;
removeRowData<T>(key: string, data: T): void;
removeRowIndex(key: string, index: number): void;
executeAction<T>(action: (owner?: T) => any): any;
dataSetAction<T>(action: (owner?: T) => any): () => any;
setValue<T>(key: string, value: any, validate?: (owner: T, args: {
value: any;
source: string;
}) => any): void;
setMapValue(key: string, mapKey: string, value: any): void;
setArrayValue(key: string, index: number, value: any): void;
clearErrors(): void;
toJS({ replaceDates, replaceEmpty }?: {
replaceEmpty?: boolean;
replaceDates?: boolean;
}): any;
toJSString(): string;
root(): DataSet<{}>;
validateDataset(assign?: boolean): false | import("ajv").ErrorObject[];
validateField(key: string): any;
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{}, {
errors: import("mobx").ObservableMap<any, any>;
} & {
readonly parent: DataSet<{}>;
readonly immediateParent: DataSet<{}>;
reset(): void;
getValue(item: string): any;
getError(item: string): string;
setError(item: string, error: string): void;
} & {
getSchema(_key?: string, _throwError?: boolean): import("@tomino/dynamic-form").Schema;
} & {
addRow(key: string, data?: any): void;
mapRemove(key: string, mapKey: string): void;
detach(node: any): void;
isRequired(key: string): boolean;
parseValue(key: string, value: any): any;
insertRow<T>(key: string, index: number, data: T): any;
replaceRow<T>(key: string, index: number, data: T): any;
moveRow(key: string, from: number, to: number): void;
removeRow(key: string, index: number): void;
removeRowData<T>(key: string, data: T): void;
removeRowIndex(key: string, index: number): void;
executeAction<T>(action: (owner?: T) => any): any;
dataSetAction<T>(action: (owner?: T) => any): () => any;
setValue<T>(key: string, value: any, validate?: (owner: T, args: {
value: any;
source: string;
}) => any): void;
setMapValue(key: string, mapKey: string, value: any): void;
setArrayValue(key: string, index: number, value: any): void;
clearErrors(): void;
toJS({ replaceDates, replaceEmpty }?: {
replaceEmpty?: boolean;
replaceDates?: boolean;
}): any;
toJSString(): string;
root(): DataSet<{}>;
validateDataset(assign?: boolean): false | import("ajv").ErrorObject[];
validateField(key: string): any;
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
export declare const tableAddButton: string;
declare type Column = {
title: string;
source: string;
type: JSONSchema7TypeName;
};
export declare type TableProps = TablePropsSUI & {
propSource: string;
onCreate: string;
onAdd: string;
onSave: string;
onDelete: string;
items: Column[];
allowAdd?: boolean;
allowEdit?: boolean;
allowDelete?: boolean;
customView?: boolean;
value: BoundProp;
};
export declare const TableView: FormComponent;
export {};