@lancom/shared 0.0.430 → 0.0.432
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/assets/js/api/index.js +2 -2
- package/assets/js/constants/product.js +14 -0
- package/assets/scss/_common.scss +9 -1
- package/assets/scss/variables/_breakpoints.scss +2 -0
- package/components/common/breadcrumbs/breadcrumbs.scss +4 -1
- package/components/common/breadcrumbs/breadcrumbs.vue +4 -1
- package/components/common/client_settings/client-settings.vue +2 -3
- package/components/common/client_settings_tax/client-settings-tax.vue +1 -0
- package/components/common/price.vue +1 -2
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +28 -5
- package/components/common/product_side_with_print/product-side-with-print.vue +3 -3
- package/components/common/stars-mark.vue +21 -9
- package/components/common/tabs.vue +17 -3
- package/components/editor/editor_colors/editor-colors.scss +79 -0
- package/components/editor/editor_colors/editor-colors.vue +90 -0
- package/components/editor/editor_layers/editor-layers.vue +11 -6
- package/components/editor/editor_workspace/editor-workspace.vue +17 -15
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +2 -9
- package/components/product/add-to-cart-btn.vue +13 -3
- package/components/product/editor_pricing/editor-pricing.vue +5 -3
- package/components/product/other_products/other-products.scss +34 -0
- package/components/product/other_products/other-products.vue +76 -0
- package/components/product/other_products/other_product/other-product.scss +80 -0
- package/components/product/other_products/other_product/other-product.vue +59 -0
- package/components/product/product.vue +0 -14
- package/components/product/product_check_delivery/product-check-delivery.scss +31 -0
- package/components/product/product_check_delivery/product-check-delivery.vue +73 -0
- package/components/product/product_colors_selector/product-colors-selector.scss +14 -2
- package/components/product/product_colors_selector/product-colors-selector.vue +11 -2
- package/components/product/product_pricing_tiers/product-pricing-tiers.scss +53 -0
- package/components/product/product_pricing_tiers/product-pricing-tiers.vue +40 -0
- package/components/product/product_reviews/product-reviews.vue +6 -6
- package/components/product/product_stock_status/product-stock-status.scss +28 -0
- package/components/product/product_stock_status/product-stock-status.vue +35 -0
- package/components/product/related_products/related-products.vue +4 -4
- package/components/products/products_attributes/products_attribute/products-attribute.vue +19 -18
- package/components/products/products_brands/products-brands.vue +3 -1
- package/components/products/products_filters/products-filters.vue +9 -1
- package/components/products/products_tags/products-tags.vue +19 -18
- package/components/products/products_types/products-types.scss +1 -1
- package/layouts/products.vue +153 -432
- package/mixins/layouts/products.js +285 -0
- package/mixins/product-preview.js +14 -0
- package/package.json +1 -1
- package/plugins/save-state.js +3 -2
- package/store/index.js +2 -0
- package/store/product.js +50 -12
- package/components/the_breadcrumbs/the-breadcrumbs.scss +0 -36
- package/components/the_breadcrumbs/the-breadcrumbs.vue +0 -78
package/assets/js/api/index.js
CHANGED
|
@@ -134,8 +134,8 @@ const api = {
|
|
|
134
134
|
calculateProductPrice(data, shop) {
|
|
135
135
|
return _post(`shop/${shop}/order/calculate-price`, data);
|
|
136
136
|
},
|
|
137
|
-
fetchFAQ(shop) {
|
|
138
|
-
return _get(`shop/${shop}/faq
|
|
137
|
+
fetchFAQ(shop, params) {
|
|
138
|
+
return _get(`shop/${shop}/faq`, params);
|
|
139
139
|
},
|
|
140
140
|
contactUs(data, shop) {
|
|
141
141
|
return _post(`shop/${shop}/contact`, data);
|
|
@@ -9,3 +9,17 @@ export const PRODUCT_TYPES_LIST = [
|
|
|
9
9
|
{ type: PRODUCT_TYPES.HOODIE, label: 'Pullover Hoodie' },
|
|
10
10
|
{ type: PRODUCT_TYPES.POLO, label: 'Classic Polo' }
|
|
11
11
|
];
|
|
12
|
+
|
|
13
|
+
export const PRODUCT_STOCK_STATUS = {
|
|
14
|
+
ALL_IN_STOCK: 'all in stock',
|
|
15
|
+
MOSTLY_IN_STOCK: 'mostly in stock',
|
|
16
|
+
PARTIALLY_IN_STOCK: 'partially in stock',
|
|
17
|
+
NOT_IN_STOCK: 'not in stock'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const PRODUCT_STOCK_STATUS_COLORS = {
|
|
21
|
+
[PRODUCT_STOCK_STATUS.ALL_IN_STOCK]: 'green',
|
|
22
|
+
[PRODUCT_STOCK_STATUS.MOSTLY_IN_STOCK]: 'orange',
|
|
23
|
+
[PRODUCT_STOCK_STATUS.PARTIALLY_IN_STOCK]: 'orange',
|
|
24
|
+
[PRODUCT_STOCK_STATUS.NOT_IN_STOCK]: 'red'
|
|
25
|
+
};
|
package/assets/scss/_common.scss
CHANGED
|
@@ -57,6 +57,14 @@ body {
|
|
|
57
57
|
max-width: 1440px;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
&.ultra {
|
|
61
|
+
@media (min-width: $bp-extra-large-min) {
|
|
62
|
+
max-width: 1440px;
|
|
63
|
+
}
|
|
64
|
+
@media (min-width: $bp-ultra-large-min) {
|
|
65
|
+
max-width: 1920px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
60
68
|
&.full {
|
|
61
69
|
max-width: none;
|
|
62
70
|
}
|
|
@@ -78,7 +86,7 @@ body {
|
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
.ripple {
|
|
81
|
-
// ripple
|
|
89
|
+
// ripple
|
|
82
90
|
position: relative;
|
|
83
91
|
overflow: hidden;
|
|
84
92
|
transform: translate3d(0, 0, 0);
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
<div
|
|
16
16
|
v-for="(item, index) in items"
|
|
17
17
|
:key="index"
|
|
18
|
-
class="Breadcrumbs__item-wrapper"
|
|
18
|
+
class="Breadcrumbs__item-wrapper"
|
|
19
|
+
:class="{
|
|
20
|
+
'Breadcrumbs__item-last': index === (items.length - 1)
|
|
21
|
+
}">
|
|
19
22
|
<a
|
|
20
23
|
v-if="item.to"
|
|
21
24
|
class="Breadcrumbs__item"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
</template>
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
<script>
|
|
78
78
|
import { mapGetters } from 'vuex';
|
|
79
79
|
import { staticLink } from '@lancom/shared/assets/js/utils/filters';
|
|
@@ -133,8 +133,7 @@ export default {
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
</script>
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
<style lang="scss">
|
|
138
138
|
@import 'client-settings';
|
|
139
139
|
</style>
|
|
140
|
-
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<table
|
|
3
|
-
class="lc_table"
|
|
3
|
+
class="lc_table PricingDiscountsTable__wrapper"
|
|
4
4
|
:class="{ bordered, striped }">
|
|
5
5
|
<thead class="centered">
|
|
6
6
|
<tr class="highlighted">
|
|
7
|
-
<th>
|
|
8
|
-
<th>
|
|
7
|
+
<th>{{ itemsLabel }}</th>
|
|
8
|
+
<th>{{ priceLabel }}</th>
|
|
9
|
+
<th v-if="visibleDiscount"></th>
|
|
9
10
|
</tr>
|
|
10
11
|
</thead>
|
|
11
12
|
<tbody class="centered">
|
|
12
13
|
<tr
|
|
13
|
-
v-for="range in prices"
|
|
14
|
+
v-for="(range, index) in prices"
|
|
14
15
|
:key="range.min"
|
|
15
16
|
:class="{
|
|
16
17
|
active: amount >= range.min && ((range.max && amount <= range.max) || !range.max)
|
|
@@ -32,6 +33,13 @@
|
|
|
32
33
|
{{ range.price | price(currency) }}
|
|
33
34
|
</span>
|
|
34
35
|
</td>
|
|
36
|
+
<td
|
|
37
|
+
v-if="visibleDiscount"
|
|
38
|
+
class="PricingDiscountsTable__discount">
|
|
39
|
+
<span v-if="index > 0 && range.price && maxPrice">
|
|
40
|
+
-{{ (100 - (range.price / maxPrice) * 100).toFixed(2) }}%
|
|
41
|
+
</span>
|
|
42
|
+
</td>
|
|
35
43
|
</tr>
|
|
36
44
|
</tbody>
|
|
37
45
|
</table>
|
|
@@ -67,12 +75,27 @@ export default {
|
|
|
67
75
|
withGst: {
|
|
68
76
|
type: Boolean,
|
|
69
77
|
default: true
|
|
78
|
+
},
|
|
79
|
+
visibleDiscount: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
itemsLabel: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: 'Items'
|
|
86
|
+
},
|
|
87
|
+
priceLabel: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'Price'
|
|
70
90
|
}
|
|
71
91
|
},
|
|
72
92
|
computed: {
|
|
73
93
|
...mapGetters([
|
|
74
94
|
'pricingSettings'
|
|
75
|
-
])
|
|
95
|
+
]),
|
|
96
|
+
maxPrice() {
|
|
97
|
+
return this.prices?.[0]?.price || 0;
|
|
98
|
+
}
|
|
76
99
|
}
|
|
77
100
|
};
|
|
78
101
|
</script>
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
|
-
import { getProductCover, getColorImage } from '@lancom/shared/assets/js/utils/colors';
|
|
20
|
+
import { getProductCover, getColorImage, getColorBackgroundStyle } from '@lancom/shared/assets/js/utils/colors';
|
|
21
21
|
import ImageViewer from '@lancom/shared/components/common/image_viewer/image-viewer';
|
|
22
|
-
import { getColorBackgroundStyle } from '@lancom/shared/assets/js/utils/colors';
|
|
23
22
|
|
|
24
23
|
export default {
|
|
25
24
|
name: 'ProductSideWithPrint',
|
|
@@ -80,7 +79,8 @@ export default {
|
|
|
80
79
|
return [...this.priviewProducts.reduce(predicate, new Map()).values()];
|
|
81
80
|
},
|
|
82
81
|
colorBackground() {
|
|
83
|
-
|
|
82
|
+
const color = this.color || this.product.color;
|
|
83
|
+
return this.fillBackground && getColorBackgroundStyle(color, false, this.originBackground);
|
|
84
84
|
},
|
|
85
85
|
imageBackground() {
|
|
86
86
|
return this.image && this.getImageBackground(this.image);
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
ref="mark"
|
|
4
4
|
class="StarsMark__wrapper"
|
|
5
5
|
:class="{ disabled }"
|
|
6
|
+
:style="starStyle"
|
|
6
7
|
@mouseenter="onMouseenter"
|
|
7
8
|
@mousemove="onMousemove"
|
|
8
9
|
@mouseleave="onMouseleave"
|
|
9
10
|
@click="onSelect">
|
|
10
11
|
<div
|
|
11
|
-
:style="
|
|
12
|
+
:style="starValueStyle"
|
|
12
13
|
class="StarsMark__value"></div>
|
|
13
14
|
</div>
|
|
14
15
|
</template>
|
|
@@ -22,6 +23,10 @@ export default {
|
|
|
22
23
|
value: {
|
|
23
24
|
type: Number
|
|
24
25
|
},
|
|
26
|
+
size: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: STAR_WIDTH
|
|
29
|
+
},
|
|
25
30
|
disabled: {
|
|
26
31
|
type: Boolean,
|
|
27
32
|
default: false
|
|
@@ -42,8 +47,18 @@ export default {
|
|
|
42
47
|
this.$emit('input', val);
|
|
43
48
|
}
|
|
44
49
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
50
|
+
starStyle() {
|
|
51
|
+
return {
|
|
52
|
+
width: `${this.size * 5}px`,
|
|
53
|
+
height: `${this.size}px`,
|
|
54
|
+
'background-size': `${this.size}px ${this.size}px`
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
starValueStyle() {
|
|
58
|
+
return {
|
|
59
|
+
...this.starStyle,
|
|
60
|
+
width: `${(this.hoverValue || this.model) * this.size}px`
|
|
61
|
+
};
|
|
47
62
|
}
|
|
48
63
|
},
|
|
49
64
|
methods: {
|
|
@@ -65,7 +80,7 @@ export default {
|
|
|
65
80
|
getMarkFromEvent(e) {
|
|
66
81
|
const markWrapperRect = this.$refs.mark.getBoundingClientRect();
|
|
67
82
|
const x = e.clientX - markWrapperRect.left;
|
|
68
|
-
return Math.max(1, Math.min(5, Number.parseInt(x /
|
|
83
|
+
return Math.max(1, Math.min(5, Number.parseInt(x / this.size) + 1));
|
|
69
84
|
}
|
|
70
85
|
}
|
|
71
86
|
};
|
|
@@ -80,18 +95,15 @@ export default {
|
|
|
80
95
|
}
|
|
81
96
|
&__wrapper,
|
|
82
97
|
&__value {
|
|
83
|
-
height: 24px;
|
|
84
98
|
background-position: top left;
|
|
85
99
|
background-repeat: repeat-x;
|
|
86
|
-
background-size: 24px 24px;
|
|
87
100
|
cursor: pointer;
|
|
88
101
|
}
|
|
89
102
|
&__wrapper {
|
|
90
|
-
|
|
91
|
-
background-image: url(./../../static/icons/star_gray.svg);
|
|
103
|
+
background-image: url(~/static/icons/star_gray.svg);
|
|
92
104
|
}
|
|
93
105
|
&__value {
|
|
94
|
-
background-image: url(
|
|
106
|
+
background-image: url(~/static/icons/star_active.svg);
|
|
95
107
|
pointer-events: none;
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
class="tab ripple"
|
|
8
8
|
:class="{
|
|
9
9
|
active: currentTab === tab.value,
|
|
10
|
+
disabled: tab.disabled,
|
|
11
|
+
short: tab.short,
|
|
10
12
|
shadow: btnsShadow
|
|
11
13
|
}"
|
|
12
14
|
@click="select(tab)">
|
|
@@ -19,9 +21,8 @@
|
|
|
19
21
|
</div>
|
|
20
22
|
<div
|
|
21
23
|
v-if="tab.description"
|
|
22
|
-
class="tab-description lc_regular12 lc_grey1 mt-5"
|
|
23
|
-
|
|
24
|
-
</div>
|
|
24
|
+
class="tab-description lc_regular12 lc_grey1 mt-5"
|
|
25
|
+
v-html="tab.description"></div>
|
|
25
26
|
</div>
|
|
26
27
|
</div>
|
|
27
28
|
<slot :current-tab="currentTab"></slot>
|
|
@@ -174,6 +175,19 @@ export default {
|
|
|
174
175
|
background-color: $grey_4;
|
|
175
176
|
color: $black;
|
|
176
177
|
}
|
|
178
|
+
&s--large &.disabled,
|
|
179
|
+
&s--primary &.disabled,
|
|
180
|
+
&s--secondary &.disabled {
|
|
181
|
+
pointer-events: none;
|
|
182
|
+
}
|
|
183
|
+
&s--large &.short,
|
|
184
|
+
&s--primary &.short,
|
|
185
|
+
&s--secondary &.short {
|
|
186
|
+
width: auto;
|
|
187
|
+
min-width: 41px;
|
|
188
|
+
flex: 0 0 0 !important;
|
|
189
|
+
padding: 0;
|
|
190
|
+
}
|
|
177
191
|
&.shadow {
|
|
178
192
|
box-shadow: 1px 1px 2px rgb(214, 214, 214);
|
|
179
193
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.EditorColors {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
&__colors {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
position: relative;
|
|
10
|
+
margin: 20px 0;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: 24px;
|
|
14
|
+
}
|
|
15
|
+
&__color {
|
|
16
|
+
width: 114px;
|
|
17
|
+
height: 142px;
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
border: #EFEFEF;
|
|
20
|
+
background: #EFEFEF;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
padding: 2px;
|
|
23
|
+
&-image {
|
|
24
|
+
width: 110px;
|
|
25
|
+
height: 106px;
|
|
26
|
+
margin: 0px;
|
|
27
|
+
border-radius: 12px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
&-name {
|
|
31
|
+
display: flex;
|
|
32
|
+
padding: 4px 10px;
|
|
33
|
+
text-align: center;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
margin-top: 2px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&__divider {
|
|
41
|
+
height: 1px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
background-color: $gray;
|
|
44
|
+
margin-top: 20px;
|
|
45
|
+
}
|
|
46
|
+
&__arrow {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 50%;
|
|
49
|
+
border-radius: 8px;
|
|
50
|
+
background: #EFEFEF !important;
|
|
51
|
+
color: black !important;
|
|
52
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
53
|
+
width: 24px;
|
|
54
|
+
height: 24px;
|
|
55
|
+
margin-top: -12px;
|
|
56
|
+
padding: 0;
|
|
57
|
+
border: none;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
z-index: 2;
|
|
60
|
+
i {
|
|
61
|
+
font-size: 15px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--left {
|
|
65
|
+
left: 0;
|
|
66
|
+
transform: rotate(90deg);
|
|
67
|
+
}
|
|
68
|
+
&--right {
|
|
69
|
+
right: 0;
|
|
70
|
+
transform: rotate(270deg);
|
|
71
|
+
}
|
|
72
|
+
&:hover {
|
|
73
|
+
box-shadow: 0 0 3px $grey_2;
|
|
74
|
+
}
|
|
75
|
+
&:focus {
|
|
76
|
+
outline: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorColors__wrapper">
|
|
3
|
+
<div class="EditorColors__colors">
|
|
4
|
+
<div
|
|
5
|
+
v-for="color in visibleColors"
|
|
6
|
+
:key="color._id"
|
|
7
|
+
v-tooltip="color.name"
|
|
8
|
+
class="EditorColors__color"
|
|
9
|
+
:class="{ 'EditorColors__color-active': editableColor === color }"
|
|
10
|
+
@click="toggleSelection(color)">
|
|
11
|
+
<product-side-with-print
|
|
12
|
+
:product="product"
|
|
13
|
+
:side="editableSide.id"
|
|
14
|
+
:color="color"
|
|
15
|
+
:fill-background="true"
|
|
16
|
+
:default-preview="false"
|
|
17
|
+
class="EditorColors__color-image">
|
|
18
|
+
</product-side-with-print>
|
|
19
|
+
<div class="EditorColors__color-name">
|
|
20
|
+
<span>{{ color.name || '' }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<button
|
|
24
|
+
v-if="hasThumbsArrows"
|
|
25
|
+
type="button"
|
|
26
|
+
class="EditorColors__arrow EditorColors__arrow--left"
|
|
27
|
+
@click="goToPrevPage()">
|
|
28
|
+
<i class="icon-angle-down"></i>
|
|
29
|
+
</button>
|
|
30
|
+
<button
|
|
31
|
+
v-if="hasThumbsArrows"
|
|
32
|
+
type="button"
|
|
33
|
+
class="EditorColors__arrow EditorColors__arrow--right"
|
|
34
|
+
@click="goToNextPage()">
|
|
35
|
+
<i class="icon-angle-down"></i>
|
|
36
|
+
</button>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import { mapGetters, mapActions } from 'vuex';
|
|
43
|
+
import ProductSideWithPrint from '@lancom/shared/components/common/product_side_with_print/product-side-with-print';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'EditorColors',
|
|
47
|
+
components: {
|
|
48
|
+
ProductSideWithPrint
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
slidesPerRow: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 6
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
thumbsPage: 0
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
...mapGetters('product', ['editableColor', 'availableColors', 'editableSide', 'product']),
|
|
63
|
+
visibleColorsFrom() {
|
|
64
|
+
return this.thumbsPage * this.slidesPerRow;
|
|
65
|
+
},
|
|
66
|
+
visibleColors() {
|
|
67
|
+
return this.availableColors.slice(this.visibleColorsFrom, this.visibleColorsFrom + this.slidesPerRow);
|
|
68
|
+
},
|
|
69
|
+
hasThumbsArrows() {
|
|
70
|
+
return this.availableColors.length > this.slidesPerRow;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
...mapActions('product', ['selectColor']),
|
|
75
|
+
toggleSelection({ _id }) {
|
|
76
|
+
this.selectColor(_id);
|
|
77
|
+
},
|
|
78
|
+
goToPrevPage() {
|
|
79
|
+
this.thumbsPage = Math.max(0, this.thumbsPage - 1);
|
|
80
|
+
},
|
|
81
|
+
goToNextPage() {
|
|
82
|
+
this.thumbsPage = Math.min(Math.ceil((this.availableColors.length) / this.slidesPerRow) - 1, this.thumbsPage + 1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style lang="scss" scoped>
|
|
89
|
+
@import 'editor-colors';
|
|
90
|
+
</style>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
class="EditorLayersGroup__header">
|
|
49
49
|
<div>
|
|
50
50
|
<h5 class="lc_h5">
|
|
51
|
-
|
|
51
|
+
{{ group | groupLabel }}
|
|
52
52
|
</h5>
|
|
53
53
|
<div class="lc_caption">{{ group.printArea.side }}</div>
|
|
54
54
|
</div>
|
|
@@ -101,23 +101,28 @@ const { mapGetters, mapActions, mapMutations } = createNamespacedHelpers('produc
|
|
|
101
101
|
|
|
102
102
|
export default {
|
|
103
103
|
name: 'EditorLayers',
|
|
104
|
+
filters: {
|
|
105
|
+
groupLabel(group) {
|
|
106
|
+
return `${group.printArea.name} | ${group.printArea.printSize?.name} (${group.layers.length})`;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
104
109
|
components: {
|
|
105
110
|
...EditorLayerForms,
|
|
106
111
|
EditorLayersLayer,
|
|
107
112
|
EditorLayersToolbar,
|
|
108
113
|
EditorPricing
|
|
109
114
|
},
|
|
110
|
-
data() {
|
|
111
|
-
return {
|
|
112
|
-
openedGroup: null
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
115
|
props: {
|
|
116
116
|
hasPricing: {
|
|
117
117
|
type: Boolean,
|
|
118
118
|
default: true
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
|
+
data() {
|
|
122
|
+
return {
|
|
123
|
+
openedGroup: null
|
|
124
|
+
};
|
|
125
|
+
},
|
|
121
126
|
computed: {
|
|
122
127
|
...mapGetters([
|
|
123
128
|
'product',
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:full-width="false"
|
|
16
16
|
@select="selectTab">
|
|
17
17
|
<template
|
|
18
|
-
|
|
18
|
+
#default="{ currentTab: side }">
|
|
19
19
|
<div class="EditorWorkspace__sides-container">
|
|
20
20
|
<div
|
|
21
21
|
v-if="side"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
</client-only>
|
|
98
98
|
</breakpoint>
|
|
99
99
|
<div
|
|
100
|
-
v-if="!isZoomIn"
|
|
100
|
+
v-if="!isZoomIn && visiblePrintAreaOptions"
|
|
101
101
|
class="EditorWorkspace__print-area-options"
|
|
102
102
|
:class="{
|
|
103
103
|
'EditorWorkspace__print-area-options--bottom': isZoomIn
|
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
<script>
|
|
121
121
|
import { createNamespacedHelpers } from 'vuex';
|
|
122
122
|
import EditorPrintAreaOptions from '@lancom/shared/components/editor/editor_print_area_options/editor-print-area-options';
|
|
123
|
-
import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
|
|
124
123
|
import Tabs from '@lancom/shared/components/common/tabs';
|
|
125
124
|
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
126
125
|
import EditorWorkspaceSide from './editor_workspace_side/editor-workspace-side';
|
|
@@ -133,9 +132,18 @@ export default {
|
|
|
133
132
|
Placeholder,
|
|
134
133
|
EditorWorkspaceSide,
|
|
135
134
|
EditorPrintAreaOptions,
|
|
136
|
-
EditorPricing,
|
|
137
135
|
Tabs
|
|
138
136
|
},
|
|
137
|
+
props: {
|
|
138
|
+
zoomPrintArea: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
visiblePrintAreaOptions: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
139
147
|
data() {
|
|
140
148
|
return {
|
|
141
149
|
size: null,
|
|
@@ -144,12 +152,6 @@ export default {
|
|
|
144
152
|
isRotating: false
|
|
145
153
|
};
|
|
146
154
|
},
|
|
147
|
-
props: {
|
|
148
|
-
zoomPrintArea: {
|
|
149
|
-
type: Boolean,
|
|
150
|
-
default: false
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
155
|
computed: {
|
|
154
156
|
...mapGetters([
|
|
155
157
|
'product',
|
|
@@ -167,7 +169,7 @@ export default {
|
|
|
167
169
|
const sides = [
|
|
168
170
|
{ label: 'Front', value: 'front' },
|
|
169
171
|
{ label: 'Back', value: 'back' }
|
|
170
|
-
]
|
|
172
|
+
];
|
|
171
173
|
const validSides = sides.filter(s => this.product.printAreas?.some(pa => pa.side === s.value));
|
|
172
174
|
return validSides[0] ? validSides : [sides[0]];
|
|
173
175
|
},
|
|
@@ -184,7 +186,7 @@ export default {
|
|
|
184
186
|
height: `${this.printAreaZoomSize.height}px`,
|
|
185
187
|
left: `${this.printAreaZoomSize.left}px`,
|
|
186
188
|
top: `${this.printAreaZoomSize.top}px`
|
|
187
|
-
}
|
|
189
|
+
};
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
return {};
|
|
@@ -210,7 +212,7 @@ export default {
|
|
|
210
212
|
height: newHeight,
|
|
211
213
|
left,
|
|
212
214
|
top
|
|
213
|
-
}
|
|
215
|
+
};
|
|
214
216
|
}
|
|
215
217
|
return null;
|
|
216
218
|
}
|
|
@@ -240,7 +242,7 @@ export default {
|
|
|
240
242
|
this.preloading = true;
|
|
241
243
|
const sides = ['back', 'front'];
|
|
242
244
|
for (const side of sides) {
|
|
243
|
-
await (new Promise(
|
|
245
|
+
await (new Promise(resolve => {
|
|
244
246
|
setTimeout(() => {
|
|
245
247
|
this.toggleSide(side);
|
|
246
248
|
resolve();
|
|
@@ -277,7 +279,7 @@ export default {
|
|
|
277
279
|
if (layer.printArea === paId) {
|
|
278
280
|
layer.printSize = printArea.printSize?._id;
|
|
279
281
|
}
|
|
280
|
-
})
|
|
282
|
+
});
|
|
281
283
|
}
|
|
282
284
|
this.setSelectedPrintArea({ sideId: this.editableSide.id, printArea: printArea?._id, parentPrintArea: printArea?.parentPrintArea, size });
|
|
283
285
|
},
|
|
@@ -191,6 +191,7 @@ export default {
|
|
|
191
191
|
'selectedLayer',
|
|
192
192
|
'selectedLayerCopy',
|
|
193
193
|
'editorSize',
|
|
194
|
+
'editorSizeBreakpoints',
|
|
194
195
|
'editModeSelectedLayer',
|
|
195
196
|
'offsetWarningVisible',
|
|
196
197
|
'showRecommendationToUseLargerImage',
|
|
@@ -333,15 +334,7 @@ export default {
|
|
|
333
334
|
this.saveLayersAsImageWithDebounce();
|
|
334
335
|
},
|
|
335
336
|
calcWorkspaceSize(skipZoom) {
|
|
336
|
-
|
|
337
|
-
mini: 350,
|
|
338
|
-
xs: 400,
|
|
339
|
-
sm: 580,
|
|
340
|
-
md: 430,
|
|
341
|
-
lg: 600,
|
|
342
|
-
xl: 720
|
|
343
|
-
};
|
|
344
|
-
return (!skipZoom && this.zoomSize) || sizes[this.breakpoints.is] || 430;
|
|
337
|
+
return (!skipZoom && this.zoomSize) || this.editorSizeBreakpoints[this.breakpoints.is] || 430;
|
|
345
338
|
},
|
|
346
339
|
handleWorkspaceSize() {
|
|
347
340
|
const size = this.calcWorkspaceSize();
|