Dialog.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!-- Fenêtre de dialogue -->
  2. <template>
  3. <v-dialog
  4. :model-value="_show"
  5. :persistent="true"
  6. :max-width="maxWidth"
  7. :content-class="contentClass"
  8. >
  9. <v-card class="d-flex flex-row">
  10. <div :class="'dialog-type flex-column justify-center d-none d-sm-flex theme-' + theme">
  11. <h3 class="d-flex">
  12. <slot name="dialogType" />
  13. </h3>
  14. </div>
  15. <div class="dialog-container d-flex flex-column flex-grow-1">
  16. <v-card-title class="dialog-title theme-neutral">
  17. <slot name="dialogTitle" />
  18. </v-card-title>
  19. <div class="dialog-text-container">
  20. <slot name="dialogText" />
  21. </div>
  22. <v-spacer />
  23. <v-divider />
  24. <v-card-actions class="justify-center">
  25. <slot name="dialogBtn" />
  26. </v-card-actions>
  27. </div>
  28. </v-card>
  29. </v-dialog>
  30. </template>
  31. <script setup lang="ts">
  32. const props = defineProps({
  33. show: {
  34. type: [Boolean, Object],
  35. required: true
  36. },
  37. contentClass: {
  38. type: String,
  39. required: false
  40. },
  41. theme: {
  42. type: String,
  43. required: false,
  44. default: 'primary',
  45. },
  46. maxWidth: {
  47. type: [Number, String],
  48. required: false,
  49. default: 800
  50. }
  51. })
  52. // @ts-ignore -> just to avoid the error with the prop's type of v-dialog
  53. const _show = computed(() => props.show) as boolean
  54. </script>
  55. <style lang="scss" scoped>
  56. .dialog-title {
  57. padding-left: 40px;
  58. font-weight: normal;
  59. }
  60. .dialog-type {
  61. width: 60px;
  62. min-width: 60px;
  63. max-width: 60px;
  64. min-height: 120px;
  65. padding: 25px 10px;
  66. h3 {
  67. font-size: 25px;
  68. font-weight: normal;
  69. writing-mode: vertical-lr;
  70. transform: rotate(-180deg);
  71. }
  72. }
  73. .dialog-container {
  74. overflow-x: scroll;
  75. }
  76. .dialog-text-container {
  77. max-height: 70vh;
  78. overflow: auto;
  79. }
  80. .modal-level-alert {
  81. .dialog-type{
  82. background: rgb(var(--v-theme-danger, #f56954));
  83. }
  84. }
  85. .modal-level-warning {
  86. .dialog-type{
  87. background: rgb(var(--v-theme-warning, #f39c12));
  88. }
  89. }
  90. </style>