How to use the uniforms.BaseField.contextTypes 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-material / src / SubmitField.tsx View on Github external
const SubmitField = (
  { children, disabled, inputRef, label, value, ...props }: any,
  { uniforms: { error, state } },
) => (
  <button value="{value}" type="submit" disabled="{disabled">
    {children || label}
  </button>
);

SubmitField.contextTypes = BaseField.contextTypes;
SubmitField.defaultProps = { label: 'Submit', variant: 'contained' };

export default SubmitField;
github vazco / uniforms / packages / uniforms-unstyled / src / ErrorsField.tsx View on Github external
) =&gt;
  !error &amp;&amp; !children ? (
    nothing
  ) : (
    <div>
      {children}

      <ul>
        {schema.getErrorMessages(error).map((message, index) =&gt; (
          <li>{message}</li>
        ))}
      </ul>
    </div>
  );

ErrorsField.contextTypes = BaseField.contextTypes;

export default ErrorsField;
github vazco / uniforms / packages / uniforms-semantic / src / ErrorsField.tsx View on Github external
) : (
    <div>
      {children}

      <ul>
        {schema.getErrorMessages(error).map((message, index) =&gt; (
          <li>{message}</li>
        ))}
      </ul>
    </div>
  );

ErrorsField.contextTypes = BaseField.contextTypes;

export default ErrorsField;
github vazco / uniforms / packages / uniforms-antd / src / ErrorsField.tsx View on Github external
!error &amp;&amp; !children ? (
    nothing
  ) : (
    <div>
      {children}
      <ul>
        {schema.getErrorMessages(error).map((message, index) =&gt; (
          <li style="{{">
            {message}
          </li>
        ))}
      </ul>
    </div>
  );

ErrorsField.contextTypes = BaseField.contextTypes;
ErrorsField.defaultProps = {
  style: {
    backgroundColor: 'rgba(255, 85, 0, 0.2)',
    border: '1px solid rgb(255, 85, 0)',
    borderRadius: '7px',
    margin: '20px 0px',
    padding: '10px',
  },
};

export default ErrorsField;
github vazco / uniforms / packages / uniforms-bootstrap3 / src / SubmitField.tsx View on Github external
<div>
          {blockInput}
        </div>
      )}

      {!hasWrap &amp;&amp; blockInput}
    
  );
};

SubmitField.contextTypes = BaseField.contextTypes;
SubmitField.defaultProps = { inputClassName: 'btn btn-primary' };

export default SubmitField;
github vazco / uniforms / packages / uniforms-semantic / src / SubmitField.tsx View on Github external
const SubmitField = (
  { className, disabled, inputRef, value, ...props }: any,
  { uniforms: { error, state } },
) =&gt; (
  <input value="" type="submit" disabled="{disabled">
);

SubmitField.contextTypes = BaseField.contextTypes;

export default SubmitField;
github vazco / uniforms / packages / uniforms-antd / src / SubmitField.tsx View on Github external
state: { disabled },
    },
  },
) =&gt; (
  <button type="primary" disabled="{!!(error">
    {value}
  </button>
);

SubmitField.contextTypes = BaseField.contextTypes;
SubmitField.defaultProps = { value: 'Submit' };

export default SubmitField;
github vazco / uniforms / packages / uniforms-bootstrap4 / src / ErrorsField.tsx View on Github external
className={classnames('card border-danger mb-3 text-danger', className)}
      {...filterDOMProps(props)}
    &gt;
      <div>
        {children}

        {schema.getErrorMessages(error).map((message, index) =&gt; (
          <div>
            {message}
          </div>
        ))}
      </div>
    
  );

ErrorsField.contextTypes = BaseField.contextTypes;

export default ErrorsField;
github vazco / uniforms / packages / uniforms-bootstrap4 / src / SubmitField.tsx View on Github external
<div>
          {blockInput}
        </div>
      )}

      {!hasWrap &amp;&amp; blockInput}
    
  );
};

SubmitField.contextTypes = BaseField.contextTypes;
SubmitField.defaultProps = { inputClassName: 'btn btn-primary' };

export default SubmitField;
github vazco / uniforms / packages / uniforms-unstyled / src / SubmitField.tsx View on Github external
import { BaseField, filterDOMProps } from 'uniforms';

const SubmitField = (
  { disabled, inputRef, value, ...props }: any,
  { uniforms: { error, state } },
) =&gt; (
  <input value="" type="submit" disabled="{disabled">
);

SubmitField.contextTypes = BaseField.contextTypes;

export default SubmitField;