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>
|
|
|
|
<a @click="$emit('close')" class="card-header-icon" v-if="hasClose">
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'card',
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
padding: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
hasClose: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-21 23:33:16 +01:00
|
|
|
closeIcon: {
|
|
|
|
type: String,
|
|
|
|
default: 'angle-right',
|
|
|
|
},
|
|
|
|
shadow: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-01-24 14:00:21 +01:00
|
|
|
hasContent: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-17 18:57:57 +01:00
|
|
|
},
|
2021-08-23 21:18:12 +02:00
|
|
|
emits: ['close'],
|
2021-01-17 18:57:57 +01:00
|
|
|
}
|
|
|
|
</script>
|
2021-10-18 14:18:49 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card {
|
|
|
|
background-color: $white;
|
|
|
|
border-radius: $radius;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
border: 1px solid $grey-200;
|
|
|
|
box-shadow: $shadow-sm;
|
|
|
|
}
|
|
|
|
|
|
|
|
.card-header {
|
|
|
|
box-shadow: none;
|
|
|
|
border-bottom: 1px solid $grey-200;
|
|
|
|
border-radius: $radius $radius 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: should maybe be merged somehow with modal
|
|
|
|
::v-deep.modal-card-foot {
|
|
|
|
background-color: $grey-50;
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
</style>
|