knowyt/client/src/components/ModalDialog.vue

85 lines
1.6 KiB
Vue
Raw Normal View History

2022-09-04 18:06:26 +00:00
<template>
<div class="modal-dialog__container">
<div class="modal-dialog__box">
<div class="modal-dialog__header">
<div class="modal-dialog__title">{{ title }}</div>
2022-09-09 10:50:05 +00:00
<Button v-if="!noCloseButton" :border="false" @click="emit('close')">x</Button>
2022-09-04 18:06:26 +00:00
</div>
<div class="modal-dialog__body">
<slot />
</div>
<div class="modal-dialog__footer">
<slot name="footer" />
</div>
</div>
<div class="modal-dialog__backdrop" />
</div>
</template>
<script setup lang="ts">
defineProps<{
title?: string
2022-09-09 10:50:05 +00:00
noCloseButton?: boolean
2022-09-04 18:06:26 +00:00
}>()
const emit = defineEmits(['close'])
</script>
<style lang="scss">
@import '~/assets/css/components';
.modal-dialog {
&__container {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
&__box {
display: flex;
flex-direction: column;
min-width: 400px;
min-height: 280px;
margin: auto;
background-color: $modal-dialog-background-color;
border: $modal-dialog-border;
border-radius: 8px;
color: $modal-dialog-text-color;
z-index: 12;
}
&__header {
display: flex;
}
&__title {
flex-grow: 1;
2022-09-09 10:50:05 +00:00
margin: 36px 36px 8px 36px;
2022-09-04 18:06:26 +00:00
font-family: $font-primary;
font-size: 24px;
}
&__body {
flex-grow: 1;
2022-09-09 10:50:05 +00:00
margin: 36px;
2022-09-04 18:06:26 +00:00
font-family: $font-secondary;
}
&__footer {
display: flex;
2022-09-06 11:37:14 +00:00
// justify-content: end;
2022-09-09 10:50:05 +00:00
margin: 24px 36px;
2022-09-04 18:06:26 +00:00
}
&__backdrop {
position: absolute;
width: 100%;
height: 100%;
background-color: $modal-dialog-backdrop-background-color;
z-index: 10;
}
}
</style>