How to use the uniforms/filterDOMProps.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-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',
  'maxCount',
  'min',
  'minCount',
  'optional',
  'regEx',
  'trim',
github vazco / uniforms / packages / uniforms-bridge-simple-schema / src / register.ts View on Github external
// 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(
  'allowedValues',
  'autoValue',
  'blackbox',
  'custom',
  'decimal',
  'defaultValue',
  'exclusiveMax',
  'exclusiveMin',
  'label',
  'max',
  'maxCount',
  'min',
  'minCount',
  'optional',
  'regEx',
  'trim',
github vazco / uniforms / packages / uniforms / __tests__ / filterDOMProps.ts View on Github external
it('removes registered props', () => {
    filterDOMProps.register('__special__');

    expect(filterDOMProps({ __special__: true })).toEqual({});
  });
github vazco / uniforms / packages / uniforms-antd / __tests__ / combined.js View on Github external
import AutoForm       from 'uniforms-antd/AutoForm';
import ErrorField     from 'uniforms-antd/ErrorField';
import ErrorsField    from 'uniforms-antd/ErrorsField';
import FormGroup      from 'uniforms-antd/FormGroup';
import HiddenField    from 'uniforms-antd/HiddenField';
import ListAddField   from 'uniforms-antd/ListAddField';
import ListDelField   from 'uniforms-antd/ListDelField';
import ListField      from 'uniforms-antd/ListField';
import ListItemField  from 'uniforms-antd/ListItemField';
import LongTextField  from 'uniforms-antd/LongTextField';
import NumField       from 'uniforms-antd/NumField';
import SelectField    from 'uniforms-antd/SelectField';
import SubmitField    from 'uniforms-antd/SubmitField';
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register(
    '__type__',
    'allowedValues',
    'checkboxes',
    'component',
    'maxCount',
    'minCount',
    'subfields'
);

describe('Everything', () => {
    const validator = jest.fn();

    const onChange = jest.fn();
    const onSubmit = jest.fn();

    const dateA = new Date(2004, 4, 4);
github vazco / uniforms / packages / uniforms-bootstrap3 / __tests__ / combined.js View on Github external
import AutoForm       from 'uniforms-bootstrap3/AutoForm';
import ErrorField     from 'uniforms-bootstrap3/ErrorField';
import ErrorsField    from 'uniforms-bootstrap3/ErrorsField';
import FormGroup      from 'uniforms-bootstrap3/FormGroup';
import HiddenField    from 'uniforms-bootstrap3/HiddenField';
import ListAddField   from 'uniforms-bootstrap3/ListAddField';
import ListDelField   from 'uniforms-bootstrap3/ListDelField';
import ListField      from 'uniforms-bootstrap3/ListField';
import ListItemField  from 'uniforms-bootstrap3/ListItemField';
import LongTextField  from 'uniforms-bootstrap3/LongTextField';
import NumField       from 'uniforms-bootstrap3/NumField';
import SelectField    from 'uniforms-bootstrap3/SelectField';
import SubmitField    from 'uniforms-bootstrap3/SubmitField';
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register(
    '__type__',
    'allowedValues',
    'checkboxes',
    'component',
    'maxCount',
    'minCount',
    'subfields'
);

describe('Everything', () => {
    const validator = jest.fn();

    const onChange = jest.fn();
    const onSubmit = jest.fn();

    const dateA = new Date(2004, 4, 4);
github vazco / uniforms / packages / uniforms-material / __tests__ / combined.js View on Github external
import DateField      from 'uniforms-material/DateField';
import ErrorField     from 'uniforms-material/ErrorField';
import ErrorsField    from 'uniforms-material/ErrorsField';
import HiddenField    from 'uniforms-material/HiddenField';
import ListAddField   from 'uniforms-material/ListAddField';
import ListDelField   from 'uniforms-material/ListDelField';
import ListField      from 'uniforms-material/ListField';
import ListItemField  from 'uniforms-material/ListItemField';
import LongTextField  from 'uniforms-material/LongTextField';
import NumField       from 'uniforms-material/NumField';
import RadioField     from 'uniforms-material/RadioField';
import SelectField    from 'uniforms-material/SelectField';
import SubmitField    from 'uniforms-material/SubmitField';
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register(
    '__type__',
    'allowedValues',
    'checkboxes',
    'component',
    'maxCount',
    'minCount',
    'subfields'
);

tapEventPlugin();

describe('Everything', () => {
    const validator = jest.fn();

    const onChange = jest.fn();
    const onSubmit = jest.fn();
github vazco / uniforms / packages / uniforms-unstyled / __tests__ / combined.js View on Github external
import AutoFields     from 'uniforms-unstyled/AutoFields';
import AutoForm       from 'uniforms-unstyled/AutoForm';
import ErrorField     from 'uniforms-unstyled/ErrorField';
import ErrorsField    from 'uniforms-unstyled/ErrorsField';
import HiddenField    from 'uniforms-unstyled/HiddenField';
import ListAddField   from 'uniforms-unstyled/ListAddField';
import ListDelField   from 'uniforms-unstyled/ListDelField';
import ListField      from 'uniforms-unstyled/ListField';
import ListItemField  from 'uniforms-unstyled/ListItemField';
import LongTextField  from 'uniforms-unstyled/LongTextField';
import NumField       from 'uniforms-unstyled/NumField';
import SelectField    from 'uniforms-unstyled/SelectField';
import SubmitField    from 'uniforms-unstyled/SubmitField';
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register(
    '__type__',
    'allowedValues',
    'checkboxes',
    'component',
    'maxCount',
    'minCount',
    'subfields'
);

describe('Everything', () => {
    const validator = stub();

    const onChange = spy();
    const onSubmit = spy();

    const dateA = new Date(2004, 4, 4);
github vazco / uniforms / packages / uniforms-semantic / __tests__ / combined.js View on Github external
import AutoFields     from 'uniforms-semantic/AutoFields';
import AutoForm       from 'uniforms-semantic/AutoForm';
import ErrorField     from 'uniforms-semantic/ErrorField';
import ErrorsField    from 'uniforms-semantic/ErrorsField';
import HiddenField    from 'uniforms-semantic/HiddenField';
import ListAddField   from 'uniforms-semantic/ListAddField';
import ListDelField   from 'uniforms-semantic/ListDelField';
import ListField      from 'uniforms-semantic/ListField';
import ListItemField  from 'uniforms-semantic/ListItemField';
import LongTextField  from 'uniforms-semantic/LongTextField';
import NumField       from 'uniforms-semantic/NumField';
import SelectField    from 'uniforms-semantic/SelectField';
import SubmitField    from 'uniforms-semantic/SubmitField';
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register(
    '__type__',
    'allowedValues',
    'checkboxes',
    'component',
    'maxCount',
    'minCount',
    'subfields'
);

describe('Everything', () => {
    const validator = jest.fn();

    const onChange = jest.fn();
    const onSubmit = jest.fn();

    const dateA = new Date(2004, 4, 4);
github vazco / uniforms / packages / uniforms-antd / src / wrapField.tsx View on Github external
help={help || (showInlineError && error && errorMessage)}
      extra={extra}
      htmlFor={id}
      label={labelNode}
      labelCol={labelCol}
      required={required}
      style={wrapperStyle || { marginBottom: '12px' }}
      validateStatus={error ? 'error' : undefined}
      wrapperCol={wrapperCol}
    >
      {children}
    
  );
}

filterDOMProps.register('colon', 'labelCol', 'wrapperCol', 'wrapperStyle');
github vazco / uniforms / packages / uniforms-bootstrap4 / src / gridClassName.ts View on Github external
import filterDOMProps from 'uniforms/filterDOMProps';

filterDOMProps.register('grid');

function gridClassNamePart(size, value, side) {
  const sizeInfix = size === 'xs' ? '' : `${size}-`;
  return side === 'label'
    ? `col-${sizeInfix}${value}`
    : `col-${sizeInfix}${12 - value}`;
}

const gridOrder = {
  xs: 1,
  sm: 2,
  md: 3,
  lg: 4,
  xl: 5
};