-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(files): recent sidebar functionality (#2997)
- Loading branch information
Showing
36 changed files
with
6,595 additions
and
5,948 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ul class="menu-list"> | ||
<li | ||
v-for="item in items" | ||
:class="[{'is-active' : isActiveRoute(item.route)}, {'disabled' : isFilesIndexLoading}]" | ||
@click="!isFilesIndexLoading && setActive(item.route)" | ||
> | ||
<component v-if="item.icon" :is="icons[item.icon]" size="1x" /> | ||
{{item.text}} | ||
</li> | ||
</ul> |
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,19 @@ | ||
li { | ||
cursor: pointer; | ||
padding: @xlight-spacing @light-spacing; | ||
margin: 0.2rem -@light-spacing; | ||
display: inline-flex; | ||
align-items: center; | ||
border-radius: @corner-rounding-smaller; | ||
&:extend(.full-width); | ||
-webkit-user-select: none; | ||
user-select: none; | ||
|
||
&:hover { | ||
background: @foreground; | ||
} | ||
|
||
svg { | ||
margin-right: @light-spacing; | ||
} | ||
} |
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,71 @@ | ||
<template src="./List.html"></template> | ||
|
||
<script lang="ts"> | ||
import Vue, { PropType } from 'vue' | ||
import { mapGetters } from 'vuex' | ||
import { | ||
ClockIcon, | ||
TrashIcon, | ||
HeartIcon, | ||
FolderIcon, | ||
LinkIcon, | ||
} from 'satellite-lucide-icons' | ||
import { FileIconsEnum, FileAsideRouteEnum } from '~/libraries/Enums/enums' | ||
import { SimpleItem } from '~/types/ui/sidebar' | ||
export default Vue.extend({ | ||
components: { | ||
ClockIcon, | ||
TrashIcon, | ||
HeartIcon, | ||
FolderIcon, | ||
LinkIcon, | ||
}, | ||
props: { | ||
items: { | ||
type: Array as PropType<SimpleItem[]>, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
...mapGetters('ui', ['isFilesIndexLoading']), | ||
icons() { | ||
return { | ||
[FileIconsEnum.CLOCK]: ClockIcon, | ||
[FileIconsEnum.TRASH]: TrashIcon, | ||
[FileIconsEnum.HEART]: HeartIcon, | ||
[FileIconsEnum.FOLDER]: FolderIcon, | ||
[FileIconsEnum.LINK]: LinkIcon, | ||
} | ||
}, | ||
}, | ||
methods: { | ||
/** | ||
* @method setActive | ||
* @description set files page route (default, recent, deleted, etc...) | ||
* @param {FileAsideRouteEnum} route clicked route string value | ||
*/ | ||
setActive(route: FileAsideRouteEnum) { | ||
if (!route) { | ||
this.$router.push({ query: {} }) | ||
return | ||
} | ||
this.$router.push({ query: { route } }) | ||
}, | ||
/** | ||
* @method isActiveRoute | ||
* @description used to set active css class on list | ||
* @param {FileAsideRouteEnum} route clicked route string value | ||
*/ | ||
isActiveRoute(route: FileAsideRouteEnum) { | ||
// if default route | ||
if (!this.$route.query.route && !route) { | ||
return true | ||
} | ||
return route === this.$route.query.route | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped lang="less" src="./List.less"></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
File renamed without changes.
File renamed without changes.
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
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.