How to use the uniforms/createSchemaBridge.register function in uniforms

To help you get started, we’ve selected a few uniforms 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 vazco / uniforms / packages / uniforms-bridge-json-schema / src / register.ts View on Github external
import createSchemaBridge from 'uniforms/createSchemaBridge';

import JSONSchemaBridge from './JSONSchemaBridge';

// Register bridge.
createSchemaBridge.register(JSONSchemaBridge);
github vazco / uniforms / packages / uniforms-bridge-graphql / src / register.ts View on Github external
import createSchemaBridge from 'uniforms/createSchemaBridge';

import GraphQLBridge from './GraphQLBridge';

// Register bridge.
createSchemaBridge.register(GraphQLBridge);
github vazco / uniforms / packages / uniforms-bridge-simple-schema / src / register.ts View on Github external
import createSchemaBridge from 'uniforms/createSchemaBridge';
import filterDOMProps from 'uniforms/filterDOMProps';
// @ts-ignore
import { Match } from 'meteor/check'; // eslint-disable-line
// @ts-ignore
import { SimpleSchema } from 'meteor/aldeed:simple-schema'; // eslint-disable-line

import SimpleSchemaBridge from './SimpleSchemaBridge';

// Register bridge.
createSchemaBridge.register(SimpleSchemaBridge);

// Register custom property.
SimpleSchema.extendOptions({
  uniforms: Match.Optional(
    Match.OneOf(
      String,
      Function,
      Match.ObjectIncluding({
        component: Match.Optional(Match.OneOf(String, Function))
      })
    )
  )
});

// There's no possibility to retrieve them at runtime
filterDOMProps.register(
github vazco / uniforms / packages / uniforms-bridge-simple-schema-2 / src / register.ts View on Github external
import SimpleSchema from 'simpl-schema';
import createSchemaBridge from 'uniforms/createSchemaBridge';
import filterDOMProps from 'uniforms/filterDOMProps';

import SimpleSchema2Bridge from './SimpleSchema2Bridge';

// Register bridge.
createSchemaBridge.register(SimpleSchema2Bridge);

// Register custom property.
SimpleSchema.extendOptions(['uniforms']);

// There's no possibility to retrieve them at runtime
filterDOMProps.register(
  'allowedValues',
  'autoValue',
  'blackbox',
  'custom',
  'decimal',
  'defaultValue',
  'exclusiveMax',
  'exclusiveMin',
  'label',
  'max',
github vazco / uniforms / packages / uniforms / __tests__ / createSchemaBridge.ts View on Github external
it('recognizes a registered bridge', () => {
    class TestSchema {}
    class TestSchemaBridge extends Bridge {
      static check(schema: any) {
        return schema instanceof TestSchema;
      }
    }

    createSchemaBridge.register(TestSchemaBridge);

    expect(createSchemaBridge(new TestSchema())).toBeInstanceOf(
      TestSchemaBridge
    );
  });