How to use the @jsonforms/core.getData function in @jsonforms/core

To help you get started, we’ve selected a few @jsonforms/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipsesource / jsonforms / packages / editor / src / ide.ts View on Github external
get data() {
    return getData(this._store.getState());
  }
github eclipsesource / jsonforms / packages / example / src / reduxUtil.ts View on Github external
const mapStateToProps = (state: any) => {
  const examples = state.examples.data;
  const selectedExample = state.examples.selectedExample || examples[0];
  const extensionState = state.examples.extensionState;
  return {
    dataAsString: JSON.stringify(getData(state), null, 2),
    examples,
    selectedExample,
    extensionState
  };
};
const mapDispatchToProps = (dispatch: Dispatch) => ({
github eclipsesource / jsonforms / packages / material-tree-renderer / src / tree / ObjectListItem.tsx View on Github external
const mapStateToProps = (state: JsonFormsState, ownProps: any) => {
  const index = indexFromPath(ownProps.path);
  const containerProperties: Property[] = findContainerProperties(
    ownProps.schema,
    getSchema(state) as JsonSchema7,
    false
  );

  return {
    index: index,
    rootData: getData(state),
    rootSchema: getSchema(state),
    containerProperties
  };
};
github eclipsesource / jsonforms / packages / material-tree-renderer / src / tree / TreeWithDetailRenderer.tsx View on Github external
);
  const visible = ownProps.visible !== undefined
    ? ownProps.visible
    : Runtime.isVisible(ownProps.uischema, rootData);
  const enabled = ownProps.enabled !== undefined
    ? ownProps.enabled
    : Runtime.isEnabled(ownProps.uischema, rootData);
  const rootSchema = getSchema(state);
  const resolvedSchema = Resolve.schema(
    ownProps.schema,
    ownProps.uischema.scope,
    rootSchema
  );

  return {
    rootData: getData(state),
    label: get(ownProps.uischema, 'label') as string,
    data: Resolve.data(rootData, path),
    uischema: ownProps.uischema,
    schema: resolvedSchema || rootSchema,
    uischemas: state.jsonforms.uischemas,
    path,
    visible,
    enabled,
    filterPredicate: ownProps.filterPredicate,
    imageProvider: ownProps.imageProvider,
    labelProviders: ownProps.labelProviders,
    rootSchema: getSchema(state),
    id: createId('tree'),
    errors: formatErrorMessage(
      union(
        getErrorAt(path, resolvedSchema || rootSchema)(state).map(
github eclipsesource / jsonforms / packages / material-tree-renderer / example / app-bar / EditorBar.tsx View on Github external
const mapStateToProps = (state: JsonFormsState) => {
  return {
    schema: getSchema(state),
    rootData: getData(state)
  };
};
github eclipsesource / jsonforms / packages / material-tree-renderer / src / tree / ExpandArray.tsx View on Github external
const mapStateToProps = (state: JsonFormsState) => ({
  rootData: getData(state)
});
github eclipsesource / jsonforms / packages / material-tree-renderer / src / tree / TreeWithDetailRenderer.tsx View on Github external
const mapStateToProps = (
  state: JsonFormsState,
  ownProps: OwnPropsOfTreeControl & WithImageProvider & WithLabelProviders
): StatePropsOfTreeWithDetail => {
  const rootData = getData(state);
  const path = Paths.compose(
    ownProps.path,
    Paths.fromScopable(ownProps.uischema)
  );
  const visible = ownProps.visible !== undefined
    ? ownProps.visible
    : Runtime.isVisible(ownProps.uischema, rootData);
  const enabled = ownProps.enabled !== undefined
    ? ownProps.enabled
    : Runtime.isEnabled(ownProps.uischema, rootData);
  const rootSchema = getSchema(state);
  const resolvedSchema = Resolve.schema(
    ownProps.schema,
    ownProps.uischema.scope,
    rootSchema
  );
github eclipsesource / jsonforms / packages / angular-material / src / other / label.renderer.ts View on Github external
const mapStateToProps = (
  state: JsonFormsState,
  ownProps: OwnPropsOfRenderer
) => {
  const visible =
    ownProps.visible !== undefined
      ? ownProps.visible
      : isVisible(ownProps.uischema, getData(state));

  return {
    visible
  };
};
github eclipsesource / jsonforms / packages / vanilla / src / additional / tree / TreeRenderer.tsx View on Github external
const mapStateToProps = (state, ownProps) => {
  const path = Paths.compose(ownProps.path, Paths.fromScopable(ownProps.uischema));
  const visible = _.has(ownProps, 'visible') ?
    ownProps.visible :  Runtime.isVisible(ownProps, state);
  const enabled = _.has(ownProps, 'enabled') ?
    ownProps.enabled :  Runtime.isEnabled(ownProps, state);
  const rootData = getData(state);

  return {
    rootData:  getData(state),
    resolvedRootData: Resolve.data(rootData, path),
    uischema: ownProps.uischema,
    schema: ownProps.schema,
    resolvedSchema: Resolve.schema(ownProps.schema, ownProps.uischema.scope.$ref),
    path,
    visible,
    enabled,
    getStyle: findStyle(state),
    getStyleAsClassName: findStyleAsClassName(state),
  };
};