@infrab4a/connect-angular 3.9.3-beta1 → 3.9.3

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('@infrab4a/connect/src/domain/catalog/helpers/RoundProdutcPriceHelper'), require('js-cookie'), require('ts-custom-error'), require('@angular/fire/firestore'), require('@angular/common/http'), require('@angular/fire')) :
3
- typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', '@infrab4a/connect/src/domain/catalog/helpers/RoundProdutcPriceHelper', 'js-cookie', 'ts-custom-error', '@angular/fire/firestore', '@angular/common/http', '@angular/fire'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global.RoundProdutcPriceHelper, global["js-cookie"], global["ts-custom-error"], global.ng.fire.firestore, global.ng.common.http, global.ng.fire));
5
- })(this, (function (exports, i0, rxjs, operators, i1, i3, RoundProdutcPriceHelper, cookie, tsCustomError, i1$1, i1$2, fire) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('ts-custom-error'), require('@angular/fire/firestore'), require('@angular/common/http'), require('@angular/fire')) :
3
+ typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', 'ts-custom-error', '@angular/fire/firestore', '@angular/common/http', '@angular/fire'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global["ts-custom-error"], global.ng.fire.firestore, global.ng.common.http, global.ng.fire));
5
+ })(this, (function (exports, i0, rxjs, operators, i1, i3, cookie, tsCustomError, i1$1, i1$2, fire) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -846,7 +846,7 @@
846
846
  shop: checkout.shop || this.defaultShop,
847
847
  isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
848
848
  });
849
- RoundProdutcPriceHelper.RoundProductPricesHelper.roundProductPrices(item);
849
+ i3.roundProductPrices(item);
850
850
  return [2 /*return*/, {
851
851
  checkout: checkout,
852
852
  lineItem: i3.LineItem.toInstance({
@@ -857,7 +857,7 @@
857
857
  slug: slug !== null && slug !== void 0 ? slug : product.slug,
858
858
  sku: sku !== null && sku !== void 0 ? sku : product.sku,
859
859
  stock: stock,
860
- price: this.roundPrice(price),
860
+ price: price,
861
861
  image: image,
862
862
  weight: weight !== null && weight !== void 0 ? weight : product.weight,
863
863
  quantity: (item.quantity || 0) + (quantity || 0),
@@ -877,9 +877,7 @@
877
877
  var info = product.price;
878
878
  if (product.isGift)
879
879
  return 0;
880
- return isSubscriber && info.subscriberPrice > 0
881
- ? Number(info.subscriberPrice.toFixed(2))
882
- : Number(info.price.toFixed(2));
880
+ return isSubscriber && info.subscriberPrice > 0 ? Number(info.subscriberPrice) : Number(info.price);
883
881
  };
884
882
  this.checkMaxStock = function (item, quantity) {
885
883
  var _a;
@@ -975,10 +973,6 @@
975
973
  var _this = this;
976
974
  return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
977
975
  };
978
- CartService.prototype.roundPrice = function (productPrice) {
979
- var price = productPrice.price, fullPrice = productPrice.fullPrice, subscriberPrice = productPrice.subscriberPrice;
980
- return Object.assign(Object.assign(Object.assign({}, productPrice), { price: Number(price.toFixed(2)), fullPrice: Number(fullPrice.toFixed(2)) }), (subscriberPrice && { subscriberPrice: Number(subscriberPrice.toFixed(2)) }));
981
- };
982
976
  CartService.prototype.getProductData = function (productId) {
983
977
  return __awaiter(this, void 0, void 0, function () {
984
978
  var product, variant, error_1;