-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
116 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,139 @@ | ||
|
||
<template> | ||
<dialog class="alert-dialog swal2-show"> | ||
<dialog class="alert-dialog show"> | ||
<form method="dialog" @submit.prevent> | ||
<div class="icon"> | ||
<img src="/assets/icon.png" alt="RAG Logo" /> | ||
</div> | ||
<slot name="header"></slot> | ||
<slot name="body"></slot> | ||
<div class="buttons"> | ||
<slot name="footer"></slot> | ||
</div> | ||
<slot name="footer"></slot> | ||
</form> | ||
</dialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineExpose({ | ||
show(id: string) { | ||
const dialog = document.querySelector<HTMLDialogElement>(id) | ||
dialog.classList.remove('hide') | ||
dialog.classList.add('show') | ||
dialog.showModal() | ||
}, | ||
close(id: string) { | ||
const dialog = document.querySelector<HTMLDialogElement>(id) | ||
dialog.addEventListener('animationend', () => { | ||
dialog.close() | ||
}, { once: true }) | ||
dialog.classList.remove('show') | ||
dialog.classList.add('hide') | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
@import '../../css/dialog.css'; | ||
@import '../../css/form.css'; | ||
</style> | ||
|
||
<style> | ||
<style scoped> | ||
.alert-dialog { | ||
width: 260px !important; | ||
&.show { | ||
animation: show 0.3s; | ||
} | ||
&.hide { | ||
animation: hide 0.15s forwards; | ||
} | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 16px; | ||
padding-top: 26px | ||
} | ||
padding-top: 26px; | ||
color: var(--text-color); | ||
.icon, .icon img { | ||
width: 60px; | ||
height: 60px; | ||
margin-bottom: 1.5rem; | ||
} | ||
.icon, .icon img { | ||
width: 60px; | ||
height: 60px; | ||
margin-bottom: 1.5rem; | ||
} | ||
form .group { | ||
flex-direction: column !important; | ||
align-items: flex-start !important; | ||
gap: 0.33rem !important; | ||
width: 100%; | ||
&:deep() .title { | ||
font-size: 10pt; | ||
line-height: 150%; | ||
font-weight: bold; | ||
margin-top: 12px; | ||
} | ||
&:deep() .text { | ||
font-size: 8.5pt; | ||
margin-top: 12px; | ||
} | ||
label { | ||
min-width: auto !important; | ||
margin-left: 2px; | ||
color: var(--text-color); | ||
&:deep() .group { | ||
flex-direction: column !important; | ||
align-items: flex-start !important; | ||
gap: 0.33rem !important; | ||
width: 100%; | ||
&::after { | ||
content: '' !important; | ||
label { | ||
min-width: auto !important; | ||
margin-left: 2px; | ||
&::after { | ||
content: '' !important; | ||
} | ||
} | ||
input, select { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
input, select { | ||
width: 100%; | ||
} | ||
&:deep().buttons { | ||
margin-top: 1rem; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
width: 100%; | ||
gap: 8px; | ||
.buttons { | ||
margin-top: 1rem; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
width: 100%; | ||
gap: 8px; | ||
button { | ||
box-sizing: border-box; | ||
width: auto !important; | ||
margin: 0px !important; | ||
padding: 4px 8px !important; | ||
border-radius: .3rem !important; | ||
box-shadow: 0px 2px 1.5px -2px rgba(0, 0, 0, .3) !important; | ||
font-size: 10pt !important; | ||
font-weight: normal !important; | ||
flex: 1; | ||
button { | ||
box-sizing: border-box; | ||
width: auto !important; | ||
margin: 0px !important; | ||
padding: 4px 8px !important; | ||
border-radius: .3rem !important; | ||
box-shadow: 0px 2px 1.5px -2px rgba(0, 0, 0, .3) !important; | ||
font-size: 10pt !important; | ||
font-weight: normal !important; | ||
flex: 1; | ||
} | ||
} | ||
} | ||
} | ||
@keyframes show { | ||
0% { transform: scale(0.7); } | ||
45% { transform: scale(1.05); } | ||
80% { transform: scale(0.95); } | ||
100% { transform: scale(1); } | ||
} | ||
@keyframes hide { | ||
0% { transform: scale(1); opacity: 1; } | ||
100% { transform: scale(0.5); opacity: 0; } | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters