'use strict';

const index = require('./index-1141a245.js');
const FieldGenerator = require('./FieldGenerator-279a646b.js');
const BaseField = require('./BaseField-381327a9.js');

class BooleanField extends BaseField.BaseField {
  constructor(id, title, description, label) {
    super(id, 'boolean');
    this.id = id;
    this.title = title;
    this.description = description;
    this.label = label;
  }
  showPreview() {
    this.preview = true;
    return this;
  }
  getDisplayValue(value) {
    return value;
  }
  setLabelType(labelType) {
    this.labelType = labelType;
    return this;
  }
}
BooleanField.type = 'boolean';

// component generator
const render = (field, value, errors, disabled, onFieldChange, onFieldBlur) => index.h("dvn-field-input-boolean", { disabled: disabled, field: field, errors: errors, onChange: (e) => onFieldChange(field, e.detail), onBlur: () => onFieldBlur(field), value: value });
// register 'text' field for json form generations
FieldGenerator.registerField('boolean', render);

exports.BooleanField = BooleanField;
