2023-09-28 11:27:45 +02:00
|
|
|
<script setup>
|
2023-11-02 15:01:44 +01:00
|
|
|
import { UseColorMode } from '@vueuse/components'
|
|
|
|
|
2023-09-28 11:27:45 +02:00
|
|
|
const { notify } = useNotification()
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
modelValue: Boolean,
|
|
|
|
closable: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2023-10-19 11:53:13 +02:00
|
|
|
const emit = defineEmits(['update:modelValue'])
|
2023-09-28 11:27:45 +02:00
|
|
|
|
|
|
|
const isActive = computed({
|
|
|
|
get() {
|
|
|
|
return props.modelValue
|
|
|
|
},
|
|
|
|
set(value) {
|
2023-10-19 11:53:13 +02:00
|
|
|
emit('update:modelValue', value)
|
2023-09-28 11:27:45 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
function closeModal(event) {
|
|
|
|
if (event) {
|
|
|
|
notify({ clean: true })
|
|
|
|
isActive.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="modal modal-otp" v-bind:class="{ 'is-active': isActive }">
|
|
|
|
<div class="modal-background" @click.stop="closeModal"></div>
|
|
|
|
<div class="modal-content">
|
|
|
|
<section class="section">
|
|
|
|
<div class="columns is-centered">
|
|
|
|
<div class="column is-three-quarters">
|
|
|
|
<div class="modal-slot box has-text-centered is-shadowless">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
<div v-if="props.closable" class="fullscreen-footer">
|
|
|
|
<!-- Close button -->
|
2023-11-02 15:01:44 +01:00
|
|
|
<UseColorMode v-slot="{ mode }">
|
|
|
|
<button id="btnClose" class="button is-rounded" :class="{'is-dark' : mode == 'dark'}" @click.stop="closeModal">
|
|
|
|
{{ $t('commons.close') }}
|
|
|
|
</button>
|
|
|
|
</UseColorMode>
|
2023-09-28 11:27:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|