All files / src/components Transition.vue

100% Statements 4/4
50% Branches 1/2
100% Functions 1/1
100% Lines 4/4
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                                  2x 2x                                             2x                             7x          
<template>
    <div>
        <transition-path
            :path="transitionPath"
            :radius="transitionPathRadius"
            :stylingClass="stylingClass" />
        <chart-label
            ref="label"
            class="vue-workflow-chart-transition-label"
            :class="stylingClassLabel"
            :text="label.text"
            :anchor="label.point"
            @click="$emit('click', id)" />
    </div>
</template>
 
<script>
import Label from './Label.vue';
import TransitionPath from './TransitionPath.vue';
 
export default {
    name: 'Transition',
    components: {
        chartLabel: Label,
        TransitionPath,
    },
    props: {
        id: {
            type: String,
            required: true,
        },
        transitionPath: {
            type: Array,
            required: true,
        },
        transitionPathRadius: {
            type: Number,
            default: 0,
        },
        label: {
            type: Object,
            default: () => ({
                text: '',
                point: {
                    x: 0,
                    y: 0,
                },
            }),
        },
        stylingClass: {
            type: String,
            default: '',
        },
    },
    computed: {
        stylingClassLabel() {
            return (this.stylingClass) ? `vue-workflow-chart-transition-label-${this.stylingClass}` : "";
        },
    },
};
</script>