'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-36b3af04.js');

const dvnFieldDisplayCellRelationReferenceCss = ".sc-dvn-field-display-cell-relation-reference-h{display:-ms-flexbox;display:flex;overflow:auto}";

const DvnFieldDisplayCellRelationReference = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    const { field } = this;
    const value = this.value || [];
    return (index.h(index.Host, null, value.map(relation => {
      const data = relation[field.nameOfOtherCollectionInRelationCollection];
      const imageSrc = field.imageField ? data[field.imageField] : undefined;
      const initialLetters = field.titleField
        ? data[field.titleField].split(' ').map(word => word[0]).join('')
        : undefined;
      return (index.h("abbr", { title: data[field.titleField] }, index.h("dvn-image", { bordered: true, leanedVertically: true, src: imageSrc, text: initialLetters })));
    })));
  }
};
DvnFieldDisplayCellRelationReference.style = dvnFieldDisplayCellRelationReferenceCss;

exports.dvn_field_display_cell_relation_reference = DvnFieldDisplayCellRelationReference;
