@lancom/shared 0.0.107 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkout/cart/cart.mixin.js +8 -2
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +1 -1
- package/components/common/coupon_select/coupon-select.vue +12 -4
- package/components/common/postcode_select/postcode-select.vue +4 -3
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +0 -1
- package/components/products/products_autocomplete/products-autocomplete.vue +4 -0
- package/components/the_navbar/the-navbar.scss +5 -0
- package/components/the_navbar/the-navbar.vue +1 -2
- package/package.json +1 -1
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { mapGetters, mapActions, mapMutations } from 'vuex';
|
|
2
2
|
import confirmModal from '@lancom/shared/mixins/confirm';
|
|
3
|
+
import debounce from 'lodash.debounce';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
mixins: [
|
|
6
7
|
confirmModal
|
|
7
8
|
],
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
calculateCartPriceWithDebounce: debounce(this.calculateCartPrice, 300)
|
|
12
|
+
};
|
|
13
|
+
},
|
|
8
14
|
computed: {
|
|
9
15
|
...mapGetters(['shop']),
|
|
10
16
|
...mapGetters('auth', ['user']),
|
|
@@ -29,11 +35,11 @@ export default {
|
|
|
29
35
|
},
|
|
30
36
|
watch: {
|
|
31
37
|
entities() {
|
|
32
|
-
this.
|
|
38
|
+
this.calculateCartPriceWithDebounce({ shop: this.shop });
|
|
33
39
|
}
|
|
34
40
|
},
|
|
35
41
|
mounted() {
|
|
36
|
-
this.
|
|
42
|
+
this.calculateCartPriceWithDebounce({ shop: this.shop });
|
|
37
43
|
if (!this.suburb && this.user?.suburb) {
|
|
38
44
|
this.handleSuburbChange(this.user.suburb);
|
|
39
45
|
}
|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
const message = `Maximum value: ${this.simpleProduct.quantityStock}`;
|
|
83
83
|
this.showConfirmationModal(message);
|
|
84
84
|
}
|
|
85
|
-
this.
|
|
85
|
+
this.setSimpleProductAmount({
|
|
86
86
|
guid: this.simpleProduct.guid,
|
|
87
87
|
amount: this.formatAmount(value),
|
|
88
88
|
shop: this.shop
|
|
@@ -45,13 +45,15 @@
|
|
|
45
45
|
</span>
|
|
46
46
|
</validation-provider>
|
|
47
47
|
<div v-if="value">
|
|
48
|
-
<div
|
|
48
|
+
<div
|
|
49
|
+
v-if="isValidPricing"
|
|
50
|
+
class="lc_h4">
|
|
49
51
|
{{ value.value | price }} OFF
|
|
50
52
|
</div>
|
|
51
53
|
<div
|
|
52
|
-
v-
|
|
53
|
-
class="
|
|
54
|
-
Min Order
|
|
54
|
+
v-else
|
|
55
|
+
class="lc_caption form-help is-danger">
|
|
56
|
+
Invalid coupon: Min Order for Coupon: {{ value.minOrderValue | price }}
|
|
55
57
|
</div>
|
|
56
58
|
</div>
|
|
57
59
|
</div>
|
|
@@ -71,6 +73,9 @@ export default {
|
|
|
71
73
|
value: {
|
|
72
74
|
type: Object
|
|
73
75
|
},
|
|
76
|
+
pricing: {
|
|
77
|
+
type: Object
|
|
78
|
+
},
|
|
74
79
|
labelText: {
|
|
75
80
|
type: String,
|
|
76
81
|
default: 'Coupon'
|
|
@@ -85,6 +90,9 @@ export default {
|
|
|
85
90
|
},
|
|
86
91
|
computed: {
|
|
87
92
|
...mapGetters(['shop']),
|
|
93
|
+
isValidPricing() {
|
|
94
|
+
return !this.value.minOrderValue || this.pricing.coupon;
|
|
95
|
+
},
|
|
88
96
|
model: {
|
|
89
97
|
get() {
|
|
90
98
|
return this.value?.code;
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
127
127
|
set(option) {
|
|
128
128
|
this.selected = option;
|
|
129
129
|
this.$emit('input', option.value);
|
|
130
|
-
this.$emit('select', this.suburbs.find(({
|
|
130
|
+
this.$emit('select', this.suburbs.find(({ _id }) => _id === option._id));
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
},
|
|
@@ -149,10 +149,11 @@ export default {
|
|
|
149
149
|
this.options = [];
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
createOptionFromSuburb({ locality, state, postcode, city }) {
|
|
152
|
+
createOptionFromSuburb({ locality, state, postcode, city, _id }) {
|
|
153
153
|
return {
|
|
154
154
|
label: [locality || city, state, postcode].filter(i => !!i).join(', '),
|
|
155
|
-
value: postcode
|
|
155
|
+
value: postcode,
|
|
156
|
+
_id: _id
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
}
|
|
@@ -104,7 +104,6 @@ export default {
|
|
|
104
104
|
this.$emit('layer-added', { layer, toEditMode: true });
|
|
105
105
|
},
|
|
106
106
|
async handleUploaded({ url, size }) {
|
|
107
|
-
debugger
|
|
108
107
|
const layer = await this.createLayer({ type: 'art', url, size });
|
|
109
108
|
this.$emit('layer-added', { layer, toEditMode: false });
|
|
110
109
|
}
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
placeholder="Search products"
|
|
9
9
|
type="text"
|
|
10
10
|
class="form-field no-label tiny-placeholder labelless"
|
|
11
|
+
autocomplete="off"
|
|
12
|
+
autocorrect="off"
|
|
13
|
+
autocapitalize="off"
|
|
14
|
+
spellcheck="false"
|
|
11
15
|
@input="searchWithDebounce"
|
|
12
16
|
@focus="showResults"
|
|
13
17
|
@blur="hideResults" />
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
height: $mobile_navbar_height + $mobile_notification_bar_height;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
p {
|
|
24
|
+
margin: 0 !important;
|
|
25
|
+
padding: 0 !important;
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
&__notification {
|
|
25
29
|
background-color: $black;
|
|
@@ -30,6 +34,7 @@
|
|
|
30
34
|
&-close {
|
|
31
35
|
position: absolute;
|
|
32
36
|
right: 20px;
|
|
37
|
+
top: 10px;
|
|
33
38
|
cursor: pointer;
|
|
34
39
|
color: $black;
|
|
35
40
|
}
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
v-if="notificationBar.enabled"
|
|
10
10
|
class="TheNavbar__notification lc_regular12"
|
|
11
11
|
:style="{
|
|
12
|
-
'background-color': notificationBar.backgroundColor
|
|
13
|
-
color: notificationBar.textColor
|
|
12
|
+
'background-color': notificationBar.backgroundColor
|
|
14
13
|
}">
|
|
15
14
|
<span v-html="notificationBar.text"></span>
|
|
16
15
|
<span
|