CreateButton.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!--
  2. Bouton Créer du header de l'application
  3. -->
  4. <template>
  5. <main>
  6. <v-btn
  7. v-if="asIcon"
  8. :elevation="0"
  9. class="theme-primary"
  10. :icon="true"
  11. size="small"
  12. @click="show"
  13. >
  14. <v-icon>fas fa-plus</v-icon>
  15. </v-btn>
  16. <v-btn
  17. v-else
  18. :elevation="2"
  19. height="30"
  20. class="theme-x-create-btn"
  21. @click="show"
  22. >
  23. <span>{{ $t('create') }}</span>
  24. </v-btn>
  25. <LayoutDialog :show="showing" :max-width="850" >
  26. <template #dialogType>{{ $t('creative_assistant') }}</template>
  27. <template #dialogTitle>
  28. <span v-if="type === 'home'">{{ $t('what_do_you_want_to_create') }}</span>
  29. <span v-else-if="type === 'access'">{{ $t('what_type_of_contact_do_you_want_to_create') }}</span>
  30. <span v-else-if="type === 'event'">{{ $t('what_do_you_want_to_add_to_your_planning') }}</span>
  31. <span v-else-if="type === 'message'">{{ $t('what_do_you_want_to_send') }}</span>
  32. </template>
  33. <template #dialogText>
  34. <LayoutHeaderUniversalCreationGenerateCardsSteps
  35. :step="step"
  36. @updateStep="updateStep"
  37. />
  38. </template>
  39. <template #dialogBtn>
  40. <div class="text-center">
  41. <v-btn class="theme-neutral-soft" @click="close" >
  42. {{ $t('cancel') }}
  43. </v-btn>
  44. <v-btn v-if="step > 1" class="theme-neutral-soft" @click="reset" >
  45. {{ $t('previous_step') }}
  46. </v-btn>
  47. </div>
  48. </template>
  49. </LayoutDialog>
  50. </main>
  51. </template>
  52. <script setup lang="ts">
  53. import {Ref, ref} from "@vue/reactivity";
  54. import {useDisplay} from "vuetify";
  55. const showing: Ref<Boolean> = ref(false);
  56. const step: Ref<Number> = ref(1);
  57. const type: Ref<String> = ref('home');
  58. const updateStep = ({stepChoice, typeChoice}: any) =>{
  59. step.value = stepChoice
  60. type.value = typeChoice
  61. }
  62. const reset = () => {
  63. step.value = 1
  64. type.value = 'home'
  65. }
  66. const show = () => {
  67. reset()
  68. showing.value = true
  69. }
  70. const close = () => {
  71. showing.value = false
  72. }
  73. const { mdAndDown: asIcon } = useDisplay()
  74. </script>
  75. <style scoped lang="scss">
  76. :deep(.v-btn .v-icon) {
  77. font-size: 16px !important;
  78. }
  79. :deep(.v-btn) {
  80. text-transform: none !important;
  81. font-weight: 600;
  82. }
  83. </style>