import { h } from '@stencil/core';
export class EclContentItem {
  constructor() {
    this.styleClass = '';
    this.theme = 'ec';
    this.image = undefined;
    this.imageAlt = undefined;
    this.imagePosition = 'left';
    this.imageSize = 'medium';
  }
  componentDidRender() {
    const picture = this.el.getElementsByTagName('picture')[0];
    const themeClass = `sc-ecl-content-item-${this.theme}`;
    if (picture) {
      picture.classList.add(`sc-ecl-content-item-${this.theme}`, 'ecl-content-item__picture', `ecl-content-item__picture--${this.imageSize}`, `ecl-content-item__picture--${this.imagePosition}`);
      if (this.imagePosition === 'right') {
        picture.parentElement.style.order = '1';
      }
      const img = picture.getElementsByTagName('img')[0];
      if (img) {
        img.classList.add(`ecl-content-item__image`, themeClass);
      }
    }
    const block = this.el.querySelector('.ecl-content-block');
    if (block) {
      block.classList.add(`ecl-content-item__content-block`, themeClass);
    }
  }
  getClass() {
    return [
      `ecl-content-item`,
      this.styleClass
    ].join(' ');
  }
  render() {
    return (h("article", { class: this.getClass() }, h("slot", { name: "picture" }), h("slot", { name: "content-block" })));
  }
  static get is() { return "ecl-content-item"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-content-item-ec.css"],
      "eu": ["./build/styles/ecl-content-item-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-content-item-ec.css"],
      "eu": ["./build/styles/ecl-content-item-eu.css"]
    };
  }
  static get properties() {
    return {
      "styleClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "style-class",
        "reflect": false,
        "defaultValue": "''"
      },
      "theme": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "theme",
        "reflect": false,
        "defaultValue": "'ec'"
      },
      "image": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image",
        "reflect": false
      },
      "imageAlt": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image-alt",
        "reflect": false
      },
      "imagePosition": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image-position",
        "reflect": false,
        "defaultValue": "'left'"
      },
      "imageSize": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image-size",
        "reflect": false,
        "defaultValue": "'medium'"
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-content-item.js.map
