2021-01-17 18:57:57 +01:00
|
|
|
<template>
|
2021-01-21 23:33:16 +01:00
|
|
|
<div class="card" :class="{'has-no-shadow': !shadow}">
|
2021-01-17 18:57:57 +01:00
|
|
|
<header class="card-header" v-if="title !== ''">
|
|
|
|
<p class="card-header-title">
|
|
|
|
{{ title }}
|
|
|
|
</p>
|
2021-11-13 15:13:56 +01:00
|
|
|
<a
|
|
|
|
v-if="hasClose"
|
|
|
|
class="card-header-icon"
|
|
|
|
:aria-label="$t('misc.close')"
|
|
|
|
@click="$emit('close')"
|
|
|
|
v-tooltip="$t('misc.close')"
|
|
|
|
>
|
2021-01-17 18:57:57 +01:00
|
|
|
<span class="icon">
|
2021-01-21 23:33:16 +01:00
|
|
|
<icon :icon="closeIcon"/>
|
2021-01-17 18:57:57 +01:00
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</header>
|
2021-01-30 17:17:04 +01:00
|
|
|
<div class="card-content loader-container" :class="{'p-0': !padding, 'is-loading': loading}">
|
2021-01-24 14:00:21 +01:00
|
|
|
<div :class="{'content': hasContent}">
|
2021-01-17 18:57:57 +01:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2021-12-04 15:47:32 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
defineProps({
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
2021-01-17 18:57:57 +01:00
|
|
|
},
|
2021-12-04 15:47:32 +01:00
|
|
|
padding: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
hasClose: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
closeIcon: {
|
|
|
|
type: String,
|
|
|
|
default: 'times',
|
|
|
|
},
|
|
|
|
shadow: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
hasContent: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
defineEmits(['close'])
|
2021-01-17 18:57:57 +01:00
|
|
|
</script>
|
2021-10-18 14:18:49 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card {
|
2021-11-22 22:12:54 +01:00
|
|
|
background-color: var(--white);
|
2021-10-18 14:18:49 +02:00
|
|
|
border-radius: $radius;
|
|
|
|
margin-bottom: 1rem;
|
2021-11-22 22:12:54 +01:00
|
|
|
border: 1px solid var(--card-border-color);
|
|
|
|
box-shadow: var(--shadow-sm);
|
2021-10-18 14:18:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.card-header {
|
|
|
|
box-shadow: none;
|
2021-11-22 22:12:54 +01:00
|
|
|
border-bottom: 1px solid var(--card-border-color);
|
2021-10-18 14:18:49 +02:00
|
|
|
border-radius: $radius $radius 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: should maybe be merged somehow with modal
|
2021-10-20 14:33:36 +02:00
|
|
|
:deep(.modal-card-foot) {
|
2021-11-22 22:12:54 +01:00
|
|
|
background-color: var(--grey-50);
|
2021-10-18 14:18:49 +02:00
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
</style>
|