2020-10-14 00:10:52 +00:00
|
|
|
<template lang="html">
|
2021-01-06 23:43:43 +00:00
|
|
|
<header :class="{ 'has-action': hasSlot}">
|
2020-10-14 00:10:52 +00:00
|
|
|
<div>
|
2020-11-22 03:31:18 +00:00
|
|
|
<h5 class="mb-0 text-wrap">{{ title }}</h5>
|
2020-11-07 05:44:34 +00:00
|
|
|
<small class="d-block text-muted">{{ subtitle }}</small>
|
2020-10-14 00:10:52 +00:00
|
|
|
</div>
|
|
|
|
|
2021-01-06 23:43:43 +00:00
|
|
|
<div class="actions" v-if="hasSlot">
|
2020-10-23 16:20:35 +00:00
|
|
|
<slot />
|
|
|
|
</div>
|
2021-01-06 23:43:43 +00:00
|
|
|
|
|
|
|
<b-button
|
|
|
|
:variant="nightMode ? 'dark' : 'light'"
|
|
|
|
class="align-self-baseline"
|
|
|
|
@click="$emit('close')"
|
|
|
|
>
|
|
|
|
<i class="fas fa-times fa-fw" aria-hidden />
|
|
|
|
</b-button>
|
2020-10-14 00:10:52 +00:00
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-10-14 21:48:27 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
2020-10-14 00:10:52 +00:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
title: String,
|
|
|
|
subtitle: String,
|
|
|
|
},
|
2020-10-14 21:48:27 +00:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
...mapGetters(['nightMode']),
|
2021-01-06 23:43:43 +00:00
|
|
|
|
|
|
|
hasSlot() {
|
|
|
|
return Object.keys(this.$slots).length > 0;
|
|
|
|
},
|
2020-10-14 21:48:27 +00:00
|
|
|
},
|
2020-10-14 00:10:52 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
|
|
header {
|
|
|
|
display: grid;
|
|
|
|
width: 100%;
|
|
|
|
align-items: center;
|
2021-01-06 23:43:43 +00:00
|
|
|
grid-template-columns: auto 46px;
|
|
|
|
grid-gap: .5rem;
|
|
|
|
|
|
|
|
&.has-action {
|
|
|
|
grid-template-columns: auto auto 46px;
|
|
|
|
}
|
2020-10-14 00:10:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
h5 {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actions {
|
|
|
|
margin-left: auto;
|
2020-10-31 17:43:55 +00:00
|
|
|
align-self: flex-start;
|
2020-10-14 00:10:52 +00:00
|
|
|
}
|
|
|
|
</style>
|