mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
119 lines
2.5 KiB
Vue
119 lines
2.5 KiB
Vue
<template>
|
|
<div :class="[{'is-apple': $isApple()}, location]">
|
|
<Emoji
|
|
v-if="emoji"
|
|
:emoji="emoji"
|
|
class="emoji-icon"
|
|
/>
|
|
<FontAwesomeIcon
|
|
v-if="!emoji"
|
|
:class="[{'is-deleted':isDeleted},{'is-team':item.team_folder},{'default-color': ! color && ! isDeleted}, 'folder-icon' ]"
|
|
:style="{fill: color}"
|
|
icon="folder"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Emoji from '/resources/js/components/Others/Emoji'
|
|
|
|
export default {
|
|
name: 'FolderIcon',
|
|
props: [
|
|
'folderIcon',
|
|
'location',
|
|
'item',
|
|
],
|
|
components: {
|
|
Emoji
|
|
},
|
|
computed: {
|
|
isDeleted() {
|
|
return this.item.deleted_at ? true : false
|
|
},
|
|
emoji() {
|
|
// Return emoji if is changed from rename popup
|
|
if (this.folderIcon)
|
|
return this.folderIcon.emoji ? this.folderIcon.emoji : false
|
|
|
|
// Return emoji if is already set
|
|
return this.item.emoji ? this.item.emoji : false
|
|
},
|
|
color() {
|
|
// Return color if is changed from rename popup
|
|
if (this.folderIcon)
|
|
return this.folderIcon.color ? this.folderIcon.color : false
|
|
|
|
// Return color if is already set
|
|
return this.item.color ? this.item.color : false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@import '/resources/sass/vuefilemanager/_variables';
|
|
@import '/resources/sass/vuefilemanager/_mixins';
|
|
|
|
// Locations
|
|
.file-item-list {
|
|
&.is-apple .emoji-icon {
|
|
font-size: 50px;
|
|
line-height: 1.1;
|
|
}
|
|
}
|
|
|
|
.file-item-grid {
|
|
&.is-apple .emoji-icon {
|
|
font-size: 80px;
|
|
line-height: 1.1;
|
|
}
|
|
}
|
|
|
|
.thumbnail-item {
|
|
&.is-apple .emoji-icon {
|
|
font-size: 36px;
|
|
line-height: 1.1;
|
|
}
|
|
}
|
|
|
|
.emoji-picker-preview {
|
|
&.is-apple .emoji-icon {
|
|
font-size: 22px;
|
|
line-height: 1.1;
|
|
}
|
|
}
|
|
|
|
.folder-icon {
|
|
|
|
path {
|
|
fill: inherit;
|
|
}
|
|
|
|
&.is-deleted {
|
|
path {
|
|
fill: $dark_background;
|
|
}
|
|
}
|
|
|
|
&.is-team {
|
|
path {
|
|
fill: transparent;
|
|
stroke-width: 20px;
|
|
stroke: inherit;
|
|
}
|
|
}
|
|
}
|
|
|
|
.dark-mode {
|
|
|
|
.folder-icon {
|
|
&.is-deleted {
|
|
path {
|
|
fill: lighten($dark_mode_foreground, 5%);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|