@saooti/octopus-sdk 36.0.49 → 36.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "36.0.49",
3
+ "version": "36.0.50",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -1,65 +1,60 @@
1
1
  <template>
2
- <div
3
- class="octopus-accordion my-2"
4
- >
5
- <button
6
- :id="'accordion-'+idComposer"
7
- class="btn-transparent bg-white w-100 p-2 text-start d-flex align-items-center"
8
- :class="isOpen?'really-light-primary-bg':''"
9
- @click="isOpen=!isOpen"
10
- >
11
- <span
12
- v-if="icon"
13
- class="img-accordion text-primary"
14
- :class="icon"
15
- />
16
- <img
17
- v-if="imageUrl"
18
- width="30"
19
- height="30"
20
- class="img-accordion"
21
- :src="imageUrl"
22
- :alt="title"
2
+ <div class="my-2" :class="displayAccordion ? 'octopus-accordion' : ''">
3
+ <template v-if="displayAccordion">
4
+ <button
5
+ :id="'accordion-' + idComposer"
6
+ class="btn-transparent bg-white w-100 p-2 text-start d-flex align-items-center"
7
+ :class="isOpen ? 'really-light-primary-bg' : ''"
8
+ @click="isOpen = !isOpen"
23
9
  >
24
- <span class="flex-grow-1">{{ title }}</span>
25
- <span :class="isOpen?'saooti-up': 'saooti-down'" />
26
- </button>
27
- <div
28
- v-show="isOpen"
29
- class="body p-2"
30
- >
31
- <slot />
32
- </div>
10
+ <span v-if="icon" class="img-accordion text-primary" :class="icon" />
11
+ <img
12
+ v-if="imageUrl"
13
+ width="30"
14
+ height="30"
15
+ class="img-accordion"
16
+ :src="imageUrl"
17
+ :alt="title"
18
+ />
19
+ <span class="flex-grow-1">{{ title }}</span>
20
+ <span :class="isOpen ? 'saooti-up' : 'saooti-down'" />
21
+ </button>
22
+ <div v-show="isOpen" class="body p-2">
23
+ <slot />
24
+ </div>
25
+ </template>
26
+ <slot v-else />
33
27
  </div>
34
28
  </template>
35
29
 
36
30
  <script lang="ts">
37
- import { defineComponent } from 'vue';
31
+ import { defineComponent } from "vue";
38
32
  export default defineComponent({
39
- name: "Accordion",
40
- props: {
41
- title: { default: '', type: String },
42
- idComposer: { default: '', type: String },
43
- icon:{default: undefined, type: String },
44
- imageUrl:{default: undefined, type: String },
33
+ name: "ClassicAccordion",
34
+ props: {
35
+ title: { default: "", type: String },
36
+ idComposer: { default: "", type: String },
37
+ icon: { default: undefined, type: String },
38
+ imageUrl: { default: undefined, type: String },
39
+ displayAccordion: { default: true, type: Boolean },
45
40
  },
46
- emits:['open'],
47
- data () {
41
+ emits: ["open"],
42
+ data() {
48
43
  return {
49
- isOpen: false as boolean,
50
- }
44
+ isOpen: false as boolean,
45
+ };
46
+ },
47
+ watch: {
48
+ isOpen() {
49
+ this.$emit("open");
50
+ },
51
51
  },
52
- watch:{
53
- isOpen(){
54
- this.$emit('open');
55
- }
56
- }
57
52
  });
58
53
  </script>
59
54
  <style lang="scss">
60
- .octopus-accordion{
61
- border: 1px solid #ccc;
62
- >button{
55
+ .octopus-accordion {
56
+ border: 1px solid #ccc;
57
+ > button {
63
58
  height: 50px;
64
59
  }
65
60
  .img-accordion {
@@ -71,8 +66,8 @@ export default defineComponent({
71
66
  justify-content: center;
72
67
  align-items: center;
73
68
  }
74
- .body{
69
+ .body {
75
70
  border-top: 1px solid #ccc;
76
71
  }
77
72
  }
78
- </style>
73
+ </style>