Improved spacing on cards

This commit is contained in:
Thaum Rystra
2020-05-15 13:54:43 +02:00
parent 4b3f068d87
commit 59fa5bcd8c
6 changed files with 140 additions and 128 deletions

View File

@@ -1,18 +1,21 @@
<template lang="html"> <template lang="html">
<v-card :hover="hasClickListener" @click="$emit('click')"> <v-card
<v-toolbar :hover="hasClickListener"
flat class="toolbar-card"
:style="`transform: none; ${hasToolbarClickListener ? 'cursor: pointer;' : ''}`" @click="$emit('click')"
:color="color" >
:dark="isDark" <v-toolbar
@click="$emit('toolbarclick')" flat
> :style="`transform: none; ${hasToolbarClickListener ? 'cursor: pointer;' : ''}`"
<slot name="toolbar"/> :color="color"
</v-toolbar> :dark="isDark"
<div @click="$emit('toolbarclick')"
> >
<slot/> <slot name="toolbar" />
</div> </v-toolbar>
<div>
<slot />
</div>
</v-card> </v-card>
</template> </template>
@@ -41,5 +44,8 @@
}; };
</script> </script>
<style lang="css" scoped> <style lang="css">
.toolbar-card .v-toolbar__title {
font-size: 14px;
}
</style> </style>

View File

@@ -1,14 +1,15 @@
<template lang="html"> <template lang="html">
<div class="inventory"> <div class="inventory">
<column-layout> <column-layout>
<v-card> <div>
<v-switch <v-card>
v-model="organize" <v-card-text>
label="Organize" <v-switch
class="justify-end" v-model="organize"
style="margin: 16px 24px -16px;" label="Organize"
/> class="justify-end"
<!-- Equipping things isn't implemented yet />
<!-- Equipping things isn't implemented yet
<creature-properties-tree <creature-properties-tree
:root="{collection: 'creatures', id: creatureId}" :root="{collection: 'creatures', id: creatureId}"
:filter="{ :filter="{
@@ -22,26 +23,31 @@
/> />
<v-divider/> <v-divider/>
--> -->
<creature-properties-tree <creature-properties-tree
:root="{collection: 'creatures', id: creatureId}" :root="{collection: 'creatures', id: creatureId}"
:filter="{ :filter="{
equipped: {$ne: true}, equipped: {$ne: true},
type: {$in: ['item']}, type: {$in: ['item']},
'ancestors.id': {$nin: containerIds} 'ancestors.id': {$nin: containerIds}
}" }"
@selected="e => clickProperty(e)" :organize="organize"
:organize="organize" group="inventory"
group="inventory" @selected="e => clickProperty(e)"
/> />
</v-card> </v-card-text>
<div v-for="container in containersWithoutAncestorContainers" :key="container._id"> </v-card>
<container-card </div>
:model="container" <div
:organize="organize" v-for="container in containersWithoutAncestorContainers"
/> :key="container._id"
</div> >
</column-layout> <container-card
</div> :model="container"
:organize="organize"
/>
</div>
</column-layout>
</div>
</template> </template>
<script> <script>
@@ -51,17 +57,17 @@ import CreaturePropertiesTree from '/imports/ui/creature/creatureProperties/Crea
import ContainerCard from '/imports/ui/properties/components/inventory/ContainerCard.vue'; import ContainerCard from '/imports/ui/properties/components/inventory/ContainerCard.vue';
export default { export default {
components: {
ColumnLayout,
CreaturePropertiesTree,
ContainerCard,
},
props: { props: {
creatureId: String, creatureId: String,
}, },
data(){ return { data(){ return {
organize: false, organize: false,
}}, }},
components: {
ColumnLayout,
CreaturePropertiesTree,
ContainerCard,
},
meteor: { meteor: {
containers(){ containers(){
return CreatureProperties.find({ return CreatureProperties.find({

View File

@@ -1,47 +1,39 @@
<template lang="html"> <template lang="html">
<div class="spells"> <div class="spells">
<column-layout> <column-layout>
<v-card> <div>
<v-switch <v-card>
v-model="organize" <v-card-text>
label="Organize" <v-switch
class="justify-end" v-model="organize"
style="margin: 16px 24px -16px;" label="Organize"
/> class="justify-end"
<!-- Equipping things isn't implemented yet />
<creature-properties-tree <creature-properties-tree
:root="{collection: 'creatures', id: creatureId}" :root="{collection: 'creatures', id: creatureId}"
:filter="{ :filter="{
equipped: true, equipped: {$ne: true},
type: 'spell', type: 'spell',
'ancestors.id': {$nin: spellListIds} 'ancestors.id': {$nin: spellListIds}
}" }"
@selected="e => clickProperty(e)" :organize="organize"
:organize="organize" group="spells"
group="spells" @selected="e => clickProperty(e)"
/> />
<v-divider/> </v-card-text>
--> </v-card>
<creature-properties-tree </div>
:root="{collection: 'creatures', id: creatureId}" <div
:filter="{ v-for="spellList in spellListsWithoutAncestorSpellLists"
equipped: {$ne: true}, :key="spellList._id"
type: 'spell', >
'ancestors.id': {$nin: spellListIds} <spellList-card
}" :model="spellList"
@selected="e => clickProperty(e)" :organize="organize"
:organize="organize" />
group="spells" </div>
/> </column-layout>
</v-card> </div>
<div v-for="spellList in spellListsWithoutAncestorSpellLists" :key="spellList._id">
<spellList-card
:model="spellList"
:organize="organize"
/>
</div>
</column-layout>
</div>
</template> </template>
<script> <script>
@@ -51,17 +43,20 @@ import CreaturePropertiesTree from '/imports/ui/creature/creatureProperties/Crea
import SpellListCard from '/imports/ui/properties/components/spells/SpellListCard.vue'; import SpellListCard from '/imports/ui/properties/components/spells/SpellListCard.vue';
export default { export default {
props: {
creatureId: String,
},
data(){ return {
organize: false,
}},
components: { components: {
ColumnLayout, ColumnLayout,
CreaturePropertiesTree, CreaturePropertiesTree,
SpellListCard, SpellListCard,
}, },
props: {
creatureId: {
type: String,
required: true,
}
},
data(){ return {
organize: false,
}},
meteor: { meteor: {
spellLists(){ spellLists(){
return CreatureProperties.find({ return CreatureProperties.find({

View File

@@ -9,7 +9,7 @@
data-id="creature-tree-card" data-id="creature-tree-card"
> >
<div <div
class="layout column" class="layout column justify-start"
:style=" :style="
$vuetify.breakpoint.mdAndUp && $vuetify.breakpoint.mdAndUp &&
'width: 320px; flex-shrink: 0; flex-grow: 0;' 'width: 320px; flex-shrink: 0; flex-grow: 0;'
@@ -27,22 +27,23 @@
:disabled="organizeDisabled" :disabled="organizeDisabled"
style="flex-grow: 0; height: 32px;" style="flex-grow: 0; height: 32px;"
/> />
<v-combobox
ref="searchBox"
slot="extension"
v-model="filterString"
:items="filterOptions"
prepend-inner-icon="search"
class="mx-4"
hide-no-data
hide-selected
multiple
clearable
small-chips
deletable-chips
/>
</v-toolbar> </v-toolbar>
<v-combobox
ref="searchBox"
v-model="filterString"
:items="filterOptions"
prepend-inner-icon="search"
class="mx-4"
hide-no-data
hide-selected
multiple
clearable
small-chips
deletable-chips
/>
<creature-properties-tree <creature-properties-tree
class="pt-0 flex" class="pt-2 flex"
style="overflow-y: auto;" style="overflow-y: auto;"
:root="{collection: 'creatures', id: creatureId}" :root="{collection: 'creatures', id: creatureId}"
:organize="organize" :organize="organize"

View File

@@ -10,13 +10,15 @@
</v-toolbar-title> </v-toolbar-title>
<v-spacer /> <v-spacer />
</template> </template>
<creature-properties-tree <v-card-text>
:root="{collection: 'creatureProperties', id: model._id}" <creature-properties-tree
:filter="{type: {$in: ['container', 'item', 'folder']}}" :root="{collection: 'creatureProperties', id: model._id}"
:organize="organize" :filter="{type: {$in: ['container', 'item', 'folder']}}"
group="inventory" :organize="organize"
@selected="e => clickProperty(e)" group="inventory"
/> @selected="e => clickProperty(e)"
/>
</v-card-text>
</toolbar-card> </toolbar-card>
</template> </template>

View File

@@ -10,13 +10,15 @@
</v-toolbar-title> </v-toolbar-title>
<v-spacer /> <v-spacer />
</template> </template>
<creature-properties-tree <v-card-text>
:root="{collection: 'creatureProperties', id: model._id}" <creature-properties-tree
:filter="{type: {$in: ['spellList', 'spell', 'folder']}}" :root="{collection: 'creatureProperties', id: model._id}"
:organize="organize" :filter="{type: {$in: ['spellList', 'spell', 'folder']}}"
group="spells" :organize="organize"
@selected="e => clickProperty(e)" group="spells"
/> @selected="e => clickProperty(e)"
/>
</v-card-text>
</toolbar-card> </toolbar-card>
</template> </template>