dropdown_button.vue 1.01 KB
Newer Older
1
<script>
2
import { __ } from '~/locale';
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import LoadingIcon from '~/vue_shared/components/loading_icon.vue';

export default {
  components: {
    LoadingIcon,
  },
  props: {
    isDisabled: {
      type: Boolean,
      required: false,
      default: false,
    },
    isLoading: {
      type: Boolean,
      required: false,
      default: false,
    },
    toggleText: {
      type: String,
22 23
      required: false,
      default: __('Select'),
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    },
  },
};
</script>

<template>
  <button
    class="dropdown-menu-toggle dropdown-menu-full-width"
    type="button"
    data-toggle="dropdown"
    aria-expanded="true"
    :disabled="isDisabled || isLoading"
  >
    <loading-icon
      v-show="isLoading"
      :inline="true"
    />
    <span class="dropdown-toggle-text">
      {{ toggleText }}
    </span>
44 45
    <span
      class="dropdown-toggle-icon"
46
      v-show="!isLoading"
47 48 49 50 51 52 53
    >
      <i
        class="fa fa-chevron-down"
        aria-hidden="true"
        data-hidden="true"
      ></i>
  </span>
54 55
  </button>
</template>