How to use the @jsonforms/core.getSchema 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 / webcomponent / src / JsonFormsElement.tsx View on Github external
set store(store: Store) {
    const setupStore = (
      schema: JsonSchema,
      uischema: UISchemaElement,
      d: any
    ) => {
      store.dispatch(Actions.init(d, schema, uischema));

      return store;
    };

    const data = getData(store.getState()) || {};

    RefParser.dereference(
      getSchema(store.getState()) || (Generate.jsonSchema(data) as any),
      getRefParserOptions(store.getState())
    ).then(resolvedSchema => {
      this._store = setupStore(
        resolvedSchema as any,
        getUiSchema(store.getState()),
        data
      );
      this.render();
    });
  }
github eclipsesource / jsonforms / packages / editor / src / ide.ts View on Github external
private render(): void {
    if (!this.connected || this._store === undefined) {
      return;
    }

    if (this.editor === undefined || this.editor === null) {
      this.editor = document.createElement('json-forms') as JsonFormsElement;
      this.appendChild(this.editor);
    }

    JsonRefs.resolveRefs(getSchema(this._store.getState()))
      .then(
        resolvedSchema => {
        this.editor.setInnerComponent(
          TreeRenderer,
          {
            uischema: getUiSchema(this._store.getState()),
            schema: resolvedSchema.resolved,
            filterPredicate: this._filterPredicate,
            labelProvider: this._labelProvider,
            imageProvider: this._imageProvider
          });
        this.editor.store = this._store;

        const exportButton = document.getElementById('export-data-button') as HTMLButtonElement;
        if (exportButton !== null) {
          const exportDialog = createExportDataDialog();
github eclipsesource / jsonforms / packages / editor / src / ide.ts View on Github external
get schema() {
    return getSchema(this._store.getState());
  }
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 / examples / src / uischema-registry.ts View on Github external
const resetServices = () => {
  const jsonforms = document.getElementsByTagName('json-forms')[0] as JsonFormsElement;
  const currentState = jsonforms.store.getState();
  jsonforms.store.dispatch({
    type: Actions.INIT,
    data,
    schema: getSchema(currentState),
    uischema: getUiSchema(currentState),
    styles: currentState.styles
  });
};
const tester = () => 5;
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 / AddItemDialog.tsx View on Github external
const mapStateToProps = (state: JsonFormsState, ownProps: any) => {
    const containerProperties = findContainerProperties(ownProps.schema, getSchema(state) as JsonSchema7, false);

    return {
        rootData: getData(state),
        defaultData: getDefaultData(state),
        containerProperties,
        rootSchema: getSchema(state),
        path: ownProps.path,
        schema: ownProps.schema,
        closeDialog: ownProps.closeDialog,
        dialogProps: ownProps.dialogProps,
        setSelection: ownProps.setSelection,
        labelProvider: ownProps.labelProvider
    };
};
github eclipsesource / jsonforms / packages / editor / src / tree / Dialog.tsx View on Github external
const mapStateToProps = (state, ownProps) => {
  const containerProps = getContainerProperties(state);
  let containerProperties;
  if (_.has(containerProps, ownProps.schema.id)) {
    containerProperties = containerProps[ownProps.schema.id];
  } else {
    containerProperties = retrieveContainerProperties(ownProps.schema, ownProps.schema);
  }
  return {
    rootData: getData(state),
    containerProperties,
    rootSchema: getSchema(state),
  };
};
github eclipsesource / jsonforms / packages / material-tree-renderer / example / App.tsx View on Github external
const App = ({
  store,
  filterPredicate,
  labelProviders,
  imageProvider
}: AppParameter) => (
  
    
      
        
        
      
    
  
);
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
  };
};