'use strict';

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

const index = require('./index-7f52f1a2.js');

const balTabItemCss = ".sc-bal-tab-item-h{display:block;position:static}";

const TabItem = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.isContentHidden = true;
    /**
     * This is the key of the tab.
     */
    this.value = '';
    /**
     * Label for the tab.
     */
    this.label = '';
    /**
     * If `true` a small red bubble is added to the tab.
     */
    this.bubble = false;
    /**
     * If `true` the tab is disabled.
     */
    this.disabled = false;
    /**
     * If `true` the step is marked as done.
     */
    this.done = false;
    /**
     * If `true` the step is marked as failed.
     */
    this.failed = false;
    /**
     * Tell's if the tab is active and the content is visible.
     */
    this.active = false;
  }
  activatedHandler(newActive) {
    this.isContentHidden = !newActive;
  }
  informParent() {
    this.parent.sync();
  }
  /**
   * Options of the tab like label, value etc.
   */
  async getOptions() {
    return this.options;
  }
  /**
   * Sets the tab active.
   */
  async setActive(active) {
    this.active = active;
  }
  get options() {
    return {
      value: this.value,
      label: this.label,
      active: this.active,
      disabled: this.disabled,
      done: this.done,
      failed: this.failed,
      hasBubble: this.bubble,
    };
  }
  get parent() {
    return this.element.closest('bal-tabs');
  }
  componentWillLoad() {
    this.isContentHidden = !this.active;
  }
  render() {
    return (index.h(index.Host, null, index.h("div", { style: this.isContentHidden && { display: 'none' } }, index.h("slot", null))));
  }
  get element() { return index.getElement(this); }
  static get watchers() { return {
    "active": ["activatedHandler", "informParent"],
    "value": ["informParent"],
    "bubble": ["informParent"],
    "disabled": ["informParent"],
    "label": ["informParent"],
    "done": ["informParent"],
    "failed": ["informParent"]
  }; }
};
TabItem.style = balTabItemCss;

exports.bal_tab_item = TabItem;
