All files / src/components PageLayout.vue

100% Statements 7/7
100% Branches 4/4
100% Functions 1/1
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76  8x 2x 2x   2x               8x                       8x 8x                                                                                                  
<template>
  <FlowsLayout>
    <div class="page-content">
      <div class="row mb-2 page-header">
        <div :class="actionSlot ? 'col-auto' : 'col-12'">
          <h1 class="display-6 page-title">{{ title }}</h1>
        </div>
        <div v-if="actionSlot" class="col text-end">
          <slot name="action" />
        </div>
      </div>
 
      <slot />
    </div>
  </FlowsLayout>
</template>
 
<script setup lang="ts">
import FlowsLayout from './FlowsLayout.vue'
import { useSlots } from 'vue'
 
defineProps<{
  title: string
}>()
 
const slots = useSlots()
const actionSlot = !!slots.action
</script>
 
<style scoped>
.page-content {
  width: 100%;
  max-width: 100%;
  padding: 1rem 0 0 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}
 
.page-header {
  padding: 0 0.5rem;
}
 
.page-title {
  color: #689909;
}
 
@media (max-width: 767px) {
  .page-header {
    padding: 0 0.5rem;
  }
 
  .page-content > .row:first-child {
    flex-shrink: 0;
  }
 
  .page-header .text-end {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }
 
  .page-header .text-end > .btn,
  .page-header .text-end > a.btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
 
  .display-6 {
    font-size: 1.5rem;
  }
}
</style>