[Entities UI] Added Expand/Collapse and Hide actions to groups.

Also, replaced all the deprecated `::v-deep` SCSS notations with
`:deep`.
This commit is contained in:
Fabio Manganiello 2023-10-14 13:30:01 +02:00
parent dbe19042bc
commit 01c7d230f1
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
17 changed files with 68 additions and 35 deletions

View file

@ -81,7 +81,7 @@ export default {
align-items: center; align-items: center;
} }
::v-deep(.icon-container) { :deep(.icon-container) {
width: 2em; width: 2em;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;

View file

@ -43,13 +43,18 @@
</span> </span>
<span class="section right"> <span class="section right">
<button title="Refresh" @click="refresh(group)"> <Dropdown title="Actions" icon-class="fa fa-ellipsis-h">
<i class="fa fa-sync-alt" /> <DropdownItem text="Refresh" icon-class="fa fa-sync-alt" @click="refresh(group)" />
</button> <DropdownItem text="Hide" icon-class="fa fa-eye-slash" @click="hideGroup(group)" />
<DropdownItem text="Collapse" icon-class="fa fa-caret-up"
@click="collapsedGroups[group] = true" v-if="!collapsedGroups[group]" />
<DropdownItem text="Expand" icon-class="fa fa-caret-down"
@click="collapsedGroups[group] = false" v-else />
</Dropdown>
</span> </span>
</div> </div>
<div class="body"> <div class="body" v-if="!collapsedGroups[group]">
<div class="entity-frame" <div class="entity-frame"
v-for="entity in Object.values(group.entities).sort((a, b) => a.name.localeCompare(b.name))" v-for="entity in Object.values(group.entities).sort((a, b) => a.name.localeCompare(b.name))"
:key="entity.id"> :key="entity.id">
@ -76,6 +81,8 @@
<script> <script>
import Utils from "@/Utils" import Utils from "@/Utils"
import Dropdown from "@/components/elements/Dropdown";
import DropdownItem from "@/components/elements/DropdownItem";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import Icon from "@/components/elements/Icon"; import Icon from "@/components/elements/Icon";
import NoItems from "@/components/elements/NoItems"; import NoItems from "@/components/elements/NoItems";
@ -91,6 +98,8 @@ export default {
name: "Entities", name: "Entities",
mixins: [Utils], mixins: [Utils],
components: { components: {
Dropdown,
DropdownItem,
Entity, Entity,
EntityModal, EntityModal,
Icon, Icon,
@ -129,6 +138,7 @@ export default {
selectedEntities: {}, selectedEntities: {},
selectedGroups: {}, selectedGroups: {},
}, },
collapsedGroups: {},
} }
}, },
@ -217,6 +227,14 @@ export default {
) )
}, },
hideGroup(group) {
Object.keys(group.entities).forEach((id) => {
if (this.selector.selectedEntities[id])
delete this.selector.selectedEntities[id]
})
delete this.selector.selectedGroups[group.name]
},
async refresh(group) { async refresh(group) {
const entities = (group ? group.entities : this.entities) || {} const entities = (group ? group.entities : this.entities) || {}
const args = {} const args = {}
@ -625,5 +643,20 @@ export default {
} }
} }
} }
:deep(.dropdown-container) {
.dropdown {
min-width: 10em;
margin-left: 0;
.item {
box-shadow: none;
}
}
button {
background: none;
}
}
} }
</style> </style>

View file

@ -163,7 +163,7 @@ export default {
} }
} }
::v-deep(button) { :deep(button) {
background: none; background: none;
padding: 0 .25em; padding: 0 .25em;
border: 0; border: 0;

View file

@ -398,11 +398,11 @@ export default {
} }
} }
::v-deep(.loading) { :deep(.loading) {
z-index: 10; z-index: 10;
} }
::v-deep(.media-info-container) { :deep(.media-info-container) {
.modal-container { .modal-container {
.content { .content {
max-width: 75%; max-width: 75%;
@ -415,7 +415,7 @@ export default {
} }
} }
::v-deep(.subtitles-container) { :deep(.subtitles-container) {
.body { .body {
padding: 0 !important; padding: 0 !important;
@ -425,7 +425,7 @@ export default {
} }
} }
::v-deep(.play-url-container) { :deep(.play-url-container) {
.body { .body {
padding: 1em !important; padding: 1em !important;
} }

View file

@ -118,7 +118,7 @@ export default {
} }
.players { .players {
::v-deep(.dropdown) { :deep(.dropdown) {
direction: ltr; direction: ltr;
.item { .item {
padding: .5em; padding: .5em;
@ -129,13 +129,13 @@ export default {
} }
} }
::v-deep(.refresh) { :deep(.refresh) {
font-weight: bold; font-weight: bold;
font-size: .8em; font-size: .8em;
opacity: .7; opacity: .7;
} }
::v-deep(.player.selected) { :deep(.player.selected) {
color: $selected-fg; color: $selected-fg;
} }
} }

View file

@ -92,7 +92,7 @@ export default {
margin-right: .5em; margin-right: .5em;
} }
::v-deep(.dropdown-container) { :deep(.dropdown-container) {
.item { .item {
box-shadow: none; box-shadow: none;
} }

View file

@ -20,7 +20,7 @@ export default {
padding: .5em; padding: .5em;
box-shadow: $border-shadow-bottom; box-shadow: $border-shadow-bottom;
::v-deep(.dropdown) { :deep(.dropdown) {
.item.active { .item.active {
color: $default-hover-fg; color: $default-hover-fg;
} }

View file

@ -347,7 +347,7 @@ main {
overflow: auto; overflow: auto;
} }
::v-deep(button) { :deep(button) {
background: none; background: none;
padding: .5em .75em; padding: .5em .75em;
border: 0; border: 0;
@ -358,7 +358,7 @@ main {
} }
} }
::v-deep(a) { :deep(a) {
color: $default-fg; color: $default-fg;
opacity: 0.65; opacity: 0.65;
@ -370,13 +370,13 @@ main {
} }
.playlists-modal-container { .playlists-modal-container {
::v-deep(.body) { :deep(.body) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 0 !important; padding: 0 !important;
} }
::v-deep(.filter) { :deep(.filter) {
padding: .33em; padding: .33em;
background-color: $default-bg-6; background-color: $default-bg-6;
border-bottom: $default-border-2; border-bottom: $default-border-2;
@ -386,7 +386,7 @@ main {
} }
} }
::v-deep(.playlists) { :deep(.playlists) {
overflow: auto; overflow: auto;
padding: 1.5em; padding: 1.5em;
@ -406,7 +406,7 @@ main {
} }
.track-info-container { .track-info-container {
::v-deep(.body) { :deep(.body) {
height: 15em; height: 15em;
overflow: auto; overflow: auto;

View file

@ -205,7 +205,7 @@ export default {
} }
} }
::v-deep(.header) { :deep(.header) {
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; align-items: center;

View file

@ -365,7 +365,7 @@ export default {
} }
} }
::v-deep(.track-info-content) { :deep(.track-info-content) {
.attr { .attr {
opacity: 0.75; opacity: 0.75;
} }

View file

@ -357,7 +357,7 @@ export default {
width: 100%; width: 100%;
} }
::v-deep(.header) { :deep(.header) {
.back-btn { .back-btn {
padding-left: .25em; padding-left: .25em;
} }

View file

@ -242,13 +242,13 @@ export default {
width: 100%; width: 100%;
} }
::v-deep(.form-footer) { :deep(.form-footer) {
height: 3em; height: 3em;
padding-right: 0; padding-right: 0;
border: 0; border: 0;
} }
::v-deep(button) { :deep(button) {
border: 0; border: 0;
&[type=submit] { &[type=submit] {
@ -268,7 +268,7 @@ export default {
overflow: auto; overflow: auto;
} }
::v-deep(.header) { :deep(.header) {
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; align-items: center;

View file

@ -69,7 +69,7 @@
} }
.actions { .actions {
::v-deep(button) { :deep(button) {
opacity: .7; opacity: .7;
} }
} }

View file

@ -400,7 +400,7 @@ export default {
background: $background-color; background: $background-color;
} }
::v-deep(.info) { :deep(.info) {
.modal { .modal {
.content { .content {
width: 90%; width: 90%;
@ -497,4 +497,4 @@ export default {
} }
} }
} }
</style> </style>

View file

@ -50,7 +50,7 @@ export default {
} }
} }
::v-deep(button) { :deep(button) {
background: none; background: none;
padding: 0 .25em; padding: 0 .25em;
border: 0; border: 0;

View file

@ -246,7 +246,7 @@ export default {
} }
} }
::v-deep(.modal-body) { :deep(.modal-body) {
.row { .row {
display: flex; display: flex;
border-bottom: $default-border; border-bottom: $default-border;
@ -276,7 +276,7 @@ export default {
} }
} }
::v-deep(.modal-body) { :deep(.modal-body) {
.dropdown-container { .dropdown-container {
.row { .row {
box-shadow: none; box-shadow: none;

View file

@ -55,7 +55,7 @@ $header-height: 3.5em;
} }
.actions { .actions {
::v-deep(button) { :deep(button) {
opacity: .65; opacity: .65;
} }
} }
@ -65,7 +65,7 @@ $header-height: 3.5em;
margin-right: .75em; margin-right: .75em;
} }
::v-deep(.dropdown-container) { :deep(.dropdown-container) {
.item { .item {
box-shadow: none; box-shadow: none;
} }