@lancom/shared 0.0.189 → 0.0.190

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.
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <span>
3
+ {{ price | priceWithTax(pricingSettings) }}
4
+ </span>
5
+ </template>
6
+
7
+ <script>
8
+ import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
9
+ import { mapGetters } from 'vuex';
10
+
11
+ export default {
12
+ name: 'Price',
13
+ filters: {
14
+ priceWithTax
15
+ },
16
+ props: {
17
+ price: {
18
+ type: Number
19
+ }
20
+ },
21
+ computed: {
22
+ ...mapGetters(['pricingSettings'])
23
+ }
24
+ };
25
+ </script>
26
+
@@ -5,9 +5,10 @@
5
5
  }
6
6
  ::v-deep .slick-arrow {
7
7
  position: absolute;
8
+ color: white;
8
9
  top: 50%;
9
- background-color: $black;
10
- background-image: url(../../../static/icons/arrow-left.svg);
10
+ background-color: $gray;
11
+ background-image: url(../../../static/icons/arrow-right.svg);
11
12
  background-position: center;
12
13
  background-repeat: no-repeat;
13
14
  background-size: 25px 25px;
@@ -105,6 +106,12 @@
105
106
  font-size: 18px;
106
107
  color: $gray_main;
107
108
  margin-top: 4px;
109
+ &-info {
110
+ font-size: 14px;
111
+ margin-top: 5px;
112
+ color: $gray_main;
113
+ font-style: italic;
114
+ }
108
115
  }
109
116
  }
110
117
  }
@@ -38,7 +38,10 @@
38
38
  <div
39
39
  v-if="image.print.pricing"
40
40
  class="Gallery__big-print-price">
41
- {{ image.print.pricing.price | price }} for ({{ image.print.pricing.min || 1 }}+)
41
+ Printing at <price :price="image.print.pricing.price" /> for ({{ image.print.pricingMin.min || 1 }}+)
42
+ </div>
43
+ <div class="Gallery__big-print-price-info">
44
+ example only
42
45
  </div>
43
46
  </div>
44
47
  </div>
@@ -100,16 +103,15 @@
100
103
  import { mapGetters, mapActions } from 'vuex';
101
104
  import VueSlickCarousel from 'vue-slick-carousel';
102
105
  import 'vue-slick-carousel/dist/vue-slick-carousel.css';
103
- import { staticLink, price } from '@lancom/shared/assets/js/utils/filters';
106
+ import { staticLink } from '@lancom/shared/assets/js/utils/filters';
104
107
  import { isValidImageTypes } from '@lancom/shared/assets/js/utils/colors';
108
+ import Price from '@lancom/shared/components/common/price';
105
109
 
106
110
  export default {
107
111
  name: 'Gallery',
108
- filters: {
109
- price
110
- },
111
112
  components: {
112
- VueSlickCarousel
113
+ VueSlickCarousel,
114
+ Price
113
115
  },
114
116
  props: {
115
117
  slidesPerRow: {
@@ -152,11 +154,15 @@ export default {
152
154
  const images = this.filterType ? this.images.filter(i => this.isValidImageByFilter(this.filterType, i)) : this.images;
153
155
  return images.map(image => {
154
156
  const printType = this.product?.printTypes.find(({ _id }) => _id === image.printType);
155
- const { printCost } = printType?.printAreas.find(({ printSizes }) => (printSizes || []).some(({ _id }) => _id === image.printSize)) || printType?.printAreas[0] || { printCost: [] };
157
+ const printArea = printType?.printAreas.find(({ printSizes }) => (printSizes || []).some(({ _id }) => _id === image.printSize)) || printType?.printAreas[0] || { printCost: [] };
158
+ const { printCost, printSizes } = printArea;
159
+ const printSize = (printSizes || []).find(({ _id }) => _id === image.printSize);
156
160
  const pricing = printCost[printCost.length - 1];
161
+ const pricingMin = printCost[0];
157
162
  const print = printType && {
158
- name: printType.name,
159
- pricing
163
+ name: printSize ? `${printType.name} (${printSize.name})` : printType.name,
164
+ pricing,
165
+ pricingMin
160
166
  };
161
167
  const color = this.availableColors.find(({ _id }) => _id === image.color);
162
168
  return { ...image, print, colorName: color?.name };
@@ -5,7 +5,7 @@ import { generateProductLink } from '@lancom/shared/assets/js/utils/product';
5
5
  const getBgStyle = img => img && ({ 'background-image': `url("${img}")` });
6
6
 
7
7
  const loadHolder = {
8
- canLoadImages: false,
8
+ canLoadImages: true,
9
9
  canLoadColorImages: false,
10
10
  canLoadBackImages: false
11
11
  };
@@ -84,10 +84,8 @@ const productPreview = {
84
84
  }
85
85
  },
86
86
  mounted() {
87
+ this.loadHolder.canLoadImages = true;
87
88
  if (process.client) {
88
- setTimeout(() => {
89
- this.loadHolder.canLoadImages = true;
90
- }, 0);
91
89
  setTimeout(() => {
92
90
  this.loadHolder.canLoadBackImages = true;
93
91
  this.loadHolder.canLoadColorImages = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.189",
3
+ "version": "0.0.190",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
@@ -1,3 +1,3 @@
1
- <svg width="14" height="23" viewBox="0 0 14 23" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="14" height="23" viewBox="0 0 14 23" fill="white" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M12.6963 20.7394L3.64439 11.6999L12.6974 2.66034C13.1289 2.22936 13.1289 1.5322 12.6974 1.10122C12.2659 0.671337 11.5669 0.671337 11.1354 1.10122L1.30249 10.9198C0.871025 11.3497 0.871025 12.0479 1.30249 12.4778L11.1353 22.2964C11.5668 22.7263 12.2669 22.7263 12.6984 22.2964C13.1278 21.8676 13.1278 21.1693 12.6963 20.7394Z" fill="#343750"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="26" height="26" viewBox="0 0 26 26" fill="white" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M7.30369 4.26051L16.3556 13.3L7.3026 22.3395C6.87114 22.7705 6.87114 23.4677 7.3026 23.8987C7.73406 24.3285 8.4331 24.3285 8.86457 23.8987L18.6975 14.0801C19.129 13.6502 19.129 12.9519 18.6975 12.5221L8.86466 2.70349C8.43319 2.2736 7.73306 2.2736 7.3016 2.70349C6.87223 3.13228 6.87223 3.83062 7.30369 4.26051Z" fill="#343750"/>
3
3
  </svg>