2018-03-30 17:08:09 -05:00
|
|
|
<template>
|
2024-09-28 20:58:25 -05:00
|
|
|
<Teleport to="body">
|
|
|
|
<div :class="['popup', 'modal', { 'is-wide': wide, 'is-active': open && error === null }]">
|
2018-03-30 17:08:09 -05:00
|
|
|
<div class="modal-background" @click="close"></div>
|
|
|
|
<div class="modal-card">
|
|
|
|
<header class="modal-card-head">
|
|
|
|
<slot name="title">
|
|
|
|
<p class="modal-card-title">{{ title }}</p>
|
2018-09-06 18:16:13 -05:00
|
|
|
<app-icon class="close-button" icon="x" aria-label="close" @click="close"></app-icon>
|
2018-03-30 17:08:09 -05:00
|
|
|
</slot>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<section class="modal-card-body">
|
|
|
|
<slot></slot>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-09-28 20:58:25 -05:00
|
|
|
</Teleport>
|
2018-03-30 17:08:09 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2024-09-28 20:58:25 -05:00
|
|
|
import { mapState } from "pinia";
|
|
|
|
import { useAppConfigStore } from "../stores/appConfig";
|
2018-03-30 17:08:09 -05:00
|
|
|
|
|
|
|
export default {
|
2024-09-28 20:58:25 -05:00
|
|
|
emits: ["dismiss"],
|
|
|
|
|
2018-03-30 17:08:09 -05:00
|
|
|
props: {
|
|
|
|
open: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2018-05-01 10:55:57 -05:00
|
|
|
title: String,
|
|
|
|
wide: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
2018-03-30 17:08:09 -05:00
|
|
|
},
|
|
|
|
|
2018-04-01 12:17:54 -05:00
|
|
|
computed: {
|
2024-09-28 20:58:25 -05:00
|
|
|
...mapState(useAppConfigStore, [
|
2018-04-01 12:17:54 -05:00
|
|
|
'error'
|
|
|
|
])
|
|
|
|
},
|
|
|
|
|
2018-03-30 17:08:09 -05:00
|
|
|
methods: {
|
|
|
|
close() {
|
|
|
|
this.$emit("dismiss");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
components: {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
2018-09-06 18:16:13 -05:00
|
|
|
.close-button {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2018-03-30 17:08:09 -05:00
|
|
|
|
|
|
|
</style>
|