2019-09-06 10:41:18 +00:00
|
|
|
<template>
|
2019-11-16 08:44:53 +00:00
|
|
|
<transition name="modal" appear>
|
2019-09-13 05:02:49 +00:00
|
|
|
<div class="modal-backdrop">
|
|
|
|
|
<div class="modal-wrapper">
|
|
|
|
|
<div class="modal-container">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<slot name="header"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<slot name="body"></slot>
|
2020-03-05 03:03:06 +00:00
|
|
|
<!-- <div class="fade top"></div>
|
|
|
|
|
<div class="fade bottom"></div> -->
|
2019-09-13 05:02:49 +00:00
|
|
|
</div>
|
2020-12-16 00:35:58 +00:00
|
|
|
<div v-if="hasFooterSlot" class="modal-footer">
|
2019-09-13 05:02:49 +00:00
|
|
|
<slot name="footer"></slot>
|
2019-09-06 10:41:18 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-09-13 05:02:49 +00:00
|
|
|
</div>
|
|
|
|
|
</transition>
|
2019-09-06 10:41:18 +00:00
|
|
|
</template>
|
2020-12-14 05:05:14 +00:00
|
|
|
|
2021-05-18 09:27:29 +00:00
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
computed: {
|
|
|
|
|
hasFooterSlot() {
|
|
|
|
|
return !!this.$slots.footer
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2019-12-06 01:41:38 +00:00
|
|
|
<style scoped lang="scss">
|
2019-11-02 05:32:21 +00:00
|
|
|
.modal-backdrop {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply fixed;
|
|
|
|
|
@apply inset-0;
|
|
|
|
|
@apply z-50;
|
|
|
|
|
@apply w-full;
|
|
|
|
|
@apply h-full;
|
|
|
|
|
@apply flex;
|
|
|
|
|
@apply items-center;
|
|
|
|
|
@apply justify-center;
|
|
|
|
|
@apply transition;
|
|
|
|
|
@apply ease-in-out;
|
2020-12-16 00:35:58 +00:00
|
|
|
@apply duration-150;
|
2020-10-16 01:40:07 +00:00
|
|
|
|
2021-06-11 00:01:29 +00:00
|
|
|
background-color: rgba(0, 0, 0, 0.32);
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-09-06 10:41:18 +00:00
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
.modal-wrapper {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply flex;
|
|
|
|
|
@apply items-center;
|
|
|
|
|
@apply justify-center;
|
|
|
|
|
@apply flex-1;
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-09-06 10:41:18 +00:00
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
.modal-container {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply relative;
|
|
|
|
|
@apply flex;
|
|
|
|
|
@apply flex-1;
|
|
|
|
|
@apply flex-col;
|
|
|
|
|
@apply m-2;
|
|
|
|
|
@apply transition;
|
|
|
|
|
@apply ease-in-out;
|
2020-12-16 00:35:58 +00:00
|
|
|
@apply duration-150;
|
2021-06-12 16:46:17 +00:00
|
|
|
@apply bg-primary;
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply rounded-lg;
|
|
|
|
|
@apply shadow-2xl;
|
2021-06-11 00:01:29 +00:00
|
|
|
@apply border;
|
2021-06-12 16:46:17 +00:00
|
|
|
@apply border-tooltip;
|
2020-10-16 01:40:07 +00:00
|
|
|
|
2020-03-03 01:32:27 +00:00
|
|
|
max-height: calc(100vh - 128px);
|
2020-12-11 16:54:34 +00:00
|
|
|
max-width: 640px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.modal-header {
|
|
|
|
|
@apply pl-2;
|
2020-01-09 00:31:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.modal-body {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply overflow-auto;
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-09-06 10:41:18 +00:00
|
|
|
|
2020-12-11 16:54:34 +00:00
|
|
|
.modal-footer {
|
|
|
|
|
@apply p-2;
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
/*
|
2019-10-25 08:14:34 +00:00
|
|
|
* The following styles are auto-applied to elements with
|
|
|
|
|
* transition="modal" when their visibility is toggled
|
|
|
|
|
* by Vue.js.
|
|
|
|
|
*
|
|
|
|
|
* You can easily play with the modal transition by editing
|
|
|
|
|
* these styles.
|
|
|
|
|
*/
|
2019-09-06 10:41:18 +00:00
|
|
|
|
2019-11-16 08:44:53 +00:00
|
|
|
.modal-enter,
|
|
|
|
|
.modal-leave-active {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply opacity-0;
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-09-06 10:41:18 +00:00
|
|
|
|
2019-11-16 08:44:53 +00:00
|
|
|
.modal-enter .modal-container,
|
|
|
|
|
.modal-leave-active .modal-container {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply transform;
|
2020-12-16 00:35:58 +00:00
|
|
|
@apply scale-90;
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply transition;
|
|
|
|
|
@apply ease-in-out;
|
2020-12-16 00:35:58 +00:00
|
|
|
@apply duration-150;
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2020-03-05 01:18:10 +00:00
|
|
|
|
|
|
|
|
.fade {
|
2020-09-22 17:06:37 +00:00
|
|
|
@apply absolute;
|
|
|
|
|
@apply block;
|
|
|
|
|
@apply transition;
|
|
|
|
|
@apply ease-in-out;
|
2020-12-16 00:35:58 +00:00
|
|
|
@apply duration-150;
|
2020-03-05 01:18:10 +00:00
|
|
|
|
2020-10-16 01:40:07 +00:00
|
|
|
left: 16px;
|
|
|
|
|
right: 20px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
2020-03-05 01:18:10 +00:00
|
|
|
&.top {
|
|
|
|
|
top: 68px;
|
2021-06-12 16:46:17 +00:00
|
|
|
background: linear-gradient(to bottom, var(--primary-color), transparent);
|
2020-03-05 01:18:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.bottom {
|
|
|
|
|
bottom: 16px;
|
2021-06-12 16:46:17 +00:00
|
|
|
background: linear-gradient(to top, var(--primary-color), transparent);
|
2020-03-05 01:18:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
2019-09-09 05:57:00 +00:00
|
|
|
</style>
|