<template>
  <label id="BaseSelect" :class="['field', `field-${size}`, classObject]">
    <span v-if="label" class="field-label">{{ label }}</span>

    <span v-if="description" class="field-description" v-html="description"></span>

    <div v-if="error" class="field-error-container" style="right: 10px">
      <i class="field-error-icon fas fa-exclamation-circle"></i>
      <div class="field-error-message" style="right: 0">
        {{ error }}
      </div>
    </div>

    <div v-if="valid" class="field-valid-container" style="right: 10px">
      <i class="field-valid-icon fas fa-check-circle"></i>
    </div>

    <select
      class="field-entry"
      :disabled="disabled"
      v-bind="$attrs"
      @change="onChange"
      @focusout="onFocusout"
      ref="select"
    >
      <slot></slot>
    </select>
  </label>
</template>

<style src="../../identity.css"></style>
<style scoped src="../BaseInput/styles.css" /></style>

<script src="./scripts.js"></script>