import { Host, h } from '@stencil/core';
/** Actions/footer piece of the `bs-toast` component. */
export class BsToastActions {
  constructor() {
    this.isStacked = false;
    this.showDefault = false;
  }
  componentDidLoad() {
    if (this.actionsEl.childElementCount == 0) {
      this.showDefault = true;
    }
  }
  /** Stacks the actions when there are more than two (mobile only) */
  componentDidRender() {
    // Note: the default <slot> is counted as a child, so we're actually looking for 3 or more children
    if (this.actionsEl.childElementCount > 2) {
      this.isStacked = true;
    }
  }
  render() {
    return (h(Host, null, h("div", { ref: (el) => this.actionsEl = el, class: "bs-toast-actions", "data-stacked": this.isStacked }, this.showDefault && (h("bs-button", { size: "sm", "text-btn": true, onClick: () => this.defaultDismiss.emit() }, "Dismiss")), h("slot", null))));
  }
  static get is() { return "bs-toast-actions"; }
  static get originalStyleUrls() {
    return {
      "$": ["bs-toast-actions.scss"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["bs-toast-actions.css"]
    };
  }
  static get states() {
    return {
      "isStacked": {},
      "showDefault": {}
    };
  }
  static get events() {
    return [{
        "method": "defaultDismiss",
        "name": "defaultDismiss",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emits when dismissed by the default dismiss action (when no other actions are given)"
        },
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        }
      }];
  }
}
//# sourceMappingURL=bs-toast-actions.js.map
