summaryrefslogtreecommitdiff
path: root/src/components/_sila/Global/Collapse.vue
blob: c8665c28fb3b26642b7551ed72dcab3aebc428b4 (plain)
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
<template>
  <div class="page-collapse-decorator">
    <b-button
      v-b-toggle="id"
      variant="collapse"
      class="d-flex flex-nowrap justify-content-start"
    >
      <img :src="require(imgPath)" />
      {{ title }}
      <component :is="iconChevronUp" class="icon-expand" />
    </b-button>
    <b-collapse :id="id" class="nav-item__nav">
      <slot></slot>
    </b-collapse>
  </div>
</template>
<script>
import iconChevronUp from '@carbon/icons-vue/es/chevron--up/20';

export default {
  name: 'Collapse',
  props: {
    id: {
      type: String,
      default: null,
    },
    imgPath: {
      type: String,
      default: '@/assets/images/_sila/collapsed/temperature.svg',
    },
    title: {
      type: String,
      default: 'collapsed title',
    },
  },
  data() {
    return {
      iconChevronUp: iconChevronUp,
    };
  },
};
</script>
<style lang="scss" scoped>
//nav items style
.nav-item,
.nav-link {
  padding: 0;
}
.nav-item {
  list-style-type: none;
}

a {
  color: $text-primary !important;
  &:hover {
    color: $text-primary !important;
  }
}
</style>