mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue * change modal action names from show::modal to bv::show::modal * check if drops are undefined * fix modal widths - sellModal now using input instead of dropbox * upgrade to bootstrap 4.0beta * include package-lock changes * fix app menu dropdown position * upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position * fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width) * show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ ) * fix package-lock? * fix active button style / app header toggle button * fix package-lock ! * update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable * mixin naming style * fix buyQuestModal marginTop * fix customMenuDropdown position * fix userDropdown items
84 lines
1.7 KiB
Vue
84 lines
1.7 KiB
Vue
<template lang="pug">
|
|
div
|
|
.item-wrapper(@click="click()", :id="itemId")
|
|
.item(
|
|
:class="{'item-empty': emptyItem, 'highlight': highlightBorder}",
|
|
)
|
|
slot(name="itemBadge", :item="item")
|
|
span.item-content(:class="itemContentClass")
|
|
span.pet-progress-background(v-if="item.isAllowedToFeed() && progress > 0")
|
|
div.pet-progress-bar(v-bind:style="{width: 100 * progress/50 + '%' }")
|
|
span.item-label(v-if="label") {{ label }}
|
|
|
|
b-popover(
|
|
:target="itemId",
|
|
:triggers="showPopover ? 'hover' : ''",
|
|
:placement="popoverPosition",
|
|
)
|
|
slot(name="popoverContent", :item="item")
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
.pet-progress-background {
|
|
width: 62px;
|
|
height: 4px;
|
|
background-color: #e1e0e3;
|
|
position: absolute;
|
|
bottom: 4px;
|
|
left: calc((100% - 62px) / 2);
|
|
}
|
|
|
|
.pet-progress-bar {
|
|
height: 4px;
|
|
background-color: #24cc8f;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
import uuid from 'uuid';
|
|
|
|
export default {
|
|
props: {
|
|
item: {
|
|
type: Object,
|
|
},
|
|
itemContentClass: {
|
|
type: String,
|
|
},
|
|
label: {
|
|
type: String,
|
|
},
|
|
progress: {
|
|
type: Number,
|
|
default: -1,
|
|
},
|
|
emptyItem: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
highlightBorder: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
popoverPosition: {
|
|
type: String,
|
|
default: 'bottom',
|
|
},
|
|
showPopover: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
data () {
|
|
return Object.freeze({
|
|
itemId: uuid.v4(),
|
|
});
|
|
},
|
|
methods: {
|
|
click () {
|
|
this.$emit('click', {});
|
|
},
|
|
},
|
|
};
|
|
</script>
|