import { h, Host } from '@stencil/core';
/**
 * @docsPage
 */
export class BsTabPanel {
  constructor() {
    this.activeTabId = undefined;
    this.tabId = undefined;
  }
  get isActive() {
    return this.activeTabId && this.activeTabId === this.tabId;
  }
  get panelId() {
    return this.hostEl.id || `${this.tabId}-panel`;
  }
  // avoid unnecessary re-renders
  componentShouldUpdate(newValue, oldValue, propName) {
    if (newValue === oldValue)
      return false;
    if (propName === 'activeTabId') {
      return newValue === this.tabId || oldValue === this.tabId;
    }
  }
  render() {
    return (h(Host, { id: this.panelId, "aria-labelledby": this.tabId, "data-active": this.isActive, role: "tabpanel" }, h("slot", null)));
  }
  static get is() { return "bs-tab-panel"; }
  static get properties() {
    return {
      "activeTabId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The id of the currently selected tab button."
        },
        "attribute": "active-tab-id",
        "reflect": false
      },
      "tabId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The id of the tab button corresponding to this tab panel."
        },
        "attribute": "tab-id",
        "reflect": false
      }
    };
  }
  static get elementRef() { return "hostEl"; }
}
//# sourceMappingURL=bs-tab-panel.js.map
