<template>
  <div
    class="hn-steps"
    :class="[
       !simple && 'hn-steps--' + direction,
       simple && 'hn-steps--simple'
     ]">
      <slot></slot>
  </div>
</template>

<script>
import Migrating from 'heiner-ui/src/mixins/migrating';

export default {
  name: 'HnSteps',

  mixins: [Migrating],

  props: {
    space: [Number, String],
    active: Number,
    direction: {
      type: String,
      default: 'horizontal'
    },
    alignCenter: Boolean,
    simple: Boolean,
    finishStatus: {
      type: String,
      default: 'finish'
    },
    processStatus: {
      type: String,
      default: 'process'
    }
  },

  data() {
    return {
      steps: [],
      stepOffset: 0
    };
  },

  created() {
    this.steps = this.$slots.default.filter(vNode => vNode.tag && vNode.tag.toUpperCase().indexOf('STEP') > -1);
  },

  methods: {
    getMigratingConfig() {
      return {
        props: {
          'center': 'center is removed.'
        }
      };
    }
  },

  watch: {
    active(newVal, oldVal) {
      this.$emit('change', newVal, oldVal);
    }
  }
};
</script>
