How to use the @jsonforms/react.useJsonForms function in @jsonforms/react

To help you get started, we’ve selected a few @jsonforms/react 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 / vanilla / src / util / index.tsx View on Github external
export const withVanillaControlProps = (Component: ComponentType) => (props: any) => {
  const ctx = useJsonForms();
  const controlElement = props.uischema as ControlElement;
  const config = ctx.config;
  const trim = config && config.trim;
  const styles = findStyle(ctx.styles)('control');
  let classNames: string[] = !isEmpty(controlElement.scope)
    ? styles.concat([`${convertToValidClassName(controlElement.scope)}`])
    : [''];

  if (trim) {
    classNames = classNames.concat(findStyle(ctx.styles)('control.trim'));
  }
  const isValid = isEmpty(props.errors);
  const labelClass = findStyleAsClassName(ctx.styles)('control.label');
  const descriptionClassName = findStyleAsClassName(ctx.styles)('input.description');
  const inputClassName = ['validate'].concat(isValid ? 'valid' : 'invalid');
  return (
github eclipsesource / jsonforms / packages / vanilla / src / util / index.tsx View on Github external
export const withVanillaCellProps = (Component: ComponentType) => (props: any) => {
  const ctx = useJsonForms();
  const inputClassName = ['validate'].concat(
    props.isValid ? 'valid' : 'invalid'
  );

  return (
    
  )
};
github eclipsesource / jsonforms / packages / material / src / complex / MaterialTableControl.tsx View on Github external
const NonEmptyCell = (ownProps: OwnPropsOfNonEmptyCell) => {
  const ctx = useJsonForms();
  const {
    path,
    propName,
    schema,
    rootSchema,
    errors,
    enabled
  } = ctxToNonEmptyCellProps(ctx, ownProps);

  const isValid = isEmpty(errors);

  return (
    
      {schema.properties ? (