1717<template >
1818 <aside
1919 class =" flex flex-col bg-white backdrop-filter backdrop-blur-lg bg-opacity-80 transition-all"
20+ :class =" { 'navbar--open': open }"
2021 >
2122 <ul class =" relative px-1 pb-1" >
2223 <!-- The actual nav -->
2728 class =" relative mb-1"
2829 >
2930 <router-link
30- :class =" { 'navbar-link__active': isActiveGroup(group) }"
31+ :class =" {
32+ 'bg-sba-50 bg-opacity-80 text-sba-900': isActiveGroup(group),
33+ 'px-1 justify-center': !open,
34+ 'px-2 md:px-6': open,
35+ }"
3136 :to =" {
3237 name: group.views[0].name,
3338 params: { instanceId: instance.id },
3439 }"
35- class =" navbar-link navbar-link__group "
40+ class =" bg-sba-50 bg-opacity-40 duration-300 ease-in-out flex items-center overflow-hidden py-4 rounded text-sm transition whitespace-nowrap text-gray-700 hover:bg-sba-50 hover:bg-opacity-80 hover:text-sba-900 h-12 "
3641 >
37- <span v-html =" group.icon" />
42+ <span :class = " { '!m-0': !open } " v-html =" group.icon" />
3843 <span
44+ v-if =" open"
3945 v-text ="
4046 hasMultipleViews(group)
4147 ? getGroupTitle(group.id)
4248 : $t(group.views[0].label)
4349 "
4450 />
4551 <svg
46- v-if =" hasMultipleViews(group)"
52+ v-if =" hasMultipleViews(group) && open "
4753 :class =" {
4854 '-rotate-90': !isActiveGroup(group),
4955 '': isActiveGroup(group),
6571
6672 <!-- Le subnav -->
6773 <ul
68- v-if =" hasMultipleViews(group) && isActiveGroup(group)"
74+ v-if =" hasMultipleViews(group) && isActiveGroup(group) && open "
6975 class =" relative block"
7076 >
7177 <li
7581 >
7682 <router-link
7783 :to =" { name: view.name, params: { instanceId: instance.id } }"
78- active-class =" navbar-link__active "
79- class =" navbar-link navbar-link__group_item "
84+ active-class =" bg-sba-50 bg-opacity-80 text-sba-900 "
85+ class =" bg-sba-50 bg-opacity-40 duration-300 ease-in-out flex items-center overflow-hidden py-4 rounded text-sm transition whitespace-nowrap text-gray-700 hover:bg-sba-50 hover:bg-opacity-80 hover:text-sba-900 h-6 mb-1 mt-1 pl-12 pr-6 "
8086 exact-active-class =" "
8187 >
8288 <component :is =" view.handle" />
8591 </ul >
8692 </li >
8793
88- <template v-if =" customLinksFromMetadata ?.length > 0 " >
94+ <template v-if =" customLinksFromMetadata ?.length > 0 && open " >
8995 <Divider align =" center" class =" !my-2" >
9096 <small class =" bold" >
9197 {{ $t('sidebar.custom-link.title') }}
105111 name: 'instances/custom-link-view',
106112 params: { instanceId: instance.id, url: view.href },
107113 }"
108- active-class =" navbar-link__active "
109- class =" navbar-link navbar-link--custom navbar-link__group_item "
114+ active-class =" bg-sba-50 bg-opacity-80 text-sba-900 "
115+ class =" bg-sba-50 bg-opacity-40 duration-300 ease-in-out flex items-center overflow-hidden py-4 rounded text-sm transition whitespace-nowrap text-gray-700 hover:bg-sba-50 hover:bg-opacity-80 hover:text-sba-900 h-6 mb-1 mt-1 pl-12 pr-6 !px-6 "
110116 exact-active-class =" "
111117 >
112118 <component :is =" view.handle" />
113119 </router-link >
114120 <a
115121 v-else-if =" view.href"
116122 :href =" view.href"
117- class =" navbar-link navbar-link--custom navbar-link__group_item "
123+ class =" bg-sba-50 bg-opacity-40 duration-300 ease-in-out flex items-center overflow-hidden py-4 rounded text-sm transition whitespace-nowrap text-gray-700 hover:bg-sba-50 hover:bg-opacity-80 hover:text-sba-900 h-6 mb-1 mt-1 pl-12 pr-6 !px-6 "
118124 target =" _blank"
119125 rel =" noopener"
120126 >
133139</template >
134140
135141<script lang="ts" setup>
136- import {
137- faArrowUpRightFromSquare ,
138- faSquareCaretLeft ,
139- } from ' @fortawesome/free-solid-svg-icons' ;
142+ import { faArrowUpRightFromSquare } from ' @fortawesome/free-solid-svg-icons' ;
140143import { FontAwesomeIcon } from ' @fortawesome/vue-fontawesome' ;
141144import { Divider } from ' primevue' ;
142145import { computed , h , toRaw } from ' vue' ;
@@ -148,12 +151,17 @@ import Instance from '@/services/instance';
148151import { compareBy } from ' @/utils/collections' ;
149152import { VIEW_GROUP , VIEW_GROUP_ICON } from ' @/views/ViewGroup' ;
150153
151- const props = defineProps <{
152- views: any [];
153- instance: Instance ;
154- application: Application ;
155- open: boolean ;
156- }>();
154+ const props = withDefaults (
155+ defineProps <{
156+ views: any [];
157+ instance: Instance ;
158+ application: Application ;
159+ open? : boolean ;
160+ }>(),
161+ {
162+ open: true ,
163+ },
164+ );
157165
158166const { t } = useI18n ();
159167const route = useRoute ();
@@ -225,29 +233,3 @@ function hasMultipleViews(group: any) {
225233 return group .views .length > 1 ;
226234}
227235 </script >
228-
229- <style scoped>
230- a .navbar-link {
231- @apply cursor-pointer ;
232- }
233- .navbar-link {
234- @apply bg-sba- 50 bg-opacity- 40 duration- 300 ease-in-out flex items-center overflow-hidden py- 4 rounded text-sm transition whitespace-nowrap ;
235- @apply text-gray- 700;
236- }
237- .navbar-link--custom {
238- @apply !px- 6;
239- }
240-
241- .navbar-link :hover ,
242- .navbar-link__active {
243- @apply bg-sba- 50 bg-opacity- 80 text-sba- 900;
244- }
245-
246- .navbar-link__group_item {
247- @apply h- 6 mb- 1 mt- 1 pl- 12 pr- 6;
248- }
249-
250- .navbar-link__group {
251- @apply h- 12 px- 2 md :px-6;
252- }
253- </style >
0 commit comments