import { Component, h, Prop, Element, State } from '@stencil/core';
import { openWormhole } from 'stencil-wormhole';
/**
 * @part base - The elements base wrapper.
 */
export class ScCard {
  componentWillLoad() {
    this.handleSlotChange();
  }
  handleSlotChange() {
    this.hasTitleSlot = !!this.el.querySelector('[slot="title"]');
  }
  render() {
    const Tag = this.href ? 'a' : 'div';
    return (h(Tag, { part: "base", class: {
        'card': true,
        'card--borderless': this.borderless,
        'card--no-padding': this.noPadding,
      } },
      h("slot", null)));
  }
  static get is() { return "sc-card"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["sc-card.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["sc-card.css"]
  }; }
  static get properties() { return {
    "noDivider": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Eliminate the divider"
      },
      "attribute": "no-divider",
      "reflect": false
    },
    "borderless": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Is this card borderless."
      },
      "attribute": "borderless",
      "reflect": false
    },
    "noPadding": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Remove padding"
      },
      "attribute": "no-padding",
      "reflect": false
    },
    "href": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "A link for the card."
      },
      "attribute": "href",
      "reflect": false
    },
    "loading": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Is this card loading."
      },
      "attribute": "loading",
      "reflect": false
    }
  }; }
  static get states() { return {
    "hasTitleSlot": {}
  }; }
  static get elementRef() { return "el"; }
}
openWormhole(ScCard, ['loading'], false);
