'use strict';

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

const index = require('./index-7cdf1df1.js');
require('./BaseField-f50bb8f0.js');
const attachment = require('./attachment-c2bc9126.js');

const dvnFieldDisplayCellAttachmentCss = ".sc-dvn-field-display-cell-attachment-h{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";

const DvnFieldDisplayCellAttachment = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    const { field } = this;
    if (field.sourceType === attachment.AttachmentSourceType.RawUrl) {
      const src = this.value;
      return (index.h(index.Host, null, index.h("dvn-image", { leaned: true, bordered: true, src: src, shape: field.shape })));
    }
    let attachments = [];
    if (field.sourceType === attachment.AttachmentSourceType.AttachmentObject) {
      attachments = [this.value];
    }
    else if (field.sourceType === attachment.AttachmentSourceType.AttachmentObjects) {
      attachments = this.value;
    }
    return (index.h(index.Host, null, attachments.map(attachment => (index.h("dvn-image", { leaned: true, bordered: true, src: attachment.url })))));
  }
};
DvnFieldDisplayCellAttachment.style = dvnFieldDisplayCellAttachmentCss;

exports.dvn_field_display_cell_attachment = DvnFieldDisplayCellAttachment;
