@lancom/shared 0.0.267 → 0.0.269

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 (93) hide show
  1. package/assets/js/api/admin.js +11 -11
  2. package/assets/js/constants/country.js +1 -1
  3. package/assets/js/utils/fabric-helper.js +10 -4
  4. package/assets/scss/ui_kit/_forms.scss +2 -2
  5. package/assets/scss/ui_kit/_tooltip.scss +3 -1
  6. package/assets/scss/variables/_theme.scss +3 -3
  7. package/components/checkout/cart/cart.mixin.js +5 -5
  8. package/components/checkout/cart/cart_price_info/cart-price-info.vue +2 -2
  9. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
  10. package/components/checkout/order/address-form/address-form.vue +4 -3
  11. package/components/checkout/order/order-shipping-method/order-shipping-method.vue +2 -2
  12. package/components/checkout/order/order.vue +1 -1
  13. package/components/common/payment/payment_card/pinpayment/pinpayment.vue +34 -5
  14. package/components/common/postcode_select/postcode-select.vue +5 -1
  15. package/components/common/products_list_dropdown/products-list-dropdown.vue +1 -1
  16. package/components/common/products_total_pricing/products-total-pricing.vue +5 -1
  17. package/components/design/approve_design_header/approve-design-header.vue +1 -1
  18. package/components/editor/editor.vue +8 -2
  19. package/components/editor/editor_pricing/editor-pricing.vue +2 -2
  20. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +8 -7
  21. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +12 -4
  22. package/components/editor/editor_print_area_options/editor-print-area-options.scss +5 -4
  23. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.scss +39 -0
  24. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +29 -6
  25. package/components/editor/editor_product_details/editor-product-details.scss +6 -0
  26. package/components/editor/editor_product_details/editor-product-details.vue +13 -3
  27. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +12 -2
  28. package/components/faq/faq.vue +2 -2
  29. package/components/modals/order_modal/order-modal.vue +17 -3
  30. package/components/order/order_price/order-price.vue +5 -3
  31. package/components/order/order_prints_groups/order-prints-groups.vue +3 -1
  32. package/components/order/order_products_groups/order-products-groups.vue +3 -1
  33. package/components/order/order_refund_view/order-refund-view.vue +5 -3
  34. package/components/order/order_setup_groups/order-setup-groups.vue +4 -2
  35. package/components/order/order_sku_groups/order-sku-groups.vue +3 -1
  36. package/components/order/order_view/order-view.vue +10 -6
  37. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +3 -1
  38. package/components/pricing/pricing_example/pricing-example.vue +3 -3
  39. package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +7 -2
  40. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +2 -2
  41. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +3 -1
  42. package/components/product/product_color_image/product-color-image.vue +2 -3
  43. package/components/product/product_price_range/product-price-range.vue +6 -5
  44. package/components/product/product_prints_price_info/product-prints-price-info.vue +2 -2
  45. package/components/products/products_autocomplete/products-autocomplete.scss +10 -12
  46. package/components/quotes/quote_request/quote-request.vue +1 -1
  47. package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +5 -4
  48. package/mixins/meta-info.js +9 -2
  49. package/mixins/products-price.js +3 -2
  50. package/package.json +1 -1
  51. package/static/icons/print-area/back_hoodie.svg +3 -0
  52. package/static/icons/print-area/back_hoodie_a3.svg +4 -0
  53. package/static/icons/print-area/back_hoodie_a4_v.svg +4 -0
  54. package/static/icons/print-area/back_hoodie_half_a4_h.svg +4 -0
  55. package/static/icons/print-area/back_hoodie_rect10_l.svg +4 -0
  56. package/static/icons/print-area/back_polo.svg +3 -0
  57. package/static/icons/print-area/back_polo_a3.svg +4 -0
  58. package/static/icons/print-area/back_polo_a4_v.svg +4 -0
  59. package/static/icons/print-area/back_polo_half_a4_h.svg +4 -0
  60. package/static/icons/print-area/back_polo_rect10_l.svg +4 -0
  61. package/static/icons/print-area/back_tee.svg +3 -0
  62. package/static/icons/print-area/back_tee_a3.svg +4 -0
  63. package/static/icons/print-area/back_tee_a4_v.svg +4 -0
  64. package/static/icons/print-area/back_tee_bottom.svg +12 -0
  65. package/static/icons/print-area/back_tee_center.svg +12 -0
  66. package/static/icons/print-area/back_tee_half_a4_h.svg +4 -0
  67. package/static/icons/print-area/back_tee_rect10_l.svg +4 -0
  68. package/static/icons/print-area/back_tee_top.svg +12 -0
  69. package/static/icons/print-area/front_hoodie.svg +3 -0
  70. package/static/icons/print-area/front_hoodie_a3.svg +4 -0
  71. package/static/icons/print-area/front_hoodie_a4_v.svg +4 -0
  72. package/static/icons/print-area/front_hoodie_half_a4_h.svg +4 -0
  73. package/static/icons/print-area/front_hoodie_rect10_l.svg +4 -0
  74. package/static/icons/print-area/front_polo.svg +3 -0
  75. package/static/icons/print-area/front_polo_a3.svg +4 -0
  76. package/static/icons/print-area/front_polo_a4_v.svg +4 -0
  77. package/static/icons/print-area/front_polo_half_a4_h.svg +4 -0
  78. package/static/icons/print-area/front_polo_rect10_l.svg +4 -0
  79. package/static/icons/print-area/front_tee.svg +3 -0
  80. package/static/icons/print-area/front_tee_a3.svg +4 -0
  81. package/static/icons/print-area/front_tee_a4_v.svg +4 -0
  82. package/static/icons/print-area/front_tee_center.svg +12 -0
  83. package/static/icons/print-area/front_tee_half_a4_h.svg +4 -0
  84. package/static/icons/print-area/front_tee_left.svg +5 -0
  85. package/static/icons/print-area/front_tee_rect10_l.svg +4 -0
  86. package/static/icons/print-area/front_tee_right.svg +12 -0
  87. package/static/icons/print-area/sleeve-left_tee.svg +3 -0
  88. package/static/icons/print-area/sleeve-left_tee_left.svg +12 -0
  89. package/static/icons/print-area/sleeve-right_tee.svg +3 -0
  90. package/static/icons/print-area/sleeve-right_tee_right.svg +12 -0
  91. package/store/cart.js +7 -6
  92. package/store/index.js +16 -5
  93. package/store/product.js +3 -2
@@ -0,0 +1,12 @@
1
+ <svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0)">
3
+ <path d="M10.9168 54.0892V27.5034L1.10645 17.5792L13.0223 6.96084L21.5579 3.86523L21.8425 5.12852C22.5834 9.06318 26.3736 11.6523 30.3083 10.9116C33.243 10.359 35.5387 8.06337 36.0914 5.12852L36.3759 3.86523L44.8888 6.96084L56.8046 17.5792L47.0057 27.492V54.0892H10.9168Z" fill="#F4F4F4"/>
4
+ <path d="M45.673 6.10769C45.5638 6.0081 45.4363 5.93085 45.2975 5.88007L36.6366 2.78446C36.0458 2.56993 35.3929 2.87508 35.1784 3.46589C35.1397 3.57244 35.1172 3.68412 35.1115 3.79736C35.1115 4.04774 34.736 9.81786 28.9658 9.90891C23.1616 9.81786 22.7974 4.04774 22.786 3.79736C22.7524 3.1697 22.2164 2.68815 21.5887 2.72172C21.4809 2.72755 21.3743 2.74861 21.2723 2.78446L12.6228 5.91421C12.484 5.965 12.3565 6.04225 12.2473 6.14183L0.354216 16.7488C-0.101447 17.1817 -0.119941 17.9022 0.312961 18.3578C0.326333 18.3719 0.340133 18.3857 0.354216 18.3991L9.82314 27.9704V54.1465C9.82314 54.775 10.3327 55.2846 10.9612 55.2846H47.0387C47.6672 55.2846 48.1768 54.775 48.1768 54.1465V27.9704L57.6458 18.3991C58.1014 17.9662 58.1199 17.2458 57.687 16.7901C57.6736 16.776 57.6598 16.7622 57.6458 16.7488L45.673 6.10769ZM48.1427 24.7269V21.4461C48.1427 20.8176 47.6331 20.308 47.0046 20.308C46.3761 20.308 45.8665 20.8176 45.8665 21.4461V52.9515H12.0538V21.4461C12.0538 20.8176 11.5442 20.308 10.9157 20.308C10.2872 20.308 9.77762 20.8176 9.77762 21.4461V24.7382L2.77835 17.6479L13.613 7.95139L20.7374 5.37931C21.62 9.92684 26.022 12.898 30.5696 12.0154C33.9279 11.3635 36.5538 8.73767 37.2056 5.37931L44.3301 7.95139L55.1306 17.6479L48.1427 24.7269Z" fill="#303030"/>
5
+ <rect x="12.9873" y="9" width="4.96536" height="12.0049" rx="1" transform="rotate(48.4693 12.9873 9)" fill="#303030"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0">
9
+ <rect width="58" height="58" fill="white"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
package/store/cart.js CHANGED
@@ -148,9 +148,9 @@ export const actions = {
148
148
  await api.saveCart(payload, shop._id);
149
149
  commit('setEntities', entities);
150
150
  },
151
- async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop }) {
151
+ async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop, country }) {
152
152
  const selectedSuppliersWithRates = cartPricing?.shipping?.suppliersWithRates;
153
- const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates);
153
+ const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates, country);
154
154
  try {
155
155
  commit('setCartPricingCalculating', true);
156
156
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -179,7 +179,7 @@ export const actions = {
179
179
  clearCart({ commit }) {
180
180
  commit('clearCart');
181
181
  },
182
- async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop }) {
182
+ async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop, country }) {
183
183
  const suppliersWithRates = cartPricing.shipping.suppliersWithRates
184
184
  .map(supplierWithRates => ({
185
185
  ...(
@@ -190,7 +190,7 @@ export const actions = {
190
190
  })
191
191
  : supplierWithRates)
192
192
  }));
193
- const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon);
193
+ const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, null, country);
194
194
  try {
195
195
  commit('setCartPricingCalculating', true);
196
196
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -245,7 +245,7 @@ export const mutations = {
245
245
  }
246
246
  };
247
247
 
248
- function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates) {
248
+ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates, country) {
249
249
  const getSimpleObj = i => i && ({ _id: i._id, name: i.name });
250
250
  return {
251
251
  entities: entities.map(({ _id, guid, prints, simpleProducts, product }) => ({
@@ -285,6 +285,7 @@ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon
285
285
  address: suburb ? [suburb.locality, suburb.state, suburb.postcode].filter(i => !!i).join(', ') : null,
286
286
  coupon,
287
287
  suppliersWithRates,
288
- selectedSuppliersWithRates
288
+ selectedSuppliersWithRates,
289
+ country: country?._id
289
290
  };
290
291
  }
package/store/index.js CHANGED
@@ -35,6 +35,7 @@ export const getters = {
35
35
  pricingSettings: ({ pricing }) => pricing || {},
36
36
  orderSettings: ({ orderInfo }) => orderInfo || {},
37
37
  gstTax: ({ pricing }) => pricing?.gstTax || 0,
38
+ taxName: ({ pricing }) => pricing?.taxName || 'GST',
38
39
  displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
39
40
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
40
41
  depositInfo: ({ depositInfo }) => depositInfo || {}
@@ -55,14 +56,15 @@ export const actions = {
55
56
  commit('setCountry', settings.country);
56
57
  commit('setCurrency', settings.currency);
57
58
 
59
+ const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
60
+
58
61
  if (process.env.PINPAYMENT_PUBLISHABLE_API_KEY) {
59
62
  commit('setPayment', {
60
63
  type: 'pinpayment',
61
64
  clientKey: process.env.PINPAYMENT_PUBLISHABLE_API_KEY
62
65
  });
63
66
  } else {
64
- const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
65
- const countrySetting = countrySettings.settings.find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
67
+ const countrySetting = (countrySettings?.settings || []).find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
66
68
  if (countrySetting) {
67
69
  commit('setPayment', {
68
70
  type: 'stripe',
@@ -71,6 +73,13 @@ export const actions = {
71
73
  }
72
74
  }
73
75
 
76
+
77
+ const pricingSetting = (countrySettings?.settings || []).find(s => !!s.settings.pricing);
78
+ commit('setPricing', {
79
+ ...shop.settings.pricing,
80
+ ...(pricingSetting?.settings?.pricing || {})
81
+ });
82
+
74
83
  // }
75
84
  try {
76
85
  if (req.headers.cookie) {
@@ -99,7 +108,7 @@ export const actions = {
99
108
  commit('cart/setCoupon', coupon);
100
109
  } catch (e) {}
101
110
  }
102
- dispatch('cart/calculateCartPrice', { shop });
111
+ dispatch('cart/calculateCartPrice', { shop, country });
103
112
  }
104
113
  }
105
114
  const closedNotification = localStorage.getItem(CLOSED_NOTIFICATION);
@@ -121,15 +130,17 @@ export const mutations = {
121
130
  setPayment(state, payment) {
122
131
  state.payment = payment;
123
132
  },
133
+ setPricing(state, pricing) {
134
+ state.pricing = pricing;
135
+ },
124
136
  setCountry(state, country) {
125
137
  state.country = country;
126
138
  },
127
139
  setCurrency(state, currency) {
128
140
  state.currency = currency;
129
141
  },
130
- setSettings(state, { contacts, pricing, notificationBar, discountPopup, order, depositInfo }) {
142
+ setSettings(state, { contacts, notificationBar, discountPopup, order, depositInfo }) {
131
143
  state.contacts = contacts;
132
- state.pricing = pricing;
133
144
  state.orderInfo = order;
134
145
  state.notificationBar = notificationBar;
135
146
  state.discountPopup = discountPopup;
package/store/product.js CHANGED
@@ -161,6 +161,7 @@ export const actions = {
161
161
  commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize });
162
162
  }
163
163
  } catch (e) {
164
+ console.log(e);
164
165
  const { status, data } = e?.response || {};
165
166
  const statusCode = status || 500;
166
167
  commit('setLoadError', {
@@ -200,10 +201,10 @@ export const actions = {
200
201
  async updatePriceIncludeGST({ commit }, value) {
201
202
  commit('setPriceIncludeGST', value);
202
203
  },
203
- async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, shop) {
204
+ async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, { shop, country }) {
204
205
  commit('setCalculatingPrice', true);
205
206
  const entities = getProductsForCalculatePricing(product, getters.usedSimpleProducts, template.layers, isPrintPricing, true);
206
- const response = await api.calculateProductPrice({ entities }, shop._id);
207
+ const response = await api.calculateProductPrice({ entities, country: country?._id }, shop._id);
207
208
  commit('setProductPricing', response);
208
209
  commit('setCalculatingPrice', false);
209
210
  },