2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2025-01-23 09:31:51 +01:00
|
|
|
<transition name="fade">
|
|
|
|
<div v-if="show" class="modal is-active">
|
|
|
|
<div class="modal-background" @click="$emit('close')" />
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2025-02-08 14:35:25 +01:00
|
|
|
<p v-if="title" class="title is-4" v-text="title" />
|
|
|
|
<slot name="modal-content" />
|
2025-01-23 09:31:51 +01:00
|
|
|
</div>
|
2025-02-08 11:17:31 +01:00
|
|
|
<footer class="card-footer">
|
2025-02-08 14:35:25 +01:00
|
|
|
<a
|
|
|
|
v-for="action in actions"
|
|
|
|
:key="action.event"
|
|
|
|
class="card-footer-item"
|
|
|
|
:class="{ 'is-disabled': action.disabled }"
|
|
|
|
@click="$emit(action.event)"
|
|
|
|
>
|
|
|
|
<mdicon class="icon" :name="action.icon" size="16" />
|
|
|
|
<span class="is-size-7" v-text="action.label" />
|
|
|
|
</a>
|
2025-01-23 09:31:51 +01:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2025-02-08 14:35:25 +01:00
|
|
|
name: 'ModalDialogCombined',
|
2024-02-27 17:18:58 +01:00
|
|
|
props: {
|
2025-02-08 14:35:25 +01:00
|
|
|
show: Boolean,
|
|
|
|
title: { type: String, default: '' },
|
|
|
|
actions: { type: Array, required: true }
|
2024-02-27 17:18:58 +01:00
|
|
|
},
|
2025-02-04 22:00:48 +01:00
|
|
|
emits: ['close'],
|
|
|
|
watch: {
|
|
|
|
show(value) {
|
|
|
|
const { classList } = document.querySelector('html')
|
|
|
|
if (value) {
|
|
|
|
classList.add('is-clipped')
|
|
|
|
} else {
|
|
|
|
classList.remove('is-clipped')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
</script>
|
2025-01-23 09:31:51 +01:00
|
|
|
|
2025-02-04 22:00:48 +01:00
|
|
|
<style scoped>
|
|
|
|
.fade-leave-active {
|
|
|
|
transition: opacity 0.2s ease;
|
|
|
|
}
|
|
|
|
.fade-enter-active {
|
|
|
|
transition: opacity 0.5s ease;
|
|
|
|
}
|
|
|
|
.fade-enter-from,
|
|
|
|
.fade-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
.fade-enter-to,
|
|
|
|
.fade-leave-from {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
</style>
|