@lancom/shared 0.0.105 → 0.0.106

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.
Files changed (103) hide show
  1. package/assets/js/models/print-area.js +8 -6
  2. package/assets/js/models/product-layers.js +3 -3
  3. package/assets/js/utils/fabric-helper.js +2 -4
  4. package/assets/js/utils/filters.js +7 -1
  5. package/assets/js/utils/prints.js +15 -4
  6. package/assets/js/utils/product.js +4 -4
  7. package/assets/scss/ui_kit/_table.scss +3 -0
  8. package/assets/scss/ui_kit/_typography.scss +6 -0
  9. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  10. package/components/common/color-picker.vue +6 -1
  11. package/components/common/file_uploader.vue +1 -1
  12. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  13. package/components/common/pricing_table/pricing-table.scss +1 -3
  14. package/components/common/pricing_table/pricing-table.vue +13 -4
  15. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  16. package/components/common/range/range.scss +23 -0
  17. package/components/common/range/range.vue +19 -0
  18. package/components/editor/editor.vue +3 -2
  19. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  20. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
  21. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  22. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  23. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  24. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  25. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  26. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  27. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  28. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  29. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  30. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  31. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  32. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  33. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
  34. package/components/modals/cart_modal/cart-modal.vue +1 -1
  35. package/components/modals/order_modal/order-modal.vue +5 -7
  36. package/components/modals/payment_modal/payment-modal.vue +1 -1
  37. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  38. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  39. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  40. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  41. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  42. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  43. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  44. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  45. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  46. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  47. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  48. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  49. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  50. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  51. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  52. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  53. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  54. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  55. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  56. package/components/product/gallery/gallery.scss +168 -0
  57. package/components/product/gallery/gallery.vue +252 -0
  58. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  59. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  60. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  61. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  62. package/components/product/product.vue +16 -5
  63. package/components/product/product_price_range/product-price-range.vue +20 -4
  64. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  65. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  66. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  67. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  68. package/components/product/related_products/related-products.scss +34 -0
  69. package/components/product/related_products/related-products.vue +52 -0
  70. package/components/products/product_list/product-list.scss +2 -1
  71. package/components/products/product_list_product/product-list-product.scss +44 -20
  72. package/components/products/product_list_product/product-list-product.vue +6 -4
  73. package/components/products/products_aside/products-aside.vue +29 -4
  74. package/components/products/products_brands/products-brands.vue +9 -2
  75. package/components/products/products_filters/products-filters.vue +10 -0
  76. package/components/products/products_tags/products-tags.vue +7 -0
  77. package/components/products/products_types/products-types.vue +6 -1
  78. package/mixins/product-preview.js +1 -1
  79. package/package.json +1 -1
  80. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  81. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  82. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  83. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  84. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  85. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  86. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  87. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  88. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  89. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  90. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  91. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  92. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  93. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  94. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  95. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  96. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  97. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  98. package/store/index.js +3 -1
  99. package/store/product.js +25 -14
  100. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  101. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  102. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  103. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -17,9 +17,9 @@ export const getProductPrintAreas = product => {
17
17
  if (!product) {
18
18
  return {};
19
19
  }
20
- const getSizesFromAreas = (areas, map) => (areas || []).reduce((list, { printSize, printAreaOffsets, sizes }) => {
21
- if (printSize) {
22
- list[printSize.alias] = { printSize, printAreaOffsets };
20
+ const getSizesFromAreas = (areas, map) => (areas || []).reduce((list, { printSize, printAreaOffsets, sizes, _id }) => {
21
+ if (_id && printSize) {
22
+ list[_id] = { printSize, printAreaOffsets };
23
23
  }
24
24
 
25
25
  if (sizes) {
@@ -32,10 +32,12 @@ export const getProductPrintAreas = product => {
32
32
  return getSizesFromAreas(product.printAreas);
33
33
  };
34
34
 
35
- export const getProductPrintsAreasPrices = product => {
35
+ export const getProductPrintsAreasPrices = (product, printType) => {
36
36
  const areas = getProductPrintAreas(product);
37
37
  Object.keys(areas).forEach(key => {
38
- areas[key] = areas[key].printArea?.pricing || [];
38
+ const { printSize } = areas[key];
39
+ const { printCost } = (printType?.printAreas || []).find(pa => pa.printSizes.some(({ _id }) => _id === printSize._id)) || {};
40
+ areas[key] = printCost || [];
39
41
  });
40
42
  return areas;
41
43
  };
@@ -43,7 +45,7 @@ export const getProductPrintsAreasPrices = product => {
43
45
  export const getPrintAreaByName = ({ printArea, editorWidth, editorHeight }, product) => {
44
46
  const printAreas = getProductPrintAreas(product);
45
47
  const { printSize, printAreaOffsets } = printAreas[printArea] || DEFAULT_PRINT_AREA;
46
- const pxPerCm = (editorWidth * product.productToImageRatio) / product.productWidthInCm;
48
+ const pxPerCm = (editorWidth * product.productToImageRatio) / (product.productWidthInCm || 60);
47
49
  const widthCm = printSize ? printSize.width : DEFAULT_PRINT_SIZE_CM;
48
50
  const heightCm = printSize ? printSize.height : DEFAULT_PRINT_SIZE_CM;
49
51
  let width = widthCm * pxPerCm;
@@ -82,9 +82,9 @@ export const getLayerModel = async ({ type, colorId, top, left, isEditMode, url,
82
82
  if (!type) {
83
83
  throw new Error('When creating a new layer, you must specify its type');
84
84
  }
85
- if (!colorId) {
86
- throw new Error('When creating a new layer, you must specify coresponding colorId');
87
- }
85
+ // if (!colorId) {
86
+ // throw new Error('When creating a new layer, you must specify coresponding colorId');
87
+ // }
88
88
  let layer;
89
89
  switch (type) {
90
90
  case 'text':
@@ -64,7 +64,6 @@ class Background {
64
64
  export default class FabricHelper {
65
65
  editor = null;
66
66
  background = null;
67
- printAreaName = 'a3';
68
67
  printAreaRect = null;
69
68
 
70
69
  constructor({ editor, background, size }) {
@@ -135,10 +134,9 @@ export default class FabricHelper {
135
134
  this.background.setImage(image);
136
135
  }
137
136
 
138
- setPrintArea(name, size, product) {
139
- this.printAreaName = name;
137
+ setPrintArea(printArea, size, product) {
140
138
  this.printAreaRect = getPrintAreaByName({
141
- name: this.printAreaName,
139
+ printArea: printArea?._id,
142
140
  editorWidth: size.width,
143
141
  editorHeight: size.height
144
142
  }, product);
@@ -18,6 +18,12 @@ export const number = (value, digits = 0) => {
18
18
 
19
19
  export const decimal = (value, digits = 2) => number(value || 0, digits);
20
20
 
21
+ export const priceWithTax = (value, settings) => {
22
+ const { gstTax = 0, displayPricingWithTax = false } = settings || {};
23
+ const valueWithTask = displayPricingWithTax ? tax(value, gstTax) : value;
24
+ return price(valueWithTask);
25
+ };
26
+
21
27
  export const price = (value = 0, currency = 'USD') => {
22
28
  const amount = number(value, 2);
23
29
  const cur = currencies.find(c => c.value.toUpperCase() === currency.toUpperCase());
@@ -78,7 +84,7 @@ export const shortDate = d => dayjs(d).format('DD/MM/YYYY');
78
84
 
79
85
  export const sydneyTime = d => dayjs(d).utc().utcOffset(10).format('MMM D, YYYY h:mm A');
80
86
 
81
- export const priceInRange = (prices, amount) => (prices.find(({ min, max }) => min <= amount && (!max || max >= amount)) || { price: 0 }).price;
87
+ export const priceInRange = (prices, amount) => ((prices || []).find(({ min, max }) => min <= amount && (!max || max >= amount)) || { price: 0 }).price;
82
88
 
83
89
  export const staticLink = link => (link || '').startsWith('http') ? link : `${process.env.STATIC_URL}${link}`;
84
90
 
@@ -1,3 +1,14 @@
1
+ export function getPrintAreasSizes(printAreas, side) {
2
+ return printAreas
3
+ .filter(printArea => !side || printArea.side === side)
4
+ .reduce((sizes, printArea) => {
5
+ return [
6
+ ...sizes,
7
+ ...getPrintAreaSizes(printArea).filter(({ _id }) => !sizes.some(size => size._id === _id))
8
+ ];
9
+ }, []);
10
+ }
11
+
1
12
  export function getPrintAreaSizes({ printSize, sizes = [] }) {
2
13
  return [
3
14
  printSize,
@@ -22,7 +33,7 @@ export function getPrintsFromLayers(layers, product) {
22
33
  if (!prints.has(printArea)) {
23
34
  const layerPrintType = product.printTypes.find(({ _id }) => _id === printType);
24
35
  const layerPrintArea = product.printAreas.find(({ _id }) => _id === printArea);
25
- const sizes = getPrintAreaSizes(layerPrintArea);
36
+ const sizes = layerPrintArea ? getPrintAreaSizes(layerPrintArea) : [];
26
37
  const layerPrintSize = sizes.find(({ _id }) => _id === printSize);
27
38
  const { setupCost, printCost, freeSetupOver } = getPrintTypeSizePricing(layerPrintType, printSize) || {};
28
39
  const getSimpleObj = i => i && ({ _id: i._id, name: i.name });
@@ -30,7 +41,7 @@ export function getPrintsFromLayers(layers, product) {
30
41
  printArea: getSimpleObj(layerPrintArea),
31
42
  printType: getSimpleObj(layerPrintType),
32
43
  printSize: getSimpleObj(layerPrintSize),
33
- costType: layerPrintType.costType,
44
+ costType: layerPrintType?.costType,
34
45
  setupCost,
35
46
  freeSetupOver,
36
47
  printCost,
@@ -47,8 +58,8 @@ export function getPrintsFromLayers(layers, product) {
47
58
  }
48
59
 
49
60
  export function getPrintTypeSizePricing(printType, sizeId) {
50
- return printType.printAreas
61
+ return printType?.printAreas
51
62
  .find(({ printSizes }) => {
52
63
  return printSizes.map(size => size?._id || size).includes(sizeId);
53
- }) || printType.printAreas[0];
64
+ }) || printType?.printAreas[0];
54
65
  }
@@ -105,7 +105,7 @@ export function generateProductsLink($route, data) {
105
105
  params.push(`page=${page}`);
106
106
  }
107
107
 
108
- Object.keys({ ...$route.query, ...data }).forEach(key => {
108
+ Object.keys({ ...(($route && $route.query) || {}), ...data }).forEach(key => {
109
109
  if (!['text', 'sort', 'page', 'type', 'brand'].includes(key)) {
110
110
  let items = ($route && $route.query[key]) ? $route.query[key].split(',') : [];
111
111
  items = (data[key] ? (items.includes(data[key]) ? items.filter(c => c !== data[key]) : [...items, data[key]]) : items).join(',');
@@ -126,11 +126,11 @@ export function generateProductLink(product, color, toEditor = false) {
126
126
  return `${toEditor ? `${baseLink}/editor` : baseLink}${color ? `?color=${color.alias}` : ''}`;
127
127
  }
128
128
 
129
- export function getProductColorImages(product, color) {
129
+ export function getProductColorImages(product, color, skipDefault = false) {
130
130
  const types = [COLORS_IMAGES_TYPES.FRONT, COLORS_IMAGES_TYPES.BACK];
131
131
  const images = types.map(type => {
132
132
  const validImages = (product.images || []).filter(i => isValidImageType(i, type));
133
- return (color && validImages.find(i => i.color === color._id)) || validImages[0];
133
+ return (color && validImages.find(i => i.color === color._id)) || (!skipDefault && validImages[0]);
134
134
  });
135
135
  return images.filter(i => !!i);
136
136
  }
@@ -142,5 +142,5 @@ export function sortByOrder(items, itemProp) {
142
142
 
143
143
  export function sortByOrderASC(items, itemProp) {
144
144
  const getOrder = item => (itemProp ? +(item[itemProp] && item[itemProp].order) : item.order) || 0;
145
- return (items || []).sort((a, b) => getOrder(a) - getOrder(b));
145
+ return [...(items || [])].sort((a, b) => getOrder(a) - getOrder(b));
146
146
  }
@@ -3,6 +3,9 @@
3
3
  .lc_table {
4
4
  width: 100%;
5
5
  table-layout: fixed;
6
+ &.layout-auto {
7
+ table-layout: auto
8
+ }
6
9
  &.bordered {
7
10
  border-collapse: collapse;
8
11
  &, th, td {
@@ -205,6 +205,12 @@
205
205
  font-size: 12px;
206
206
  line-height: 130%;
207
207
  }
208
+ &_regular13 {
209
+ font-style: normal;
210
+ font-weight: normal;
211
+ font-size: 13px;
212
+ line-height: 130%;
213
+ }
208
214
  &_regular14 {
209
215
  font-style: normal;
210
216
  font-weight: normal;
@@ -4,8 +4,8 @@
4
4
  .Payment {
5
5
  &__wrapper {
6
6
  .pin-form-field {
7
- @extend .form-field;
8
- @extend .labelless;
7
+ // @extend .form-field;
8
+ // @extend .labelless;
9
9
  border-radius: 0px;
10
10
  background-color: #F4F4F4;
11
11
  }
@@ -16,7 +16,7 @@
16
16
  v-if="isOpen"
17
17
  v-click-outside="close"
18
18
  class="ColorPicker__dropdown">
19
- <v-color
19
+ <chrome
20
20
  v-model="model"
21
21
  :disable-alpha="true" />
22
22
  </div>
@@ -24,8 +24,13 @@
24
24
  </template>
25
25
 
26
26
  <script>
27
+ import { Chrome } from 'vue-color';
28
+
27
29
  export default {
28
30
  name: 'ColorPicker',
31
+ components: {
32
+ Chrome
33
+ },
29
34
  props: {
30
35
  value: {
31
36
  type: String,
@@ -80,7 +80,7 @@ export default {
80
80
  try {
81
81
  const image = await api.uploadImage(this.file, this.onProgress, this.url);
82
82
  this.onProgress(0);
83
- const url = image && staticLink(image.thumb);
83
+ const url = image && staticLink(image.thumb || image.origin);
84
84
  this.$emit('onuploaded', { ...image, url });
85
85
  } catch (e) {
86
86
  console.dir(e);
@@ -1,5 +1,7 @@
1
1
  <template>
2
- <table class="lc_table">
2
+ <table
3
+ class="lc_table"
4
+ :class="{ bordered, striped }">
3
5
  <thead class="centered">
4
6
  <tr class="highlighted">
5
7
  <th>Items</th>
@@ -14,7 +16,7 @@
14
16
  active: amount >= range.min && ((range.max && amount <= range.max) || !range.max)
15
17
  }">
16
18
  <td>{{ (range.max >= 9999 || !range.max) ? `${range.min}+` : `${range.min}-${range.max}` }}</td>
17
- <td>{{ range.price | price }}</td>
19
+ <td>{{ range.price | priceWithTax(pricingSettings) }}</td>
18
20
  </tr>
19
21
  </tbody>
20
22
  </table>
@@ -22,13 +24,12 @@
22
24
 
23
25
  <script>
24
26
  import { mapGetters } from 'vuex';
25
- import { price, tax } from '@lancom/shared/assets/js/utils/filters';
27
+ import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
26
28
 
27
29
  export default {
28
30
  name: 'PricingDiscountsTable',
29
31
  filters: {
30
- price,
31
- tax
32
+ priceWithTax
32
33
  },
33
34
  props: {
34
35
  prices: {
@@ -38,6 +39,14 @@ export default {
38
39
  amount: {
39
40
  type: Number,
40
41
  default: 0
42
+ },
43
+ bordered: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ striped: {
48
+ type: Boolean,
49
+ default: false
41
50
  }
42
51
  },
43
52
  computed: {
@@ -2,7 +2,5 @@
2
2
 
3
3
  table {
4
4
  min-width: 200px;
5
- td, th {
6
- border: 1px solid $gray;
7
- }
5
+ background-color: $white;
8
6
  }
@@ -1,7 +1,8 @@
1
1
  <template>
2
- <div>
2
+ <div class="PricingTable_wrapper">
3
3
  <table
4
- class="lc_table striped">
4
+ class="lc_table"
5
+ :class="{ bordered, striped }">
5
6
  <thead class="centered">
6
7
  <tr
7
8
  class="highlighted"
@@ -35,7 +36,8 @@
35
36
 
36
37
  <script>
37
38
  import get from 'lodash.get';
38
- import { price } from '@lancom/shared/assets/js/utils/filters';
39
+ import { mapGetters } from 'vuex';
40
+ import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
39
41
 
40
42
  export default {
41
43
  name: 'PricingTable',
@@ -55,11 +57,18 @@ export default {
55
57
  bordered: {
56
58
  type: Boolean
57
59
  },
60
+ striped: {
61
+ type: Boolean,
62
+ default: true
63
+ },
58
64
  trLabel: {
59
65
  type: String
60
66
  }
61
67
  },
62
68
  computed: {
69
+ ...mapGetters([
70
+ 'pricingSettings'
71
+ ]),
63
72
  thList() {
64
73
  return this.items.map(item => get(item, this.nameAttr));
65
74
  },
@@ -125,7 +134,7 @@ export default {
125
134
  const printType = this.items.find(item => printTypeName === get(item, this.nameAttr));
126
135
  const pricing = get(printType, this.pricingAttr);
127
136
  const item = pricing.find(({ min, max }) => (!min || range.min >= min) && (!max || range.min <= max));
128
- return item ? price(item.price) : '-';
137
+ return item ? priceWithTax(item.price, this.pricingSettings) : '-';
129
138
  }
130
139
  }
131
140
  };
@@ -29,6 +29,7 @@
29
29
  <script>
30
30
  import { mapGetters } from 'vuex';
31
31
  import api from '@lancom/shared/assets/js/api';
32
+ import { generateProductLink } from '@lancom/shared/assets/js/utils/product';
32
33
  import ProductsListDropdownOption from './products_list_dropdown_option/products-list-dropdown-option';
33
34
 
34
35
  export default {
@@ -49,7 +50,8 @@ export default {
49
50
  },
50
51
  methods: {
51
52
  select(product) {
52
- this.$router.push(`/${product.SKU}/${product.alias}/editor`);
53
+ const link = generateProductLink(product, null, true);
54
+ this.$router.push(link);
53
55
  },
54
56
  async loadProducts(text) {
55
57
  try {
@@ -48,4 +48,27 @@ $height: 8px;
48
48
  cursor: pointer;
49
49
  z-index: 51;
50
50
  }
51
+ &__from,
52
+ &__to {
53
+ position: absolute;
54
+ top: 20px;
55
+ font-size: 11px;
56
+ opacity: 0.7;
57
+ }
58
+ &__from {
59
+ left: -3px;
60
+ }
61
+ &__to {
62
+ right: -3px;
63
+ }
64
+ &__current-value {
65
+ bottom: -20px;
66
+ font-size: 14px;
67
+ font-weight: bold;
68
+ left: 0;
69
+ right: 0;
70
+ text-align: center;
71
+ position: absolute;
72
+ pointer-events: none;
73
+ }
51
74
  }
@@ -1,5 +1,10 @@
1
1
  <template>
2
2
  <div class="Range__wrapper no-select">
3
+ <div
4
+ v-if="visibleSteps"
5
+ class="Range__from">
6
+ {{ min }}
7
+ </div>
3
8
  <div
4
9
  ref="indicator"
5
10
  class="Range__indicator">
@@ -17,6 +22,16 @@
17
22
  class="Range__indicator-after"
18
23
  :style="{ width: after }"
19
24
  @click="handleClick"></div>
25
+ <div
26
+ v-if="visibleSteps"
27
+ class="Range__current-value">
28
+ {{ model }}
29
+ </div>
30
+ </div>
31
+ <div
32
+ v-if="visibleSteps"
33
+ class="Range__to">
34
+ {{ max }}
20
35
  </div>
21
36
  </div>
22
37
  </template>
@@ -40,6 +55,10 @@ export default {
40
55
  step: {
41
56
  type: Number,
42
57
  default: 1
58
+ },
59
+ visibleSteps: {
60
+ type: Boolean,
61
+ default: false
43
62
  }
44
63
  },
45
64
  data() {
@@ -129,7 +129,8 @@ export default {
129
129
  'editorSize',
130
130
  'selectedTab',
131
131
  'productPricing',
132
- 'printsPricing'
132
+ 'printsPricing',
133
+ 'isPrintPricing'
133
134
  ]),
134
135
  ...mapGetters('layers', [
135
136
  'layerThumbnails'
@@ -175,7 +176,7 @@ export default {
175
176
  }
176
177
  },
177
178
  proceedToCard() {
178
- const entities = generateCartProducts(this.product, this.template.layers, this.template.simpleProducts, this.layerThumbnails, this.selectedPrintAreas, this.editorSize, this.printsPricing);
179
+ const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing);
179
180
  this.addToCart({ entities, shop: this.shop });
180
181
  this.showCartModal(async () => {
181
182
  const message = 'Do you wish to continue with editing the current design or reset the editor?';
@@ -151,6 +151,7 @@
151
151
  <script>
152
152
  import { inRange } from '@lancom/shared/assets/js/utils/filters';
153
153
  import { availableFonts, loadFont } from '@lancom/shared/assets/js/utils/fonts-helper';
154
+ import ColorPicker from '@lancom/shared/components/common/color-picker';
154
155
  import EditorLayerCommonFields from '../editor_layer_common_fields/editor-layer-common-fields';
155
156
  import FontFamilySelect from './font-family_select/font-family-select';
156
157
 
@@ -169,7 +170,8 @@ export default {
169
170
  name: 'EditorLayerFormText',
170
171
  components: {
171
172
  EditorLayerCommonFields,
172
- FontFamilySelect
173
+ FontFamilySelect,
174
+ ColorPicker
173
175
  },
174
176
  props: {
175
177
  layer: {
@@ -104,6 +104,7 @@ export default {
104
104
  this.$emit('layer-added', { layer, toEditMode: true });
105
105
  },
106
106
  async handleUploaded({ url, size }) {
107
+ debugger
107
108
  const layer = await this.createLayer({ type: 'art', url, size });
108
109
  this.$emit('layer-added', { layer, toEditMode: false });
109
110
  }
@@ -89,106 +89,7 @@
89
89
  <div
90
90
  v-if="showDetails"
91
91
  class="EditorPricing__details">
92
- <table class="lc_table EditorPricing__details-table">
93
- <thead class="centered">
94
- <tr class="highlighted">
95
- <th colspan="6">
96
- Tees
97
- </th>
98
- <th colspan="6">
99
- Sizes
100
- </th>
101
- <th>Cost</th>
102
- <th>Total Cost</th>
103
- </tr>
104
- </thead>
105
- <tbody class="centered">
106
- <tr
107
- v-for="([groupPrice, group], index) in groupedProductsByPrice"
108
- :key="index">
109
- <td colspan="6">
110
- {{ group.amount }}
111
- </td>
112
- <td colspan="6">
113
- ({{ group.sizes | sizesRange }})
114
- </td>
115
- <td>
116
- <v-popover
117
- trigger="hover"
118
- popover-class="tooltip popover white no-paddings"
119
- :delay="{ show: 200, hide: 400 }">
120
- <span class="EditorPricing__hoverable">
121
- {{ groupPrice | price }}
122
- </span>
123
- <template slot="popover">
124
- <pricing-discounts-table
125
- :prices="group.pricing"
126
- :amount="productPricing.amount" />
127
- </template>
128
- </v-popover>
129
- </td>
130
- <td>{{ group.totalPrice | price }}</td>
131
- </tr>
132
- <tr class="highlighted">
133
- <td colspan="13">
134
- Tee Subtotal:
135
- </td>
136
- <td>{{ productPricing.products.products.totalPrice | price }}</td>
137
- </tr>
138
- </tbody>
139
- <thead class="centered">
140
- <tr class="highlighted">
141
- <th colspan="4">
142
- Prints
143
- </th>
144
- <th colspan="4">
145
- Quantity
146
- </th>
147
- <th colspan="4">
148
- Sizes
149
- </th>
150
- <th>Cost</th>
151
- <th>Total Cost</th>
152
- </tr>
153
- </thead>
154
- <tbody class="centered">
155
- <tr
156
- v-for="([printSide, group], index) in groupedProductsByPrintsPrice"
157
- :key="index">
158
- <td colspan="4">
159
- {{ printSide }}
160
- </td>
161
- <td colspan="4">
162
- {{ group.amount }}
163
- </td>
164
- <td colspan="4">
165
- {{ group.sizes | printsRange }}
166
- </td>
167
- <td>
168
- <v-popover
169
- trigger="hover"
170
- popover-class="tooltip popover white no-paddings"
171
- :delay="{ show: 200, hide: 400 }">
172
- <span class="EditorPricing__hoverable">
173
- {{ group.price | price }}
174
- </span>
175
- <template slot="popover">
176
- <pricing-discounts-table
177
- :prices="printsPricing[group.sizes[0]]"
178
- :amount="productPricing.amount" />
179
- </template>
180
- </v-popover>
181
- </td>
182
- <td>{{ group.totalPrice | price }}</td>
183
- </tr>
184
- <tr class="highlighted">
185
- <td colspan="13">
186
- Prints Subtotal:
187
- </td>
188
- <td>{{ productPricing.products.prints.totalPrice | price }}</td>
189
- </tr>
190
- </tbody>
191
- </table>
92
+ <editor-pricing-details />
192
93
  </div>
193
94
  </div>
194
95
  </template>
@@ -196,11 +97,9 @@
196
97
  <script>
197
98
  import { mapGetters, mapActions, mapMutations } from 'vuex';
198
99
  import debounce from 'lodash.debounce';
199
- import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
200
-
201
100
  import { EventBus } from '@lancom/shared/assets/js/utils/event-bus';
202
101
  import { price, sizesRange, printsRange, tax } from '@lancom/shared/assets/js/utils/filters';
203
- import { groupProductsSizesByPrice, groupProductsPrintsByPrintArea } from '@lancom/shared/assets/js/utils/products-grouping';
102
+ import EditorPricingDetails from '@lancom/shared/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details';
204
103
 
205
104
  export default {
206
105
  name: 'EditorPricing',
@@ -211,7 +110,7 @@ export default {
211
110
  printsRange
212
111
  },
213
112
  components: {
214
- PricingDiscountsTable
113
+ EditorPricingDetails
215
114
  },
216
115
  data() {
217
116
  return {
@@ -237,25 +136,6 @@ export default {
237
136
  return this.hasUsedSimpleProducts
238
137
  ? this.usedSimpleProducts
239
138
  : [this.defaultSimpleProduct];
240
- },
241
- groupedProductsByPrice() {
242
- return this.productPricing
243
- ? groupProductsSizesByPrice(
244
- this.products,
245
- this.productPricing.products
246
- )
247
- : [];
248
- },
249
- hasGroupedProductsByPrintsPrice() {
250
- return this.groupedProductsByPrintsPrice.length > 0;
251
- },
252
- groupedProductsByPrintsPrice() {
253
- return this.productPricing
254
- ? groupProductsPrintsByPrintArea(
255
- this.products,
256
- this.productPricing.products
257
- )
258
- : [];
259
139
  }
260
140
  },
261
141
  watch: {
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div class="EditorPricingDetails__wrapper">
3
+ <editor-pricing-details-products />
4
+ <editor-pricing-details-prints v-if="isPrintPricing" />
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import { mapGetters } from 'vuex';
10
+ import EditorPricingDetailsProducts from './editor_pricing_details_products/editor-pricing-details-products';
11
+ import EditorPricingDetailsPrints from './editor_pricing_details_prints/editor-pricing-details-prints';
12
+
13
+ export default {
14
+ name: 'EditorPricingDetails',
15
+ components: {
16
+ EditorPricingDetailsProducts,
17
+ EditorPricingDetailsPrints
18
+ },
19
+ computed: {
20
+ ...mapGetters('product', [
21
+ 'isPrintPricing'
22
+ ])
23
+ }
24
+ };
25
+ </script>
26
+
27
+ <style lang="scss" scoped>
28
+ @import 'editor-pricing-details';
29
+ </style>