2024-07-07 19:01:44 +00:00
|
|
|
<template>
|
|
|
|
<ul class="stash-menu nolist noselect">
|
|
|
|
<li
|
2024-08-26 04:15:22 +00:00
|
|
|
v-for="userStash in stashes"
|
2024-07-07 19:01:44 +00:00
|
|
|
:key="`stash-${userStash.id}`"
|
|
|
|
class="menu-item"
|
|
|
|
>
|
|
|
|
<label class="menu-stash">
|
|
|
|
<Checkbox
|
|
|
|
:checked="itemStashes.some((itemStash) => itemStash.id === userStash.id)"
|
|
|
|
@change="(checked) => checked ? emit('stash', userStash) : emit('unstash', userStash)"
|
|
|
|
/>{{ userStash.name }}
|
|
|
|
</label>
|
|
|
|
</li>
|
2024-08-04 21:40:25 +00:00
|
|
|
|
|
|
|
<li class="menu-item create">
|
|
|
|
<label
|
2024-08-22 23:35:39 +00:00
|
|
|
v-close-popper
|
2024-08-04 21:40:25 +00:00
|
|
|
class="menu-stash"
|
|
|
|
@click="emit('create')"
|
|
|
|
>
|
|
|
|
<Icon icon="plus3" />
|
|
|
|
New
|
|
|
|
</label>
|
|
|
|
</li>
|
2024-07-07 19:01:44 +00:00
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import Checkbox from '#/components/form/checkbox.vue';
|
|
|
|
|
|
|
|
defineProps({
|
2024-08-26 04:15:22 +00:00
|
|
|
stashes: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
2024-07-07 19:01:44 +00:00
|
|
|
},
|
|
|
|
itemStashes: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2024-08-04 21:40:25 +00:00
|
|
|
const emit = defineEmits(['stash', 'unstash', 'create']);
|
2024-07-07 19:01:44 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.menu-item {
|
2024-08-04 21:40:25 +00:00
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--shadow-weak-10);
|
|
|
|
padding: 0 .55rem 0 .2rem;
|
|
|
|
}
|
2024-07-07 19:01:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.menu-stash {
|
|
|
|
display: flex;
|
2024-08-04 21:40:25 +00:00
|
|
|
width: 100%;
|
2024-07-07 19:01:44 +00:00
|
|
|
align-items: center;
|
|
|
|
padding: .5rem;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--primary);
|
2024-08-04 21:40:25 +00:00
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--primary);
|
|
|
|
}
|
2024-07-07 19:01:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.check-container {
|
|
|
|
margin-right: .5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|