adata-ui 2.0.27 → 2.0.29

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.
@@ -1,119 +0,0 @@
1
- <script setup lang="ts">
2
- import {useAdaptive} from "#adata-ui/composables/useAdaptive";
3
-
4
- interface Item {
5
- title: string
6
- link: string
7
- }
8
-
9
- interface Props {
10
- label: string
11
- link: string
12
- content: Item[]
13
- }
14
-
15
- defineProps<Props>()
16
-
17
- const { t } = useI18n()
18
-
19
- const device = useAdaptive()
20
- const open = ref(false)
21
- function toFinalValues(el: HTMLDivElement) {
22
- el.style.height = el.scrollHeight + 'px'
23
- el.style.opacity = '1'
24
- }
25
-
26
- function onAfterEnter(el: HTMLDivElement) {
27
- el.style.height = ''
28
- }
29
-
30
- const filterCheck = computed(()=>{
31
- if (open.value){
32
- return open.value
33
- } else {
34
- return open.value = !device.value.isMobile
35
- }
36
- })
37
- </script>
38
-
39
- <template>
40
- <div class="flex flex-col ">
41
- <div
42
- class="flex gap-2 justify-between "
43
- >
44
- <nuxt-link-locale class="text-sm" :to="link">
45
- {{ label }}
46
- </nuxt-link-locale>
47
-
48
-
49
- <div
50
- class="transition-all lg:hidden cursor-pointer"
51
- :class="{'rotate-180': open}"
52
- @click="open =!open"
53
- >
54
- <a-icon-chevron-down
55
- v-if="content.length"
56
- filled
57
- :font-controlled="false"
58
- class="w-6 h-6 "
59
- />
60
- </div>
61
- </div>
62
- <transition
63
- name="accordion"
64
- @enter="toFinalValues"
65
- @after-enter="onAfterEnter"
66
- @before-leave="toFinalValues"
67
- >
68
- <div
69
- v-if="filterCheck"
70
- class="mt-2 flex flex-col gap-2"
71
- >
72
- <nuxt-link-locale
73
- v-for="(item,idx) in content"
74
- :key="idx"
75
- class="text-xs"
76
- :to="item.link.replace(/\/$/, '')"
77
- >
78
- {{ t(item.title) }}
79
- </nuxt-link-locale>
80
- </div>
81
- </transition>
82
- </div>
83
- </template>
84
-
85
- <style scoped>
86
- .accordion-enter-active,
87
- .accordion-leave-active {
88
- overflow: hidden;
89
- transition: height 0.3s ease,
90
- opacity 0.3s ease,
91
- margin 0.3s ease;
92
-
93
- }
94
-
95
- .accordion-enter-from,
96
- .accordion-leave-to {
97
- height: 0 !important;
98
- opacity: 0 !important;
99
- margin: 0 !important;
100
- }
101
-
102
- </style>
103
-
104
- <!-- <div-->
105
- <!-- class="text-sm font-semibold-->
106
- <!-- cursor-pointer"-->
107
- <!-- >-->
108
- <!-- {{ link.title }}-->
109
- <!-- </div>-->
110
- <!-- <div class="flex flex-col gap-2">-->
111
- <!-- <nuxt-link-->
112
- <!-- v-for="(item,idx) in link.items"-->
113
- <!-- :key="idx"-->
114
- <!-- class="text-xs"-->
115
- <!-- :to="item.link"-->
116
- <!-- >-->
117
- <!-- {{ item.title }}-->
118
- <!-- </nuxt-link>-->
119
- <!-- </div>-->