mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
* Remove unused nested folders from components * Remove nested folders * Standardize composables output * Fix import inconsistencies * Same trick for directives * Same for routes * Replace reliance root grouped export in favor of explicit imports * Replace reliance on implicit imports * Remove nested folder structure * Consistent use of non-default exports in utils * Remove nested folder structure from private components * Fix test mock * Remove extraneous component registration for valuenull * Fix stores provider * Fix logo sprite
89 lines
1.3 KiB
Vue
89 lines
1.3 KiB
Vue
<template>
|
|
<div class="v-overlay" :class="{ active, absolute, 'has-click': clickable }" @click="onClick">
|
|
<div class="overlay" />
|
|
<div v-if="active" class="content"><slot /></div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
|
|
export default defineComponent({
|
|
props: {
|
|
active: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
absolute: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
clickable: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
emits: ['click'],
|
|
setup(props, { emit }) {
|
|
return { onClick };
|
|
|
|
function onClick(event: MouseEvent) {
|
|
emit('click', event);
|
|
}
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
body {
|
|
--v-overlay-color: var(--overlay-color);
|
|
--v-overlay-z-index: 600;
|
|
}
|
|
</style>
|
|
|
|
<style lang="scss" scoped>
|
|
.v-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: var(--v-overlay-z-index);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
|
|
&.has-click {
|
|
cursor: pointer;
|
|
}
|
|
|
|
&.absolute {
|
|
position: absolute;
|
|
}
|
|
|
|
.overlay {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: var(--v-overlay-color);
|
|
opacity: 0;
|
|
transition: opacity var(--slow) var(--transition);
|
|
}
|
|
|
|
&.active {
|
|
pointer-events: auto;
|
|
|
|
.overlay {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
.content {
|
|
position: relative;
|
|
}
|
|
}
|
|
</style>
|