How to use the @jsonforms/core.Paths.compose 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 / vanilla / src / complex / TableArrayControl.tsx View on Github external
data.map((_child, index) => {
                  const childPath = Paths.compose(
                    path,
                    `${index}`
                  );
                  // TODO
                  const errorsPerEntry: any[] = filter(childErrors, error =>
                    error.dataPath.startsWith(childPath)
                  );

                  return (
                    
                      {schema.properties ? (
                        fpflow(
                          fpkeys,
                          fpfilter(
                            prop => schema.properties[prop].type !== 'array'
                          ),
github eclipsesource / jsonforms / packages / editor / src / tree / Dialog.tsx View on Github external
onClick={() => {
                  const newData = _.keys(prop.schema.properties).reduce(
                    (d, key) => {
                      if (prop.schema.properties[key].default) {
                        d[key] = prop.schema.properties[key].default;
                      }

                      // FIXME generate id if identifying property is set in editor to allow id refs
                      return d;
                    },
                    {}
                  );

                  const arrayPath = Paths.compose(path, prop.property);
                  const array = Resolve.data(rootData, arrayPath) as any[];
                  const selectionIndex = _.isEmpty(array) ? 0 : array.length;
                  const selectionPath = Paths.compose(arrayPath, selectionIndex.toString());

                  add(path, prop, newData);
                  setSelection(prop.schema, newData, selectionPath)();
                  closeDialog();
                }}
              >
github eclipsesource / jsonforms / packages / material / src / complex / MaterialTableControl.tsx View on Github external
return getValidColumnProps(schema).map(prop => {
      const cellPath = Paths.compose(
        rowPath,
        prop
      );
      const props = {
        propName: prop,
        schema,
        rowPath,
        cellPath,
        enabled
      };

      return ;
    });
  } else {
github eclipsesource / jsonforms / packages / material-tree-renderer / src / tree / ExpandRootArray.tsx View on Github external
return data.map((_element: any, index: number) => {
      const composedPath = Paths.compose(path, index.toString());

      return (
        
      );
    });
};
github eclipsesource / jsonforms / packages / vanilla / src / additional / tree / TreeRenderer.tsx View on Github external
const controlElement = uischema as MasterDetailLayout;
    this.setState({
      dialog: {
        open: false,
        schema: undefined,
        path: undefined
      }
    });

    const path = Paths.fromScopable(controlElement);
    if (_.isArray(resolvedRootData)) {
      this.setState({
        selected: {
          schema: resolvedSchema.items,
          data: resolvedRootData[0],
          path: Paths.compose(path, '0')
        }
      });
    } else {
      this.setState({
        selected: {
          schema: resolvedSchema,
          data: resolvedRootData,
          path: path
        }
      });
    }
  }
github eclipsesource / jsonforms / packages / material / src / complex / table-array.control.tsx View on Github external
No data : data.map((_child, index) => {
              const childPath = Paths.compose(path, index + '');

              return (
                
                  {
                    _.chain(resolvedSchema.properties)
                      .keys()
                      .filter(prop => resolvedSchema.properties[prop].type !== 'array')
                      .map((prop, idx) => {
                        return (
github eclipsesource / jsonforms / packages / editor / src / tree / Dialog.tsx View on Github external
add(path, prop, newData) {
      dispatch(
        update(
          Paths.compose(path, prop.property),
          array => {
            if (_.isEmpty(array)) {
              return [newData];
            }
            array.push(newData);

            return array;
          }
        )
      );
    }
});
github eclipsesource / jsonforms / packages / vanilla / src / complex / TableArrayControl.tsx View on Github external
fpmap(prop => {
                            const childPropPath = Paths.compose(
                              childPath,
                              prop.toString()
                            );

                            return (
                              
                                
                              
                            );
                          })
                        )(schema.properties)