mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
WIP(shops): more fixes
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
|
box-shadow: 0 3px 6px 0 rgba($black, 0.16), 0 3px 6px 0 rgba($black, 0.24);
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
:right="true"
|
:right="true"
|
||||||
:hide-icon="false"
|
:hide-icon="false"
|
||||||
:inline-dropdown="false"
|
:inline-dropdown="false"
|
||||||
|
:direct-select="true"
|
||||||
@select="groupBy = $event"
|
@select="groupBy = $event"
|
||||||
>
|
>
|
||||||
<template #item="{ item }">
|
<template #item="{ item }">
|
||||||
|
|||||||
@@ -140,47 +140,47 @@
|
|||||||
{{ petGroup.label }}
|
{{ petGroup.label }}
|
||||||
</h4>
|
</h4>
|
||||||
<!-- eslint-disable vue/no-use-v-if-with-v-for, max-len -->
|
<!-- eslint-disable vue/no-use-v-if-with-v-for, max-len -->
|
||||||
<div
|
<div class="d-inline-flex flex-column">
|
||||||
v-for="(group, key, index) in pets(petGroup, hideMissing, selectedSortBy, searchTextThrottled)"
|
|
||||||
v-if="index === 0 || $_openedItemRows_isToggled(petGroup.key)"
|
|
||||||
:key="key"
|
|
||||||
class="pet-row d-inline-flex"
|
|
||||||
>
|
|
||||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
|
||||||
<div
|
<div
|
||||||
v-for="item in group"
|
v-for="(group, key, index) in pets(petGroup, hideMissing, selectedSortBy, searchTextThrottled)"
|
||||||
v-show="show('pet', item)"
|
v-if="index === 0 || $_openedItemRows_isToggled(petGroup.key)"
|
||||||
:key="item.key"
|
:key="key"
|
||||||
v-drag.drop.food="item.key"
|
class="pet-row d-flex"
|
||||||
class="pet-group"
|
|
||||||
:class="{'last': item.isLastInRow}"
|
|
||||||
@itemDragOver="onDragOver($event, item)"
|
|
||||||
@itemDropped="onDrop($event, item)"
|
|
||||||
@itemDragLeave="onDragLeave()"
|
|
||||||
>
|
>
|
||||||
<petItem
|
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||||
:item="item"
|
<div
|
||||||
:popover-position="'top'"
|
v-for="item in group"
|
||||||
:show-popover="currentDraggingFood == null"
|
v-show="show('pet', item)"
|
||||||
:highlight-border="highlightPet == item.key"
|
:key="item.key"
|
||||||
@click="petClicked(item)"
|
v-drag.drop.food="item.key"
|
||||||
|
class="pet-group"
|
||||||
|
@itemDragOver="onDragOver($event, item)"
|
||||||
|
@itemDropped="onDrop($event, item)"
|
||||||
|
@itemDragLeave="onDragLeave()"
|
||||||
>
|
>
|
||||||
<template
|
<petItem
|
||||||
slot="itemBadge"
|
:item="item"
|
||||||
slot-scope="context"
|
:popover-position="'top'"
|
||||||
|
:show-popover="currentDraggingFood == null"
|
||||||
|
:highlight-border="highlightPet == item.key"
|
||||||
|
@click="petClicked(item)"
|
||||||
>
|
>
|
||||||
<equip-badge
|
<template
|
||||||
:equipped="context.item.key === currentPet"
|
slot="itemBadge"
|
||||||
:show="isOwned('pet', context.item)"
|
slot-scope="context"
|
||||||
@click="selectPet(context.item)"
|
>
|
||||||
/>
|
<equip-badge
|
||||||
</template>
|
:equipped="context.item.key === currentPet"
|
||||||
</petItem>
|
:show="isOwned('pet', context.item)"
|
||||||
|
@click="selectPet(context.item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</petItem>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<show-more-button
|
<show-more-button
|
||||||
v-if="petRowCount[petGroup.key] > 1 && petGroup.key !== 'specialPets' && !(petGroup.key === 'wackyPets' && selectedSortBy !== 'sortByColor')"
|
v-if="petRowCount[petGroup.key] > 1 && petGroup.key !== 'specialPets' && !(petGroup.key === 'wackyPets' && selectedSortBy !== 'sortByColor')"
|
||||||
:show-all="$_openedItemRows_isToggled(petGroup.key)"
|
:show-all="$_openedItemRows_isToggled(petGroup.key)"
|
||||||
class="show-more-button"
|
|
||||||
@click="setShowMore(petGroup.key)"
|
@click="setShowMore(petGroup.key)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -202,46 +202,48 @@
|
|||||||
{{ mountGroup.label }}
|
{{ mountGroup.label }}
|
||||||
</h4>
|
</h4>
|
||||||
<!-- eslint-disable vue/no-use-v-if-with-v-for, max-len -->
|
<!-- eslint-disable vue/no-use-v-if-with-v-for, max-len -->
|
||||||
<div
|
<div class="d-inline-flex flex-column">
|
||||||
v-for="(group, key, index) in mounts(mountGroup, hideMissing, selectedSortBy, searchTextThrottled)"
|
|
||||||
v-if="index === 0 || $_openedItemRows_isToggled(mountGroup.key)"
|
|
||||||
:key="key"
|
|
||||||
class="pet-row d-flex"
|
|
||||||
>
|
|
||||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
|
||||||
<div
|
<div
|
||||||
v-for="item in group"
|
v-for="(group, key, index) in mounts(mountGroup, hideMissing, selectedSortBy, searchTextThrottled)"
|
||||||
v-show="show('mount', item)"
|
v-if="index === 0 || $_openedItemRows_isToggled(mountGroup.key)"
|
||||||
:key="item.key"
|
:key="key"
|
||||||
class="pet-group"
|
class="pet-row d-flex"
|
||||||
>
|
>
|
||||||
<mountItem
|
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||||
|
<div
|
||||||
|
v-for="item in group"
|
||||||
|
class="pet-group"
|
||||||
|
v-show="show('mount', item)"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
:item="item"
|
|
||||||
:popover-position="'top'"
|
|
||||||
:show-popover="true"
|
|
||||||
@click="selectMount(item)"
|
|
||||||
>
|
>
|
||||||
<span slot="popoverContent">
|
<mountItem
|
||||||
<h4 class="popover-content-title">{{ item.name }}</h4>
|
:key="item.key"
|
||||||
</span>
|
:item="item"
|
||||||
<template
|
:popover-position="'top'"
|
||||||
slot="itemBadge"
|
:show-popover="true"
|
||||||
|
@click="selectMount(item)"
|
||||||
>
|
>
|
||||||
<equip-badge
|
<span slot="popoverContent">
|
||||||
:equipped="item.key === currentMount"
|
<h4 class="popover-content-title">{{ item.name }}</h4>
|
||||||
:show="isOwned('mount', item)"
|
</span>
|
||||||
@click="selectMount(item)"
|
<template
|
||||||
/>
|
slot="itemBadge"
|
||||||
</template>
|
>
|
||||||
</mountItem>
|
<equip-badge
|
||||||
|
:equipped="item.key === currentMount"
|
||||||
|
:show="isOwned('mount', item)"
|
||||||
|
@click="selectMount(item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</mountItem>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<show-more-button
|
||||||
|
v-if="mountRowCount[mountGroup.key] > 1 && mountGroup.key !== 'specialMounts'"
|
||||||
|
:show-all="$_openedItemRows_isToggled(mountGroup.key)"
|
||||||
|
@click="setShowMore(mountGroup.key)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<show-more-button
|
|
||||||
v-if="mountRowCount[mountGroup.key] > 1 && mountGroup.key !== 'specialMounts'"
|
|
||||||
:show-all="$_openedItemRows_isToggled(mountGroup.key)"
|
|
||||||
@click="setShowMore(mountGroup.key)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<inventoryDrawer>
|
<inventoryDrawer>
|
||||||
<template
|
<template
|
||||||
@@ -322,10 +324,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pet-row {
|
.pet-row {
|
||||||
max-width: 100%;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.item-wrapper {
|
.pet-group:not(:last-of-type) {
|
||||||
margin-right: 24px;
|
margin-right: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,24 +344,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.stable {
|
.stable {
|
||||||
|
|
||||||
.standard-page {
|
|
||||||
padding-right:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.standard-page .clearfix .float-right {
|
|
||||||
margin-right: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.svg-icon.inline.icon-16 {
|
.svg-icon.inline.icon-16 {
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.last {
|
|
||||||
margin-right: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-focus:focus {
|
.no-focus:focus {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
:initial-item="selectedGearCategory"
|
:initial-item="selectedGearCategory"
|
||||||
:items="marketGearCategories"
|
:items="marketGearCategories"
|
||||||
:with-icon="true"
|
:with-icon="true"
|
||||||
|
:direct-select="true"
|
||||||
@selected="selectedGroupGearByClass = $event.id"
|
@selected="selectedGroupGearByClass = $event.id"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
:label="$t('sortBy')"
|
:label="$t('sortBy')"
|
||||||
:initial-item="selectedSortGearBy"
|
:initial-item="selectedSortGearBy"
|
||||||
:items="sortGearBy"
|
:items="sortGearBy"
|
||||||
|
:direct-select="true"
|
||||||
@selected="selectedSortGearBy = $event"
|
@selected="selectedSortGearBy = $event"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -93,7 +95,7 @@ import pinUtils from '../../../mixins/pinUtils';
|
|||||||
const sortGearTypes = [
|
const sortGearTypes = [
|
||||||
'sortByType', 'sortByPrice', 'sortByCon',
|
'sortByType', 'sortByPrice', 'sortByCon',
|
||||||
'sortByPer', 'sortByStr', 'sortByInt',
|
'sortByPer', 'sortByStr', 'sortByInt',
|
||||||
].map(g => ({ id: g }));
|
].map(g => ({ id: g, identifier: g }));
|
||||||
|
|
||||||
const sortGearTypeMap = {
|
const sortGearTypeMap = {
|
||||||
sortByType: 'type',
|
sortByType: 'type',
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
:label="$t('sortBy')"
|
:label="$t('sortBy')"
|
||||||
:initial-item="selectedSortItemsBy"
|
:initial-item="selectedSortItemsBy"
|
||||||
:items="sortItemsBy"
|
:items="sortItemsBy"
|
||||||
|
:direct-select="true"
|
||||||
@selected="selectedSortItemsBy = $event"
|
@selected="selectedSortItemsBy = $event"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -181,7 +182,7 @@ import inventoryUtils from '@/mixins/inventoryUtils';
|
|||||||
import pinUtils from '@/mixins/pinUtils';
|
import pinUtils from '@/mixins/pinUtils';
|
||||||
import { worldStateMixin } from '@/mixins/worldState';
|
import { worldStateMixin } from '@/mixins/worldState';
|
||||||
|
|
||||||
const sortItems = ['AZ', 'sortByNumber'].map(g => ({ id: g }));
|
const sortItems = ['AZ', 'sortByNumber'].map(g => ({ id: g, identifier: g }));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -121,17 +121,6 @@
|
|||||||
<h2 class="float-left mb-3">
|
<h2 class="float-left mb-3">
|
||||||
{{ $t('classArmor') }}
|
{{ $t('classArmor') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="float-right">
|
|
||||||
<span class="dropdown-label">{{ $t('sortBy') }}</span>
|
|
||||||
<select-translated-array
|
|
||||||
:right="true"
|
|
||||||
:value="selectedSortItemsBy"
|
|
||||||
:items="sortItemsBy"
|
|
||||||
:inline-dropdown="false"
|
|
||||||
class="inline"
|
|
||||||
@select="selectedSortItemsBy = $event"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="(groupSets, categoryGroup) in getGroupedCategories(categories)"
|
v-for="(groupSets, categoryGroup) in getGroupedCategories(categories)"
|
||||||
@@ -160,7 +149,7 @@
|
|||||||
<div class="items">
|
<div class="items">
|
||||||
<!-- eslint-disable max-len -->
|
<!-- eslint-disable max-len -->
|
||||||
<shopItem
|
<shopItem
|
||||||
v-for="item in seasonalItems(category, selectedSortItemsBy, searchTextThrottled, viewOptions, hidePinned)"
|
v-for="item in seasonalItems(category, 'AZ', searchTextThrottled, viewOptions, hidePinned)"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
:item="item"
|
:item="item"
|
||||||
:price="item.value"
|
:price="item.value"
|
||||||
@@ -353,15 +342,11 @@ import svgWizard from '@/assets/svg/wizard.svg';
|
|||||||
import svgRogue from '@/assets/svg/rogue.svg';
|
import svgRogue from '@/assets/svg/rogue.svg';
|
||||||
import svgHealer from '@/assets/svg/healer.svg';
|
import svgHealer from '@/assets/svg/healer.svg';
|
||||||
|
|
||||||
import SelectTranslatedArray from '@/components/tasks/modal-controls/selectTranslatedArray';
|
|
||||||
import FilterSidebar from '@/components/ui/filterSidebar';
|
import FilterSidebar from '@/components/ui/filterSidebar';
|
||||||
import FilterGroup from '@/components/ui/filterGroup';
|
|
||||||
import { worldStateMixin } from '@/mixins/worldState';
|
import { worldStateMixin } from '@/mixins/worldState';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SelectTranslatedArray,
|
|
||||||
FilterGroup,
|
|
||||||
FilterSidebar,
|
FilterSidebar,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
PinBadge,
|
PinBadge,
|
||||||
@@ -393,9 +378,6 @@ export default {
|
|||||||
eyewear: i18n.t('eyewear'),
|
eyewear: i18n.t('eyewear'),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
sortItemsBy: ['AZ'],
|
|
||||||
selectedSortItemsBy: 'AZ',
|
|
||||||
|
|
||||||
hidePinned: false,
|
hidePinned: false,
|
||||||
featuredGearBought: false,
|
featuredGearBought: false,
|
||||||
currentEvent: null,
|
currentEvent: null,
|
||||||
|
|||||||
@@ -113,34 +113,7 @@
|
|||||||
:price-type="ctx.item.currency"
|
:price-type="ctx.item.currency"
|
||||||
:empty-item="false"
|
:empty-item="false"
|
||||||
@click="selectItemToBuy(ctx.item)"
|
@click="selectItemToBuy(ctx.item)"
|
||||||
>
|
/>
|
||||||
<span
|
|
||||||
v-if="category !== 'quests'"
|
|
||||||
slot="popoverContent"
|
|
||||||
slot-scope="ctx"
|
|
||||||
><div><h4 class="popover-content-title">{{ ctx.item.text }}</h4></div></span>
|
|
||||||
<span
|
|
||||||
v-if="category === 'quests'"
|
|
||||||
slot="popoverContent"
|
|
||||||
><div class="questPopover">
|
|
||||||
<h4 class="popover-content-title">{{ item.text }}</h4>
|
|
||||||
<questInfo :quest="item" />
|
|
||||||
</div></span>
|
|
||||||
<template
|
|
||||||
slot="itemBadge"
|
|
||||||
slot-scope="ctx"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
v-if="ctx.item.pinType !== 'IGNORE'"
|
|
||||||
class="badge-top"
|
|
||||||
@click.prevent.stop="togglePinned(ctx.item)"
|
|
||||||
>
|
|
||||||
<pin-badge
|
|
||||||
:pinned="ctx.item.pinned"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</shopItem>
|
|
||||||
</template>
|
</template>
|
||||||
</itemRows>
|
</itemRows>
|
||||||
</div>
|
</div>
|
||||||
@@ -184,8 +157,6 @@ import { mapState } from '@/libs/store';
|
|||||||
import ShopItem from '../shopItem';
|
import ShopItem from '../shopItem';
|
||||||
import Item from '@/components/inventory/item';
|
import Item from '@/components/inventory/item';
|
||||||
import ItemRows from '@/components/ui/itemRows';
|
import ItemRows from '@/components/ui/itemRows';
|
||||||
import QuestInfo from '../quests/questInfo.vue';
|
|
||||||
import PinBadge from '@/components/ui/pinBadge';
|
|
||||||
import toggleSwitch from '@/components/ui/toggleSwitch';
|
import toggleSwitch from '@/components/ui/toggleSwitch';
|
||||||
|
|
||||||
import BuyQuestModal from '../quests/buyQuestModal.vue';
|
import BuyQuestModal from '../quests/buyQuestModal.vue';
|
||||||
@@ -207,9 +178,7 @@ export default {
|
|||||||
ShopItem,
|
ShopItem,
|
||||||
Item,
|
Item,
|
||||||
ItemRows,
|
ItemRows,
|
||||||
PinBadge,
|
|
||||||
toggleSwitch,
|
toggleSwitch,
|
||||||
QuestInfo,
|
|
||||||
|
|
||||||
BuyQuestModal,
|
BuyQuestModal,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
:hide-icon="false"
|
:hide-icon="false"
|
||||||
:inline-dropdown="inlineDropdown"
|
:inline-dropdown="inlineDropdown"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
:direct-select="true"
|
||||||
@select="selectItem($event)"
|
@select="selectItem($event)"
|
||||||
>
|
>
|
||||||
<template #item="{ item }">
|
<template #item="{ item }">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
:right="true"
|
:right="true"
|
||||||
:hide-icon="false"
|
:hide-icon="false"
|
||||||
:inline-dropdown="false"
|
:inline-dropdown="false"
|
||||||
|
:direct-select="directSelect"
|
||||||
@select="selectItem($event)"
|
@select="selectItem($event)"
|
||||||
>
|
>
|
||||||
<template #item="{ item }">
|
<template #item="{ item }">
|
||||||
@@ -35,6 +36,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
directSelect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -104,6 +104,10 @@ export default {
|
|||||||
activeKeyProp: {
|
activeKeyProp: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
directSelect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
disabledProp: {
|
disabledProp: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
@@ -132,13 +136,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getKeyProp (item) {
|
getKeyProp (item) {
|
||||||
return this.keyProp ? item[this.keyProp] : item.key;
|
return this.keyProp ? item[this.keyProp] : item.key || item.identifier;
|
||||||
},
|
},
|
||||||
isDisabled (item) {
|
isDisabled (item) {
|
||||||
return typeof item[this.disabledProp] === 'undefined' ? false : item[this.disabledProp];
|
return typeof item[this.disabledProp] === 'undefined' ? false : item[this.disabledProp];
|
||||||
},
|
},
|
||||||
selectItem (item) {
|
selectItem (item) {
|
||||||
this.selected = this.getKeyProp(item);
|
if (this.directSelect) {
|
||||||
|
this.selected = item;
|
||||||
|
} else {
|
||||||
|
this.selected = this.getKeyProp(item);
|
||||||
|
}
|
||||||
this.$emit('select', item);
|
this.$emit('select', item);
|
||||||
},
|
},
|
||||||
isSelected (item) {
|
isSelected (item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user