// # checkbox-boolean component /* Render a field that can edit a boolean with a checkbox. */ 'use strict'; import createReactClass from 'create-react-class'; import cx from 'classnames'; import FieldMixin from '@/src/mixins/field'; /** @jsx jsx */ import jsx from '@/src/jsx'; export default createReactClass({ displayName: 'CheckboxBoolean', mixins: [FieldMixin], onChange: function(event) { this.onChangeValue(event.target.checked); }, render: function() { return this.renderWithConfig(); }, renderDefault: function() { const config = this.props.config; const field = this.props.field; const fieldLabelOrHelp = config.fieldHelpText(field) || config.fieldLabel(field); return config.createElement( 'field', { typeName: 'CheckboxBoolean', config, field, plain: true, }, {' '} ); }, });