All files / src/components/m-complex.vue item.vue

73.68% Statements 14/19
25% Branches 3/12
50% Functions 2/4
72.22% Lines 13/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 73 74      7x     7x                                                                                                                       7x 7x            
<template>
<div :class="$style.root"
    :selected="parentVM.multiple ? currentSelected : isSelected" :readonly="parentVM.readonly" :disabled="disabled || parentVM.disabled"
    @click="parentVM.router ? onClick($event) : select($event)" v-ellipsis-title
    vusion-slot-name-edit="text">
    <slot>{{ text }}</slot>
</div>
</template>
 
<script>
import { MSinglexItem } from '../m-singlex.vue';
import { MMultiplexItem } from '../m-multiplex.vue';
import { ellipsisTitle } from '../../directives';
 
export default {
    name: 'm-complex-item',
    parentName: 'm-complex',
    groupName: 'm-complex-group',
    directives: { ellipsisTitle },
    mixins: [MSinglexItem, MMultiplexItem], // props: {
    //     @inherit: value: null,
    //     @inherit: selected: { type: Boolean, default: false },
    //     @inherit: disabled: { type: Boolean, default: false },
    //     @inherit: item: Object,
    // },
    // data() {
    //     return {
    //         @inherit: currentSelected: this.selected,
    //         @inherit: parentVM: undefined,
    //     };
    // },
};
</script>
 
<style module>
.root {
    /* @Private */
    display: inline-block;
    cursor: var(--cursor-pointer);
 
    /* @Public */
    padding: 4px 12px;
}
 
.root:hover {
    background: var(--background-color-light);
}
 
.root[readonly] {
    cursor: default;
    background: none;
}
 
.root[focused] {
    background: var(--background-color-light);
}
 
.root[selected] {
    background: var(--brand-primary);
    color: var(--color-white);
}
 
.root[disabled] {
    /* @Private */
    cursor: var(--cursor-not-allowed);
    background: none;
    color: var(--brand-disabled);
}

.root[selected][disabled] {
    background: var(--brand-disabled-light);
}
</style>