How to use @jsonforms/examples - 10 common examples

To help you get started, we’ve selected a few @jsonforms/examples 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 / example / src / reduxUtil.ts View on Github external
changeExampleData: (example: ReactExampleDescription) => {
    dispatch(changeExample(example));
    dispatch(Actions.init(example.data, example.schema, example.uischema));
    Actions.setConfig(example.config)(dispatch);
  },
  getComponent: (example: ReactExampleDescription) =>
github eclipsesource / jsonforms / packages / angular-material / example / app / store.ts View on Github external
import { combineReducers, Reducer } from 'redux';
import { jsonformsReducer, JsonFormsState } from '@jsonforms/core';
import { angularMaterialRenderers } from '../../src/index';
import { ExampleDescription, getExamples } from '@jsonforms/examples';

export const rootReducer: Reducer = combineReducers({
  jsonforms: jsonformsReducer(),
  examples: (state: ExampleDescription[] = []) => state
});

export const initialState = {
  jsonforms: {
    renderers: angularMaterialRenderers
  },
  examples: {
    data: getExamples()
  }
};
github eclipsesource / jsonforms / packages / example / src / index.tsx View on Github external
export const renderExample = (
  renderers: { tester: RankedTester; renderer: any }[],
  cells: { tester: RankedTester; cell: any }[],
  ...additionalStoreParams: AdditionalStoreParams[]
) => {
  const exampleData = enhanceExample(getExamples());
  const store = setupStore(
    exampleData,
    cells,
    renderers,
    additionalStoreParams
  );
  ReactDOM.render(
    
      
    ,
    document.getElementById('root')
  );
};
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
customReactExtension: (dispatch: Dispatch) => (
            
          ),
          onChange: i18n.onChange
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
)
        });
        return array;
      case 'i18n':
        return Object.assign({}, e, {
          customReactExtension: (dispatch: Dispatch) => (
            
          ),
          onChange: i18n.onChange
        });
      case '1220':
        const issue_1220 = Object.assign({}, e, {
          customReactExtension: (dispatch: Dispatch) => (
            <div>
              <button>
                  Issue1220Example.registerIssue1220UISchema(dispatch)
                }
              &gt;
                Register Issue 1220 UISchema
              </button>
              <button>
                  Issue1220Example.unregisterIssue1220UISchema(dispatch)
                }</button></div>
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
onClick={() =>
                  Issue1220Example.registerIssue1220UISchema(dispatch)
                }
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
onClick={() =>
                  Issue1220Example.unregisterIssue1220UISchema(dispatch)
                }
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
onClick={() =>
                  NestedArrayExample.registerNestedArrayUISchema(dispatch)
                }
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
onClick={() =>
                  NestedArrayExample.unregisterNestedArrayUISchema(dispatch)
                }
github eclipsesource / jsonforms / packages / example / src / util.tsx View on Github external
<button>
                  Issue1220Example.unregisterIssue1220UISchema(dispatch)
                }
              &gt;
                Unregister Issue 1220 UISchema
              </button>
            
          )
        });
        return issue_1220;
      case 'onChange':
        return {
          ...e,
          onChange: OnChangeExample.onChange
        };
      default:
        return e;
    }
  });