'use strict';

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

const index = require('./index-35579fcb.js');

const balCardStepCss = ".sc-bal-card-step-h{display:block;position:static}.card-step-content.sc-bal-card-step{display:flex;flex:1}.is-hidden.sc-bal-card-step{display:none !important}";

const CardStep = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.isContentHidden = true;
    /**
     * This is the key of the step.
     */
    this.value = '';
    /**
     * Label for the step.
     */
    this.label = '';
    /**
     * If `true` the step is hidden in the steps navigation.
     */
    this.hidden = false;
    /**
     * If `true` the step is disabled.
     */
    this.disabled = false;
    /**
     * If `true` the step is done.
     */
    this.done = false;
    /**
     * Tell's if the step is active and the content is visible.
     */
    this.active = false;
  }
  activatedHandler(newActive) {
    this.isContentHidden = !newActive;
  }
  informParent() {
    this.parent.sync();
  }
  /**
   * Options of the step like label, value etc.
   */
  async getOptions() {
    return this.options;
  }
  /**
   * Sets the step active.
   */
  async setActive(active) {
    this.active = active;
  }
  get options() {
    return {
      value: this.value,
      label: this.label,
      active: this.active,
      done: this.done,
      disabled: this.disabled,
      hidden: this.hidden,
    };
  }
  get parent() {
    return this.element.closest('bal-card-steps');
  }
  componentWillLoad() {
    this.isContentHidden = !this.active;
    // if (this.active) {
    //   this.labelHandler()
    // }
  }
  render() {
    return (index.h(index.Host, { class: {
        'is-hidden': this.isContentHidden,
        'card-step-content': true,
      } }, index.h("slot", null)));
  }
  get element() { return index.getElement(this); }
  static get watchers() { return {
    "active": ["activatedHandler", "informParent"],
    "value": ["informParent"],
    "label": ["informParent"],
    "done": ["informParent"],
    "disabled": ["informParent"],
    "hidden": ["informParent"]
  }; }
};
CardStep.style = balCardStepCss;

exports.bal_card_step = CardStep;
