All files / src/components/u-table-view.vue filters.vue

94.44% Statements 17/18
50% Branches 3/6
100% Functions 3/3
94.11% Lines 16/17

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 75 76 77 78 79 80 81 82 83 84      7x     7x                                                                                                                                               7x 7x 33x 33x    
<template>
    <div>
        <slot></slot>
    </div>
</template>
 
<script>
import { MComplex } from '../m-complex.vue';
 
export default {
    name: 'u-table-view-filters',
    childName: 'u-table-view-filter',
    extends: MComplex,
    props: {
        // @inherit: value: { type: String, default: '' },
        // @inherit: field: { type: String, default: 'text' },
        // @inherit: data: Array,
        // @inherit: cancelable: { type: Boolean, default: false },
        // @inherit: multiple: { type: Boolean, default: false },
        // @inherit: keepOrder: { type: Boolean, default: false },
        // : { type: Boolean, default: false },
    },
    data() {
        return {
            columnVM: undefined,
        };
    },
    created() {
        this.$on('select', () => {
            if (!this.multiple)
                this.close();
        });
    },
    methods: {
        open() {
            this.$refs.popper && this.$refs.popper.open();
        },
        close() {
            this.$refs.popper && this.$refs.popper.close();
        },
        toggle(opened) {
            this.$refs.popper && this.$refs.popper.toggle(opened);
        },
    },
 
    // created() {
    //     !this.columnVM && this.$contact('u-table-view-column', (columnVM) => {
    //         this.columnVM = columnVM;
    //         columnVM.filterVM = this;
    //     });
    // },
    // destroyed() {
    //     !this.columnVM && this.$contact('u-table-view-column', (columnVM) => {
    //         columnVM.filterVM = undefined;
    //         this.columnVM = undefined;
    //     });
    // },
};
</script>
 
<style module>
.root {
    position: absolute;
    line-height: var(--table-view-filter-line-height);
    /* max-height: var(--table-view-filter-max-height); */
    /* overflow: auto; */
    background: var(--table-view-filter-background);
    border: 1px solid var(--border-color-base);
    z-index: var(--z-index-popper);
    max-width: 300px;
}
.wrap {
    display: inline-block;
    min-width: 100%;
    max-height: var(--table-view-filter-max-height);
}
.footer {
    padding: 0 12px;
    height: 36px;
    line-height: 36px;
    border-top: 1px solid var(--table-view-filter-border-color);
}
</style>