'use strict';

const index$1 = require('./index-ce58ddc5.js');
const index = require('./index-7e3bc620.js');
const BaseField = require('./BaseField-d019ade6.js');

class NumberField extends BaseField.BaseField {
  constructor(id, title, placeholder, description, step = 1, min = -Infinity, max = Infinity) {
    super(id, 'number');
    this.title = title;
    this.placeholder = placeholder;
    this.description = description;
    this.step = step;
    this.min = min;
    this.max = max;
  }
  showPreview() {
    this.preview = true;
    return this;
  }
  getDisplayValue(value) {
    return value;
  }
}
NumberField.type = 'number';

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

class RangeField extends BaseField.BaseField {
  constructor(id, title, description, step = 1, min = 0, max = 5) {
    super(id, 'range');
    this.title = title;
    this.description = description;
    this.step = step;
    this.min = min;
    this.max = max;
  }
  showPreview() {
    this.preview = true;
    return this;
  }
  getDisplayValue(value) {
    return value;
  }
  setInputType(inputType) {
    this.inputType = inputType;
    return this;
  }
}
RangeField.type = 'range';

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

class SectionHeaderField extends BaseField.BaseField {
  constructor(id, header, sectionDescription) {
    super(id, 'sectionHeader');
    this.id = id;
    this.header = header;
    this.sectionDescription = sectionDescription;
  }
}
SectionHeaderField.type = 'sectionHeader';

const render = (field, 
// @ts-ignore
value, 
// @ts-ignore
errors, disabled, onFieldChange, onFieldBlur) => index$1.h("dvn-field-input-section-header", { disabled: disabled, field: field, onChange: (v) => onFieldChange(field, v), onBlur: () => onFieldBlur(field) });
// register 'sectionHeader' key for json form generations
index.registerField('sectionHeader', render);

exports.NumberField = NumberField;
exports.RangeField = RangeField;
exports.SectionHeaderField = SectionHeaderField;
