2024-03-26 03:14:42 +00:00
|
|
|
<template>
|
2024-06-10 01:24:48 +00:00
|
|
|
<Teleport to="#container">
|
2024-03-26 03:14:42 +00:00
|
|
|
<div
|
|
|
|
class="dialog-container"
|
|
|
|
@click="emit('close')"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="dialog"
|
|
|
|
@click.stop
|
|
|
|
>
|
|
|
|
<div class="dialog-header">
|
|
|
|
<span class="dialog-title ellipsis">{{ title }}</span>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
icon="cross2"
|
|
|
|
class="dialog-close"
|
|
|
|
@click="emit('close')"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<slot />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Teleport>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { onMounted } from 'vue';
|
|
|
|
|
|
|
|
defineProps({
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const emit = defineEmits(['open', 'close']);
|
|
|
|
|
|
|
|
onMounted(() => emit('open'));
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.dialog-body {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
border-radius: 0 0 .25rem .25rem;
|
|
|
|
background: var(--background);
|
|
|
|
}
|
2024-04-03 00:13:41 +00:00
|
|
|
|
|
|
|
.dialog-heading {
|
|
|
|
color: var(--primary);
|
|
|
|
margin: 0 0 .5rem 0;
|
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog-description {
|
|
|
|
margin: 0 0 .5rem 0;
|
2024-06-10 01:24:48 +00:00
|
|
|
color: var(--glass-strong-10);
|
2024-04-03 00:13:41 +00:00
|
|
|
font-size: .9rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
2024-05-19 03:07:35 +00:00
|
|
|
|
|
|
|
.dialog-error {
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
color: var(--text-light);
|
|
|
|
background: var(--error);
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2024-03-26 03:14:42 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.dialog-container {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 900;
|
2024-05-19 03:07:35 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
2024-03-26 03:14:42 +00:00
|
|
|
background: var(--shadow-strong-10);
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog {
|
2024-05-19 03:07:35 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-03-26 03:14:42 +00:00
|
|
|
border-radius: .25rem;
|
|
|
|
box-shadow: 0 0 3px var(--shadow);
|
|
|
|
overflow: hidden;
|
|
|
|
max-width: 100%;
|
2024-05-19 03:07:35 +00:00
|
|
|
max-height: 100%;
|
2024-03-26 03:14:42 +00:00
|
|
|
margin: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog-header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: stretch;
|
|
|
|
background: var(--primary);
|
|
|
|
border-radius: .25rem .25rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog-title {
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
color: var(--text-light);
|
|
|
|
font-size: 1.1rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog-close {
|
|
|
|
height: auto;
|
|
|
|
padding: 0 .75rem;
|
|
|
|
fill: var(--highlight);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
fill: var(--text-light);
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|