<template>
  <label :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">
      <i class="field-error-icon fas fa-exclamation-circle"></i>
      <div class="field-error-message">
        {{ error }}
      </div>
    </div>

    <div v-if="valid" class="field-valid-container">
      <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>