function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from 'react';
import connectField from 'uniforms/connectField';
import filterDOMProps from 'uniforms/filterDOMProps';

var Bool = function Bool(_ref) {
    var disabled = _ref.disabled,
        id = _ref.id,
        inputRef = _ref.inputRef,
        label = _ref.label,
        name = _ref.name,
        _onChange = _ref.onChange,
        value = _ref.value,
        props = _objectWithoutProperties(_ref, ['disabled', 'id', 'inputRef', 'label', 'name', 'onChange', 'value']);

    return React.createElement(
        'div',
        filterDOMProps(props),
        label && React.createElement(
            'label',
            { htmlFor: id },
            label
        ),
        React.createElement('input', {
            checked: value,
            disabled: disabled,
            id: id,
            name: name,
            onChange: function onChange() {
                return disabled || _onChange(!value);
            },
            ref: inputRef,
            type: 'checkbox'
        })
    );
};

export default connectField(Bool);