import { h } from './index-ecdfb761.js';
import { r as registerField } from './FieldGenerator-3ae403b2.js';
import { B as BaseField } from './BaseField-0b01dc2c.js';

class BooleanField extends 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) => 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
registerField('boolean', render);

export { BooleanField as B };
