@jsonforms/material-tree-renderer
Version:
Material-based tree renderer for JSON Forms
79 lines (78 loc) • 2.63 kB
TypeScript
import React from 'react';
import { ControlState, JsonSchema, OwnPropsOfControl, StatePropsOfControl, UISchemaElement, UISchemaTester } from '@jsonforms/core';
import { WithStyles } from '@material-ui/core/styles';
import { InstanceLabelProvider, SchemaLabelProvider } from '../helpers/LabelProvider';
export interface MasterProps {
schema: JsonSchema;
path: string;
rootData: any;
selection: any;
handlers: {
onAdd: any;
onRemove?: any;
onSelect: any;
resetSelection: any;
};
uischema: UISchemaElement;
filterPredicate: any;
labelProviders: {
forSchema: SchemaLabelProvider;
forData: InstanceLabelProvider;
};
imageProvider: any;
}
export interface TreeWithDetailState extends ControlState {
selected: {
schema: JsonSchema;
data: any;
path: string;
};
dialog: {
open: boolean;
schema: JsonSchema;
path: string;
};
}
export interface StatePropsOfTreeWithDetail extends StatePropsOfControl {
classes?: any;
rootData: any;
filterPredicate: any;
labelProviders: {
forSchema: SchemaLabelProvider;
forData: InstanceLabelProvider;
};
imageProvider: any;
uischemas?: {
tester: UISchemaTester;
uischema: UISchemaElement;
}[];
}
export interface DispatchPropsOfTreeWithDetail {
addToRoot: any;
}
export interface TreeWithDetailProps extends StatePropsOfTreeWithDetail, DispatchPropsOfTreeWithDetail {
}
export declare class TreeWithDetailRenderer extends React.Component<TreeWithDetailProps & WithStyles<'treeMasterDetailContent' | 'treeMasterDetail' | 'treeMasterDetailMaster' | 'treeMasterDetailDetail'>, TreeWithDetailState> {
componentWillMount(): void;
setSelection: (schema: JsonSchema, data: any, path: string) => () => void;
openDialog: (schema: JsonSchema, path: string) => () => void;
closeDialog: () => void;
render(): JSX.Element;
}
export interface WithLabelProviders {
labelProviders: {
forSchema: SchemaLabelProvider;
forData: InstanceLabelProvider;
};
}
export interface WithLabelProvider {
labelProvider: any;
}
export interface WithImageProvider {
imageProvider: any;
}
export interface OwnPropsOfTreeControl extends OwnPropsOfControl {
filterPredicate: any;
}
declare const ConnectedTreeWithDetailRenderer: import("react-redux").ConnectedComponent<React.ComponentClass<TreeWithDetailProps, any>, Pick<TreeWithDetailProps, never> & OwnPropsOfTreeControl & WithImageProvider & WithLabelProviders>;
export default ConnectedTreeWithDetailRenderer;