-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5884df
commit 9b53e42
Showing
10 changed files
with
325 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<!-- Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS --> | ||
|
||
<template> | ||
<ion-list class="list-sidebar"> | ||
<ion-header | ||
lines="none" | ||
class="list-sidebar-header title-h5" | ||
:class="isContentVisible ? 'open' : 'close'" | ||
@click="isContentVisible = !isContentVisible" | ||
> | ||
<div class="list-sidebar-header-title"> | ||
<ion-icon | ||
class="list-sidebar-header-title__icon" | ||
:icon="icon" | ||
/> | ||
<ion-text class="list-sidebar-header-title__text"> | ||
{{ $msTranslate(title) }} | ||
</ion-text> | ||
</div> | ||
<ion-icon | ||
class="list-sidebar-toggle-icon" | ||
:icon="isContentVisible ? remove : add" | ||
/> | ||
</ion-header> | ||
<div | ||
v-if="isContentVisible" | ||
class="list-sidebar-content" | ||
> | ||
<slot /> | ||
</div> | ||
</ion-list> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { IonList, IonHeader, IonIcon, IonText } from '@ionic/vue'; | ||
import { Translatable } from 'megashark-lib'; | ||
import { ref } from 'vue'; | ||
import { add, remove } from 'ionicons/icons'; | ||
|
||
const isContentVisible = ref(true); | ||
|
||
defineProps<{ | ||
title: Translatable; | ||
icon: string; | ||
}>(); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.list-sidebar { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
gap: 0.5rem; | ||
margin-bottom: 1rem; | ||
padding: 0.5rem; | ||
border-radius: var(--parsec-radius-8); | ||
|
||
&.list-file { | ||
margin: 1rem 0; | ||
} | ||
|
||
&-header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
transition: border 0.2s ease-in-out; | ||
opacity: 0.8; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
|
||
&.open { | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
&-title { | ||
color: var(--parsec-color-light-secondary-inversed-contrast); | ||
display: flex; | ||
align-items: center; | ||
|
||
&__icon { | ||
font-size: 1rem; | ||
margin-right: 0.5rem; | ||
} | ||
|
||
&__text { | ||
margin-right: 0.5rem; | ||
line-height: auto; | ||
user-select: none; | ||
} | ||
} | ||
|
||
&:active { | ||
.list-sidebar-toggle-icon { | ||
scale: 0.85; | ||
} | ||
} | ||
} | ||
|
||
&-toggle-icon { | ||
user-select: none; | ||
padding: 0.125rem; | ||
font-size: 1.25rem; | ||
border-radius: var(--parsec-radius-6); | ||
color: var(--parsec-color-light-secondary-inversed-contrast); | ||
} | ||
|
||
&-content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS | ||
|
||
import SidebarMenuList from '@/components/sidebar/SidebarMenuList.vue'; | ||
import SidebarRecentFileItem from '@/components/sidebar/SidebarRecentFileItem.vue'; | ||
import SidebarWorkspaceItem from '@/components/sidebar/SidebarWorkspaceItem.vue'; | ||
|
||
export { SidebarRecentFileItem, SidebarWorkspaceItem }; | ||
export { SidebarMenuList, SidebarRecentFileItem, SidebarWorkspaceItem }; |
Oops, something went wrong.