All files / src/components State.vue

100% Statements 2/2
50% Branches 1/2
100% Functions 0/0
100% Lines 2/2
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                    2x                                                     9x          
<template>
    <chart-label
        class="vue-workflow-chart-state"
        :class="stylingClassState"
        :anchor="center"
        :text="label"
        @click="$emit('click', id)" />
</template>
 
<script>
import Label from "./Label.vue";
 
export default {
    name: "State",
    components: {
        chartLabel: Label,
    },
    props: {
        id: {
            type: String,
            required: true,
        },
        label: {
            type: String,
            required: true,
        },
        stylingClass: {
            type: String,
            default: "",
        },
        center: {
            type: Object,
            required: true,
        },
    },
    computed: {
        stylingClassState() {
            return (this.stylingClass) ? `vue-workflow-chart-state-${this.stylingClass}` : "";
        },
    },
};
</script>