all files / src/stepper/ stepButton.vue

0% Statements 0/1
100% Branches 0/0
100% Functions 0/0
0% Lines 0/1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72                                                                                                                                               
<template>
<abstract-button @click="handleClick" :centerRipple="false" class="mu-step-button" :disabled="disabled">
  <step-label :active="active" :completed="completed" :num="num" :disabled="disabled" v-if="childrenInLabel">
    <slot></slot>
    <slot name="icon" slot="icon"></slot>
  </step-label>
  <slot v-if="!childrenInLabel"></slot>
</abstract-button>
</template>
 
<script>
import abstractButton from '../internal/abstractButton'
import stepLabel from './stepLabel'
export default {
  name: 'mu-step-button',
  props: {
    active: {
      type: Boolean
    },
    completed: {
      type: Boolean
    },
    disabled: {
      type: Boolean
    },
    num: {
      type: [String, Number]
    },
    last: {
      type: Boolean
    },
    childrenInLabel: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    handleClick (event) {
      this.$emit('click', event)
    }
  },
  components: {
    abstractButton,
    'step-label': stepLabel
  }
}
</script>
 
<style lang="less">
@import "../styles/import.less";
.mu-step-button {
  border: 10px;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  margin: 0px;
  padding: 0px;
  outline: none;
  font-size: inherit;
  font-weight: inherit;
  transform: translate(0px, 0px);
  background-color: transparent;
  transition: all 450ms @easeOutFunction 0ms;
  .mu-stepper-vertical & {
    width: 100%;
  }
  &.hover {
    background-color: fade(@black, 6%);
  }
}
</style>