import { B as BaseField } from './BaseField-461b6d0c.js';
import { h } from './index-102043e0.js';
import { r as registerField } from './index-336ef773.js';
import './date-ce777316.js';

class ReferenceField extends BaseField {
  constructor(id, title, titleField, imageField, otherCollection, fields, isSingle = false) {
    super(id, 'reference');
    this.title = title;
    this.titleField = titleField;
    this.imageField = imageField;
    this.otherCollection = otherCollection;
    this.fields = fields;
    this.isSingle = isSingle;
  }
  static decode(json) {
    return Object.assign(Object.create(ReferenceField.prototype), json);
  }
  showPreview() {
    this.preview = true;
    return this;
  }
  getDisplayValue(value) {
    return value;
  }
}
ReferenceField.type = 'reference';

// component generator
const render = (field, value, errors, disabled, onFieldChange, onFieldBlur) => h("dvn-field-input-date", { disabled: disabled, field: field, errors: errors, onChange: (v) => onFieldChange(field, v), onBlur: () => onFieldBlur(field), value: value });
// register 'date' field for json form generations
registerField('date', render);

export { ReferenceField as R };
