diff --git a/src/browser/tree-editor-utils.ts b/src/browser/tree-editor-utils.ts index 800482a..3a3ba03 100644 --- a/src/browser/tree-editor-utils.ts +++ b/src/browser/tree-editor-utils.ts @@ -1,6 +1,17 @@ import { JsonSchema7 } from '@jsonforms/core'; +import { getSchema, getUiSchema } from '@jsonforms/core'; import { Property } from '@jsonforms/material-tree-renderer'; +export interface TreeEditorProps { + uischema: any; + schema: any; + rootData: any; + filterPredicate: any; + labelProvider: any; + imageProvider: any; +} + + export interface LabelDefinition { /** A constant label value displayed for every object for which this label definition applies. */ constant?: string; @@ -57,3 +68,13 @@ export const filterPredicate = (modelMapping) => (data: Object) => { return false; }; }; + +export const mapStateToTreeEditorProps = (state, ownProps) => { + return { + uischema: getUiSchema(state), + schema: getSchema(state), + filterPredicate: ownProps.filterPredicate, + labelProvider: ownProps.labelProvider, + imageProvider: ownProps.imageProvider + }; +};