@lancom/shared 0.0.102 → 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 (107) hide show
  1. package/assets/js/api/admin.js +6 -0
  2. package/assets/js/models/print-area.js +8 -6
  3. package/assets/js/models/product-layers.js +3 -3
  4. package/assets/js/utils/fabric-helper.js +2 -4
  5. package/assets/js/utils/filters.js +7 -1
  6. package/assets/js/utils/prints.js +15 -4
  7. package/assets/js/utils/product.js +4 -4
  8. package/assets/scss/ui_kit/_table.scss +3 -0
  9. package/assets/scss/ui_kit/_typography.scss +6 -0
  10. package/components/checkout/order/address-form/address-form.vue +1 -0
  11. package/components/checkout/order/order-billing-information/order-billing-information.vue +7 -5
  12. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  13. package/components/common/color-picker.vue +6 -1
  14. package/components/common/file_uploader.vue +1 -1
  15. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  16. package/components/common/pricing_table/pricing-table.scss +1 -3
  17. package/components/common/pricing_table/pricing-table.vue +13 -4
  18. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  19. package/components/common/range/range.scss +23 -0
  20. package/components/common/range/range.vue +19 -0
  21. package/components/editor/editor.vue +3 -2
  22. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  23. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
  24. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  25. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  26. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  27. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  28. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  29. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  30. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  31. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  32. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  33. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  34. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  35. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  36. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
  37. package/components/modals/cart_modal/cart-modal.vue +1 -1
  38. package/components/modals/order_modal/order-modal.vue +5 -7
  39. package/components/modals/payment_modal/payment-modal.vue +1 -1
  40. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  41. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  42. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  43. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  44. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  45. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  46. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  47. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  48. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  49. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  50. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  51. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  52. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  53. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  54. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  55. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  56. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  57. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  58. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  59. package/components/product/gallery/gallery.scss +168 -0
  60. package/components/product/gallery/gallery.vue +252 -0
  61. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  62. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  63. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  64. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  65. package/components/product/product.vue +16 -5
  66. package/components/product/product_price_range/product-price-range.vue +20 -4
  67. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  68. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  69. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  70. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  71. package/components/product/related_products/related-products.scss +34 -0
  72. package/components/product/related_products/related-products.vue +52 -0
  73. package/components/products/product_list/product-list.scss +2 -1
  74. package/components/products/product_list_product/product-list-product.scss +44 -20
  75. package/components/products/product_list_product/product-list-product.vue +6 -4
  76. package/components/products/products_aside/products-aside.vue +29 -4
  77. package/components/products/products_brands/products-brands.vue +9 -2
  78. package/components/products/products_filters/products-filters.vue +10 -0
  79. package/components/products/products_tags/products-tags.vue +7 -0
  80. package/components/products/products_types/products-types.vue +6 -1
  81. package/mixins/product-preview.js +1 -1
  82. package/nuxt.config.js +13 -1
  83. package/package.json +1 -1
  84. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  85. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  86. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  87. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  88. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  89. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  90. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  91. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  92. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  93. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  94. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  95. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  96. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  97. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  98. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  99. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  100. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  101. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  102. package/store/index.js +3 -1
  103. package/store/product.js +25 -14
  104. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  105. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  106. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  107. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -67,7 +67,7 @@ const productPreview = {
67
67
  return getBgStyle(this.productСoverHover);
68
68
  },
69
69
  productBackgroundСover() {
70
- return getColorBackgroundStyle(this.currentColor);
70
+ return this.productСoverLoaded ? getColorBackgroundStyle(this.currentColor) : null;
71
71
  },
72
72
  productBrand() {
73
73
  const { brand } = this.product;
package/nuxt.config.js CHANGED
@@ -122,11 +122,23 @@ module.exports = (config, axios) => ({
122
122
  'g:product_type': { _text: `Home > Products > ${product.productType.name}`, },
123
123
  'g:is_bundle': { _text: product.prePrint ? 'yes' : 'no' },
124
124
  'g:identifier_exists': sp.gtin ? 'yes' : 'no',
125
- 'g:product_weight': { _text: `${product.weight} kg` }
125
+ 'g:product_weight': { _text: `${product.weight} kg` },
126
+ 'g:shipping_weight': { _text: `${((product.weight || 0) + (product.weight || 0) * 0.05).toFixed(3)} kg` }
126
127
  };
127
128
  if (sp.gtin) {
128
129
  info['g:gtin'] = { _text: sp.gtin || '' };
129
130
  }
131
+ if (product.volume) {
132
+ if (product.volume.length) {
133
+ info['g:shipping_length'] = { _text: `${product.volume.length} cm` };
134
+ }
135
+ if (product.volume.width) {
136
+ info['g:shipping_width'] = { _text: `${product.volume.width} cm` };
137
+ }
138
+ if (product.volume.height) {
139
+ info['g:shipping_height'] = { _text: `${product.volume.height} cm` };
140
+ }
141
+ }
130
142
  return info;
131
143
  })
132
144
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.102",
3
+ "version": "0.0.106",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -25,6 +25,7 @@ export const getters = {
25
25
  pricingSettings: ({ pricing }) => pricing || {},
26
26
  orderSettings: ({ orderInfo }) => orderInfo || {},
27
27
  gstTax: ({ pricing }) => pricing?.gstTax || 0,
28
+ displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
28
29
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
29
30
  depositInfo: ({ depositInfo }) => depositInfo || {}
30
31
  };
@@ -46,13 +47,14 @@ export const actions = {
46
47
  }
47
48
  } catch (e) {}
48
49
  },
49
- async loadState({ commit, state: { shop, notificationBar } }) {
50
+ async loadState({ dispatch, commit, state: { shop, notificationBar } }) {
50
51
  const state = await loadState();
51
52
  if (state) {
52
53
  commit('setState', state);
53
54
  if (state.cart?.id) {
54
55
  const cart = await api.fetchCartById(shop._id, state.cart?.id);
55
56
  commit('cart/setCart', cart);
57
+ dispatch('cart/calculateCartPrice', { shop });
56
58
  }
57
59
  }
58
60
  const closedNotification = localStorage.getItem(CLOSED_NOTIFICATION);
package/store/product.js CHANGED
@@ -5,7 +5,7 @@ import { getLayerModel } from '@lancom/shared/assets/js/models/product-layers';
5
5
  import { getPrintAreaByName, getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
6
6
  import { sortSizes } from '@lancom/shared/assets/js/utils/sizes';
7
7
  import { isValidImageTypes, getColorOfDefaultCatalogFrontImage } from '@lancom/shared/assets/js/utils/colors';
8
- import { getProductsForCalculatePricing } from '../assets/js/utils/product';
8
+ import { getProductsForCalculatePricing } from '@lancom/shared/assets/js/utils/product';
9
9
  import { sortByName } from '../assets/js/utils/filters';
10
10
 
11
11
  export const state = () => ({
@@ -36,7 +36,8 @@ export const state = () => ({
36
36
  selectedPrintAreas: {},
37
37
  productPricing: null,
38
38
  selectedTab: null,
39
- layersUpdatesCount: 0
39
+ layersUpdatesCount: 0,
40
+ editableSide: { id: 'front' }
40
41
  });
41
42
 
42
43
  export const getters = {
@@ -72,7 +73,7 @@ export const getters = {
72
73
  editableLayers: ({ template, editableColor, editablePrintArea }) => template.layers
73
74
  .filter(({ printArea }) => (
74
75
  // colorId === editableColor._id &&
75
- printArea === editablePrintArea.id
76
+ printArea === editablePrintArea?._id
76
77
  )),
77
78
  selectedLayer: ({ selectedLayer }) => selectedLayer,
78
79
  editModeSelectedLayer: ({ editModeSelectedLayer }) => editModeSelectedLayer,
@@ -90,10 +91,9 @@ export const getters = {
90
91
  },
91
92
  selectedTab: ({ selectedTab }) => selectedTab,
92
93
  layersUpdatesCount: ({ layersUpdatesCount }) => layersUpdatesCount,
93
- printArea: ({ editablePrintArea, selectedPrintAreas, editorSize: { width, height }, product }) => {
94
- const selectedPrintArea = (!!editablePrintArea && selectedPrintAreas[editablePrintArea._id]);
94
+ printArea: ({ editablePrintArea, editorSize: { width, height }, product }) => {
95
95
  return getPrintAreaByName({
96
- name: selectedPrintArea,
96
+ printArea: editablePrintArea?._id,
97
97
  editorWidth: width,
98
98
  editorHeight: height
99
99
  }, product);
@@ -122,16 +122,24 @@ export const getters = {
122
122
  imagesGroups.set(i.color, [...(imagesGroups.get(i.color) || []), i]);
123
123
  });
124
124
  return [...imagesGroups.values()].reduce((images, group) => [...images, ...group], []);
125
- }
125
+ },
126
+ editableSide: ({ editableSide }) => editableSide,
127
+ hasUnprintedPrice: ({ product }) => product.minUnprintedPrice || product.maxUnprintedPrice
126
128
  };
127
129
 
128
130
  export const actions = {
129
131
  async fetchProduct({ commit }, { shop, slug, print }) {
130
132
  try {
131
133
  commit('setLoadError', null);
132
- const response = await api.fetchProduct(shop, slug);
133
- commit('setProduct', response);
134
- commit('setPreSetPrint', (response.prints || []).find(({ _id }) => _id === print));
134
+ const product = await api.fetchProduct(shop, slug);
135
+ commit('setProduct', product);
136
+ commit('setPreSetPrint', (product.prints || []).find(({ _id }) => _id === print));
137
+
138
+ const [first] = (product.printAreas || []);
139
+ if (first) {
140
+ commit('setEditablePrintArea', first);
141
+ commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize.alias });
142
+ }
135
143
  } catch (e) {
136
144
  const { status, data } = e?.response || {};
137
145
  const statusCode = status || 500;
@@ -179,7 +187,7 @@ export const actions = {
179
187
  const { selectedPrintArea } = getters;
180
188
  const layer = await getLayerModel({
181
189
  type,
182
- colorId: editableColor._id,
190
+ colorId: editableColor?._id,
183
191
  top,
184
192
  left,
185
193
  isEditMode,
@@ -187,9 +195,9 @@ export const actions = {
187
195
  originalSize: size,
188
196
  properties: {
189
197
  ...(properties || {}),
190
- printArea: editablePrintArea._id,
191
- printSize: selectedPrintArea._id,
192
- printType: selectedPrintType._id
198
+ printArea: editablePrintArea?._id,
199
+ printSize: selectedPrintArea?._id,
200
+ printType: selectedPrintType?._id
193
201
  }
194
202
  });
195
203
  if (preselect) {
@@ -383,6 +391,9 @@ export const mutations = {
383
391
  },
384
392
  setPreSetPrint(state, preSetPrint) {
385
393
  state.preSetPrint = preSetPrint;
394
+ },
395
+ setEditableSide(state, side) {
396
+ state.editableSide = side;
386
397
  }
387
398
  };
388
399
 
@@ -1,8 +0,0 @@
1
- @import "@/assets/scss/variables";
2
-
3
- .DiscountsTable {
4
- &__info {
5
- color: $green;
6
- cursor: pointer;
7
- }
8
- }
@@ -1,91 +0,0 @@
1
- <template>
2
- <table
3
- class="lc_table col-1-highlighted col-1-stripedless"
4
- :class="{ striped }">
5
- <thead class="centered">
6
- <tr>
7
- <th>&nbsp;</th>
8
- <th v-if="visibleSleeve">
9
- 6x6
10
- <i
11
- v-tooltip="{ content: 'Sleeve prints only by request' }"
12
- class="icon-info-circled DiscountsTable__info">
13
- </i>
14
- </th>
15
- <th>10x10</th>
16
- <th>Half-A4</th>
17
- <th>A4</th>
18
- <th>A3</th>
19
- </tr>
20
- </thead>
21
- <tbody class="centered">
22
- <tr
23
- v-for="range in defaultPricing"
24
- :key="range.min">
25
- <td class="pull-left">
26
- {{ range.max >= 9999 ? `${range.min}+` : `${range.min}-${range.max}` }}
27
- </td>
28
- <td v-if="visibleSleeve">
29
- &mdash;
30
- </td>
31
- <td> {{ priceInRange(prices['rect10_l'], range.min) | tax(pricingSettings.gstTax) | price }}</td>
32
- <td> {{ priceInRange(prices['half_a4_h'], range.min) | tax(pricingSettings.gstTax) | price }}</td>
33
- <td> {{ priceInRange(prices['a4_v'], range.min) | tax(pricingSettings.gstTax) | price }}</td>
34
- <td> {{ priceInRange(prices['a3'], range.min) | tax(pricingSettings.gstTax) | price }}</td>
35
- </tr>
36
- </tbody>
37
- </table>
38
- </template>
39
-
40
- <script>
41
- import { mapGetters } from 'vuex';
42
- import { price, priceInRange, tax } from '@lancom/shared/assets/js/utils/filters';
43
- import ContactUs from '@lancom/shared/components/asides/contact_us/contact-us';
44
- import { getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
45
-
46
- export default {
47
- name: 'DiscountsTable',
48
- filters: {
49
- price,
50
- tax
51
- },
52
- props: {
53
- product: {
54
- type: Object
55
- },
56
- visibleSleeve: {
57
- type: Boolean,
58
- default: true
59
- },
60
- striped: {
61
- type: Boolean,
62
- default: true
63
- }
64
- },
65
- computed: {
66
- ...mapGetters([
67
- 'pricingSettings'
68
- ]),
69
- ...mapGetters('product', [
70
- 'printsPricing'
71
- ]),
72
- defaultPricing() {
73
- const defailtKey = Object.keys(this.prices)[0];
74
- return this.prices[defailtKey] || [];
75
- },
76
- prices() {
77
- return this.product ? getProductPrintsAreasPrices(this.product) : this.printsPricing;
78
- }
79
- },
80
- methods: {
81
- contactUs() {
82
- this.$aside.show(ContactUs);
83
- },
84
- priceInRange
85
- }
86
- };
87
- </script>
88
-
89
- <style lang="scss" scoped>
90
- @import 'discounts-table';
91
- </style>
@@ -1,14 +0,0 @@
1
- @import "@/assets/scss/variables";
2
-
3
- table.DiscountsTable td,
4
- table.DiscountsTable th {
5
- @media (max-width: $bp-extra-small-max) {
6
- font-size: 7px !important;
7
- }
8
- }
9
-
10
- table.DiscountsTable:not(.tight-rows) tr {
11
- @media (max-width: $bp-extra-small-max) {
12
- height: 30px;
13
- }
14
- }
@@ -1,78 +0,0 @@
1
- <template>
2
- <table
3
- class="DiscountsTable lc_table col-1-highlighted col-1-stripedless bordered striped">
4
- <thead class="centered">
5
- <tr class="stripped">
6
- <th
7
- :colspan="1 + columns.length"
8
- class="lc_semibold20">
9
- $55 setup per colour + print cost per item, size does not matter.
10
- </th>
11
- </tr>
12
- <tr class="stripped">
13
- <th>&nbsp;</th>
14
- <th
15
- v-for="column in columns"
16
- :key="column">
17
- {{ parseInt(column) }}
18
- <span class="hidden-sm-and-down">
19
- {{ parseInt(column) > 1 ? 'colours' : 'colour' }}
20
- </span>
21
- </th>
22
- </tr>
23
- </thead>
24
- <tbody class="centered">
25
- <tr
26
- v-for="range in screenPrintsPrices['1_color']"
27
- :key="range.min">
28
- <td class="fill">
29
- {{ !range.max ? `${range.min}+` : `${range.min}-${range.max}` }}
30
- </td>
31
- <td
32
- v-for="column in columns"
33
- :key="`${range.min}__${column}`">
34
- {{ priceInRange(screenPrintsPrices[column], range.min) | tax(pricingSettings.gstTax) | price }}
35
- </td>
36
- </tr>
37
- </tbody>
38
- </table>
39
- </template>
40
-
41
- <script>
42
- import { mapGetters } from 'vuex';
43
- import { price, priceInRange, tax } from '@lancom/shared/assets/js/utils/filters';
44
-
45
- export default {
46
- name: 'DiscountsTable',
47
- filters: {
48
- price,
49
- tax
50
- },
51
- props: {
52
- visibleSleeve: {
53
- type: Boolean,
54
- default: true
55
- }
56
- },
57
- computed: {
58
- ...mapGetters([
59
- 'screenPrintsPrices',
60
- 'pricingSettings'
61
- ]),
62
- columns() {
63
- return Object.keys(this.screenPrintsPrices);
64
- }
65
- },
66
- methods: {
67
- priceInRange,
68
- getColumnName(column) {
69
- const count = parseInt(column);
70
- return `${count} colour${count > 1 ? 's' : ''}`;
71
- }
72
- }
73
- };
74
- </script>
75
-
76
- <style lang="scss" scoped>
77
- @import 'discounts-table';
78
- </style>