Skip to content

Commit

Permalink
feat: update storefront-ui to 0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick committed May 3, 2022
1 parent 35b2f8c commit 7664b2d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/templates/project-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@shopware-pwa/nuxt-module": "latest",
"@storefront-ui/vue": "0.12.3",
"@storefront-ui/vue": "0.13.1",
"@vue/test-utils": "^1.3.0",
"@vuelidate/core": "^2.0.0-alpha.35",
"@vuelidate/validators": "^2.0.0-alpha.27",
Expand Down
2 changes: 1 addition & 1 deletion packages/default-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@shopware-pwa/cli": "1.4.0",
"@shopware-pwa/theme-base": "1.4.0",
"@storefront-ui/vue": "0.12.3",
"@storefront-ui/vue": "0.13.1",
"@vuelidate/core": "^2.0.0-alpha.35",
"@vuelidate/validators": "^2.0.0-alpha.27",
"dayjs": "^1.10.8",
Expand Down
21 changes: 1 addition & 20 deletions packages/default-theme/src/components/SwCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@
<div v-if="count">
<SfProperty
:name="$t('Total price')"
class="
sf-property--full-width sf-property--large
my-cart__total-price
"
class="sf-property--full-width sf-property--large my-cart__total-price"
>
<template #value>
<SfPrice
Expand Down Expand Up @@ -99,10 +96,6 @@ import { computed, onMounted, ref, watch } from "@vue/composition-api"
import SwImage from "@/components/atoms/SwImage.vue"
import { usePriceFilter } from "@/logic/usePriceFilter.js"
import { disableBodyScroll, clearAllBodyScrollLocks } from "body-scroll-lock"
import {
mapMobileObserver,
unMapMobileObserver,
} from "@storefront-ui/vue/src/utilities/mobile-observer"
export default {
name: "SwCart",
Expand Down Expand Up @@ -159,20 +152,8 @@ export default {
filterPrice: usePriceFilter(),
}
},
computed: {
...mapMobileObserver(),
},
beforeDestroy() {
unMapMobileObserver()
},
watch: {
isSidebarOpen(val) {
// until it's fixed in the storefront-ui we need to disable body scroll lock on mobile
if (this.isMobile) {
setTimeout(() => {
clearAllBodyScrollLocks()
}, 0)
}
if (!val) {
this.$nextTick(() => {
clearAllBodyScrollLocks()
Expand Down
17 changes: 7 additions & 10 deletions packages/default-theme/src/components/SwSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import { ref, reactive, onMounted, computed } from "@vue/composition-api"
import { getSearchPageUrl } from "@/helpers"
import { SfSearchBar } from "@storefront-ui/vue"
import { useProductQuickSearch } from "@shopware-pwa/composables"
import {
mapMobileObserver,
unMapMobileObserver,
} from "@storefront-ui/vue/src/utilities/mobile-observer"
import { debounce } from "@shopware-pwa/helpers"
const SwSuggestSearch = () => import("@/components/SwSuggestSearch.vue")
Expand All @@ -55,17 +51,21 @@ export default {
}
}, 300)
// TODO: reactive observer
const isMobile = ref(true)
onMounted(() => {
isMobile.value = window?.innerWidth < 768
})
return {
getProducts,
getTotal,
isSuggestBoxOpen,
typingQuery,
performSuggestSearch,
isMobile,
}
},
computed: {
...mapMobileObserver(),
},
watch: {
$route(to, from) {
this.isSuggestBoxOpen = false
Expand All @@ -76,9 +76,6 @@ export default {
}
},
},
beforeDestroy() {
unMapMobileObserver()
},
methods: {
performSearch() {
if (this.typingQuery.length > 0) {
Expand Down

0 comments on commit 7664b2d

Please sign in to comment.