<template>
    <div>
        <autocomplete-selector 
            :value="value"
            :errors="errors"
            label="Rol"
            :dataprovider="dataprovider"
            :noLoadData="true"

            @focus="$emit('focus')"
            @blur="$emit('blur')"
            
            @input="$emit('input', $event)"
        />
    </div>
</template>

<script>

    import DataProvider from 'APPS/Dataproviders/Roles/Roles';

    export default {
        props: {
            value: {required: true},
            errors: {default: null},
            type: {required: true},
        },

        data: () => ({
            dataprovider: null,
        }),

        created() {
            this.dataprovider = new DataProvider(null);
            this.dataprovider.GetByType(this.type)
        },

        components: {
            AutocompleteSelector: require('./../AutocompleteSelector').default,
        },

        name: 'RoleAutocompleteSelector',
    }
</script>