@lancom/shared 0.0.432 → 0.0.434

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 (44) hide show
  1. package/assets/js/api/index.js +1 -1
  2. package/components/checkout/cart/cart.vue +1 -3
  3. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.mixin.js +3 -1
  4. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.scss +14 -2
  5. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +13 -2
  6. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.scss +2 -2
  7. package/components/checkout/cart/cart_shipping/cart-shipping.vue +1 -1
  8. package/components/checkout/order/order-payment-information/order-payment-information.vue +10 -2
  9. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +6 -2
  10. package/components/customer/customer.vue +13 -17
  11. package/components/customer/customer_form/customer-form.vue +7 -2
  12. package/components/editor/editor_colors/editor-colors.scss +6 -3
  13. package/components/editor/editor_colors/editor-colors.vue +1 -1
  14. package/components/editor/editor_layers/editor-layers.scss +40 -1
  15. package/components/editor/editor_layers/editor-layers.vue +112 -67
  16. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.scss +19 -1
  17. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +114 -21
  18. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.scss +15 -1
  19. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +20 -3
  20. package/components/editor/editor_workspace/editor-workspace.vue +17 -6
  21. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +25 -20
  22. package/components/product/editor_pricing/editor-pricing.scss +2 -1
  23. package/components/product/other_products/other_product/other-product.scss +9 -0
  24. package/components/product/other_products/other_product/other-product.vue +21 -12
  25. package/components/product/product_check_delivery/product-check-delivery.scss +115 -0
  26. package/components/product/product_check_delivery/product-check-delivery.vue +135 -30
  27. package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +4 -47
  28. package/components/product/product_pricing_tiers/product-pricing-tiers.scss +2 -0
  29. package/components/product/product_pricing_tiers/product-pricing-tiers.vue +25 -6
  30. package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +6 -1
  31. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +9 -6
  32. package/components/products/children_categories/children-categories.vue +14 -7
  33. package/components/products/products_aside/products-aside.vue +14 -2
  34. package/components/static_page/static-page.scss +15 -1
  35. package/components/static_page/static-page.vue +7 -0
  36. package/mixins/layouts/products.js +3 -2
  37. package/mixins/multipack.mixin.js +61 -0
  38. package/package.json +1 -1
  39. package/plugins/headers.js +1 -0
  40. package/plugins/save-state.js +6 -2
  41. package/static/images/empty-layers.png +0 -0
  42. package/store/cart.js +20 -3
  43. package/store/index.js +1 -1
  44. package/store/product.js +2 -2
package/store/cart.js CHANGED
@@ -14,6 +14,7 @@ export const state = () => ({
14
14
  suburb: null,
15
15
  coupon: null,
16
16
  cartPricingCalculating: false,
17
+ cartSaving: false,
17
18
  cartPricing: null,
18
19
  cartPricingError: null
19
20
  });
@@ -106,6 +107,7 @@ export const getters = {
106
107
  needToPickup: ({ needToPickup }) => needToPickup,
107
108
  needToPickupWithoutErrors: (state, { notValidProductsPickup }) => state.needToPickup && notValidProductsPickup?.length === 0,
108
109
  cartPricingCalculating: ({ cartPricingCalculating }) => cartPricingCalculating,
110
+ cartSaving: ({ cartSaving }) => cartSaving,
109
111
  simpleProducts: ({ entities }) => entities.reduce((simpleProducts, entity) => [...simpleProducts, ...(entity.simpleProducts || [])], []),
110
112
  notEmptySimpleProducts: (state, { simpleProducts }) => simpleProducts.filter(e => e.amount > 0),
111
113
  simpleProductsQuantity: (state, { notEmptySimpleProducts }) => notEmptySimpleProducts.reduce((quantity, sp) => quantity + sp.amount, 0),
@@ -175,6 +177,7 @@ export const actions = {
175
177
  }
176
178
  return e;
177
179
  }).filter(e => !!e);
180
+ commit('setCartSaving', true);
178
181
  const payload = {
179
182
  _id: state.id || undefined,
180
183
  currency: currency?._id,
@@ -182,6 +185,7 @@ export const actions = {
182
185
  entities: [...cartEntities, ...entities]
183
186
  };
184
187
  const cart = await api.saveCart(payload, shop._id);
188
+ commit('setCartSaving', false);
185
189
  if (cart) {
186
190
  commit('setId', cart._id);
187
191
  commit('setEntities', cart.entities);
@@ -196,13 +200,17 @@ export const actions = {
196
200
  ...entity,
197
201
  simpleProducts: entity.simpleProducts.filter(sp => !removeGuids.includes(sp.guid))
198
202
  })).filter(({ simpleProducts }) => simpleProducts.length > 0);
203
+ commit('setEntities', entities);
204
+
205
+ commit('setCartSaving', true);
199
206
  const payload = {
200
207
  _id: state.id,
201
208
  entities,
202
209
  currency: currency?._id
203
210
  };
204
211
  await api.saveCart(payload, shop._id);
205
- commit('setEntities', entities);
212
+ commit('setCartSaving', false);
213
+
206
214
  if (state.cartPricing) {
207
215
  gtm.removeFromCart(simpleProducts, state.cartPricing, currency);
208
216
  }
@@ -214,9 +222,12 @@ export const actions = {
214
222
  const simpleProducts = entities.reduce((items, entity) => [...items, ...entity.simpleProducts], []);
215
223
  gtm.removeFromCart(simpleProducts, state.cartPricing, currency);
216
224
  }
225
+ commit('setEntities', entities);
226
+
227
+ commit('setCartSaving', true);
217
228
  const payload = { _id: state.id, entities, currency: currency?._id};
218
229
  await api.saveCart(payload, shop._id);
219
- commit('setEntities', entities);
230
+ commit('setCartSaving', false);
220
231
  },
221
232
  async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, getters: { needToPickup }, commit }, { shop, country, currency }) {
222
233
  let savedSuppliersWithRates = null;
@@ -247,9 +258,12 @@ export const actions = {
247
258
  amount: sp.guid === guid ? +amount : sp.amount
248
259
  }))
249
260
  }));
261
+ commit('setEntities', entities);
262
+
263
+ commit('setCartSaving', true);
250
264
  const payload = { _id: state.id, entities, currency: currency?._id };
251
265
  await api.saveCart(payload, shop._id);
252
- commit('setEntities', entities);
266
+ commit('setCartSaving', false);
253
267
  },
254
268
  clearCart({ commit }) {
255
269
  commit('clearCart');
@@ -303,6 +317,9 @@ export const mutations = {
303
317
  setId(state, id) {
304
318
  state.id = id;
305
319
  },
320
+ setCartSaving(state, cartSaving) {
321
+ state.cartSaving = cartSaving;
322
+ },
306
323
  setNeedToPickup(state, needToPickup) {
307
324
  state.needToPickup = needToPickup;
308
325
  },
package/store/index.js CHANGED
@@ -108,7 +108,7 @@ export const actions = {
108
108
  }
109
109
  },
110
110
  async loadState({ dispatch, commit, state: { shop, currency, country, notificationBar } }, query) {
111
- const state = await loadState();
111
+ const state = await loadState(query);
112
112
  if (state) {
113
113
  commit('setState', state);
114
114
  if (state.cart?.id) {
package/store/product.js CHANGED
@@ -170,8 +170,8 @@ export const getters = {
170
170
  printsPrice: ({ productPricing, product }) => {
171
171
  const maxPrintsPrice = +product.maxPrintsPrice || 0;
172
172
  const pricing = (productPricing?.products || {})[product._id];
173
- const price = pricing?.prints?.prints?.reduce((sum, print) => sum + (+print.priceWithoutTax || 0), 0) || maxPrintsPrice;
174
- return price;
173
+ const pricePrintsPrice = pricing?.prints?.prints?.reduce((sum, print) => sum + (+print.priceWithoutTax || 0), 0);
174
+ return pricePrintsPrice >= 0 ? pricePrintsPrice : maxPrintsPrice;
175
175
  },
176
176
  offsetWarningVisible: ({ offsetWarningVisible }) => offsetWarningVisible,
177
177
  showRecommendationToUseLargerImage: ({ selectedLayer }) => {