How to use the uniforms/filterDOMProps 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 / TextField.js View on Github external
type,
  value,
  ...props
}) => (
   disabled || onChange(event.target.value)}
    placeholder={placeholder}
    ref={inputRef}
    type={type}
    value={value}
    {...filterDOMProps(props)}
  />
);
Text.defaultProps = {
github vazco / uniforms / packages / uniforms-material / src / ErrorField.js View on Github external
errorMessage,
  fullWidth,
  margin,
  variant,
  ...props
}) =>
  !error ? (
    nothing
  ) : (
    
      
        {children || errorMessage}
      
    
  );
Error.defaultProps = {
github vazco / uniforms / packages / uniforms-antd / src / LongTextField.tsx View on Github external
const LongText = props =>
  wrapField(
    props,
    <textarea name="{props.name}" id="{props.id}" disabled="{props.disabled}"> props.onChange(event.target.value)}
      placeholder={props.placeholder}
      ref={props.inputRef}
      value={props.value}
      {...textAreaProps}
      {...filterDOMProps(props)}
    /&gt;
  );
</textarea>
github vazco / uniforms / packages / uniforms-unstyled / src / BoolField.js View on Github external
const Bool = ({
  disabled,
  id,
  inputRef,
  label,
  name,
  onChange,
  value,
  ...props
}) =&gt; (
  <div>
    <input name="{name}" id="{id}" disabled="{disabled}" checked="{value}"> disabled || onChange(!value)}
      ref={inputRef}
      type="checkbox"
    /&gt;

    {label &amp;&amp; <label>{label}</label>}
  </div>
);
export default connectField(Bool);
github vazco / uniforms / packages / uniforms-bootstrap4 / src / ListDelField.tsx View on Github external
const fieldIndex = +name.slice(1 + name.lastIndexOf('.'));
  const limitNotReached =
    !disabled &amp;&amp; !(parent.minCount &gt;= parent.value.length);

  return (
    <span>
        limitNotReached &amp;&amp;
        parent.onChange(
          []
            .concat(parent.value.slice(0, fieldIndex))
            .concat(parent.value.slice(1 + fieldIndex))
        )
      }
      {...filterDOMProps(props)}
    &gt;
      {removeIcon}
    </span>
  );
};
github vazco / uniforms / packages / uniforms-semantic / src / ListDelField.js View on Github external
const ListDel = ({ className, disabled, name, parent, ...props }) =&gt; {
  const fieldIndex = +name.slice(1 + name.lastIndexOf('.'));
  const limitNotReached =
    !disabled &amp;&amp; !(parent.minCount &gt;= parent.value.length);

  return (
    <i close="">
        limitNotReached &amp;&amp;
        parent.onChange(
          []
            .concat(parent.value.slice(0, fieldIndex))
            .concat(parent.value.slice(1 + fieldIndex))
        )
      }
    /&gt;
  );</i>
github vazco / uniforms / packages / uniforms-semantic / src / DateField.js View on Github external
inputRef,
  label,
  max,
  min,
  name,
  onChange,
  placeholder,
  required,
  showInlineError,
  value,
  wrapClassName,
  ...props
}) =&gt; (
  <div required="">
    {label &amp;&amp; <label>{label}</label>}

    <div>
      </div></div>
github vazco / uniforms / packages / uniforms-unstyled / src / NumField.js View on Github external
const Num_ = ({
  decimal,
  disabled,
  id,
  inputRef,
  label,
  max,
  min,
  name,
  onChange,
  placeholder,
  step,
  value,
  ...props
}) =&gt; (
  <div>
    {label &amp;&amp; <label>{label}</label>}

    <input value="{value}" type="number" step="{step" placeholder="{placeholder}" name="{name}" min="{min}" max="{max}" id="{id}" disabled="{disabled}">
  </div>
github vazco / uniforms / packages / uniforms-semantic / src / LongTextField.js View on Github external
error,
  errorMessage,
  id,
  inputRef,
  label,
  name,
  onChange,
  placeholder,
  required,
  showInlineError,
  value,
  ...props
}) =&gt; (
  <div required="">
    {label &amp;&amp; <label>{label}</label>}

    <textarea name="{name}" id="{id}" disabled="{disabled}"> onChange(event.target.value)}
      placeholder={placeholder}
      ref={inputRef}
      value={value}
    /&gt;

    {!!(error &amp;&amp; showInlineError) &amp;&amp; (
      &lt;div className="ui red basic pointing label"&gt;{errorMessage}&lt;/div&gt;
    )}</textarea></div>
github vazco / uniforms / packages / uniforms-semantic / src / HiddenField.tsx View on Github external
render() {
    const props = this.getFieldProps();

    return props.noDOM ? (
      nothing
    ) : (
      <input value="{props.value}" type="hidden" name="{props.name}" id="{props.id}" disabled="{props.disabled}">
    );
  }
}