|
@@ -1,14 +1,19 @@
|
|
|
<template lang="pug">
|
|
|
.product-selector
|
|
|
- modal(name="product-selector")
|
|
|
- .product-variant(v-for="variant in variants")
|
|
|
-
|
|
|
+ modal(name="product-selector" transition="nice-modal-fade" height="500")
|
|
|
+ input.variant-searcher(type="search" placeholder="Buscar una variante de producto")
|
|
|
+ .product-variants
|
|
|
+ product-variant(v-for="variant in variants" :key="variant.id" :data="variant")
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
+ import ProductVariant from '@/components/ProductVariant'
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ 'product-variant': ProductVariant
|
|
|
+ },
|
|
|
computed: mapGetters({
|
|
|
variants: 'getVariants'
|
|
|
}),
|
|
@@ -16,7 +21,11 @@
|
|
|
this.$store.watch(state => {
|
|
|
return state.products.selectedProduct
|
|
|
}, value => {
|
|
|
- this.$modal.show("product-selector")
|
|
|
+ if (value) {
|
|
|
+ this.$modal.show("product-selector")
|
|
|
+ } else {
|
|
|
+ this.$modal.hide("product-selector")
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -24,4 +33,19 @@
|
|
|
|
|
|
<style lang="sass">
|
|
|
.product-selector
|
|
|
+ .variant-searcher
|
|
|
+ width: calc(100% - 30px)
|
|
|
+ height: 35px
|
|
|
+ text-align: center
|
|
|
+ margin: 10px 15px
|
|
|
+ border-radius: 0
|
|
|
+ font:
|
|
|
+ size: 10pt
|
|
|
+ style: normal
|
|
|
+ weight: bold
|
|
|
+
|
|
|
+ .product-variants
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 70px);
|
|
|
+ overflow-y: auto;
|
|
|
</style>
|