<template>
	<div class="form-group" :class="{'has-error': form.errors.has(input_name)}">
        <div>
            <label v-if="label" for="name">{{ label }}</label>
        </div>
        <div class="col">
            <div class="row">
                <div :class="full == true ? 'col-12' : 'col-3'" class="p-0" v-if="list.data" v-for="(item, $index) in list.data" :key="$index">
                    <div class="float-left mr-3">{{ item.value }}</div>
                    <div class="float-right">
                        <v-switch
                            :name="input_name"
                            v-model="form[input_name]"
                            color="primary"
                            :value="item.key"
                            hide-details
                            @keydown="form.errors.clear(input_name)"
                        ></v-switch>
                    </div>
                </div>
            </div>
        </div>
        <div class="text-danger text-left" v-if="form.errors.has(input_name)" v-text="form.errors.get(input_name)"></div>
    </div>
</template>

<script type="text/javascript">
	export default {
		props: ['input_name', 'form', 'list', 'label', 'full']
	}
</script>