import { r as registerInstance, h, H as Host } from './index-55faf181.js';

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

const DvnFieldDisplayCellRelationReference = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    const { field } = this;
    const value = this.value || [];
    return (h(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 (h("abbr", { title: data[field.titleField] }, h("dvn-image", { bordered: true, leanedVertically: true, src: imageSrc, text: initialLetters })));
    })));
  }
};
DvnFieldDisplayCellRelationReference.style = dvnFieldDisplayCellRelationReferenceCss;

export { DvnFieldDisplayCellRelationReference as dvn_field_display_cell_relation_reference };
