ng-easycommerce 0.0.654 → 0.0.656-beta.1
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.
- package/README.md +6 -0
- package/bundles/ng-easycommerce.umd.js +90 -27
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/core.consts.js +2 -1
- package/esm2015/lib/ec-component/auth-ec/select-channel-ec/select-channel-ec.component.js +8 -1
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +5 -4
- package/esm2015/lib/ec-component/header-ec/header-ec.component.js +1 -1
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +27 -2
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -4
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm2015/lib/services/cart.service.js +27 -12
- package/esm5/lib/core.consts.js +2 -1
- package/esm5/lib/ec-component/auth-ec/select-channel-ec/select-channel-ec.component.js +8 -1
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +5 -4
- package/esm5/lib/ec-component/header-ec/header-ec.component.js +1 -1
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +45 -2
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -4
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm5/lib/services/cart.service.js +27 -12
- package/fesm2015/ng-easycommerce.js +67 -22
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +91 -28
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +1 -0
- package/lib/ec-component/auth-ec/select-channel-ec/select-channel-ec.component.d.ts +1 -0
- package/lib/ec-component/header-ec/header-ec.component.d.ts +1 -1
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +2 -0
- package/lib/services/cart.service.d.ts +2 -2
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -7,7 +7,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
|
7
7
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
8
8
|
import { ReplaySubject, of, BehaviorSubject, forkJoin, combineLatest, Observable, throwError } from 'rxjs';
|
|
9
9
|
import 'rxjs/add/operator/map';
|
|
10
|
-
import { take, map, catchError, filter, mapTo, finalize, skipWhile, concatMap } from 'rxjs/operators';
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, startWith, skipWhile, concatMap } from 'rxjs/operators';
|
|
11
11
|
import 'rxjs/add/operator/catch';
|
|
12
12
|
import 'rxjs/add/observable/of';
|
|
13
13
|
import * as moment from 'moment';
|
|
@@ -231,6 +231,7 @@ var Constants = /** @class */ (function () {
|
|
|
231
231
|
this.LOCALE = 'LOCALE';
|
|
232
232
|
this.CHANNEL = 'CHANNEL';
|
|
233
233
|
this.searchValue = '';
|
|
234
|
+
this.channelSelected = '';
|
|
234
235
|
this.channelConfigSubject = new ReplaySubject();
|
|
235
236
|
this.channelConfig$ = this.channelConfigSubject.asObservable();
|
|
236
237
|
this.channelConfigAPI = function (channel) { return '/shop-api/' + channel + 'channel'; };
|
|
@@ -4763,12 +4764,22 @@ var CartService = /** @class */ (function () {
|
|
|
4763
4764
|
_this.updateLocalCart();
|
|
4764
4765
|
_this.requestInProcess.next(false);
|
|
4765
4766
|
};
|
|
4766
|
-
this.updateCartItemQuantity = function (variant_id, quantity) {
|
|
4767
|
-
var
|
|
4767
|
+
this.updateCartItemQuantity = function (variant_id, quantity, comments) {
|
|
4768
|
+
var normalizedComments = comments !== undefined ? ((comments !== null && comments !== void 0 ? comments : '')).trim() : undefined;
|
|
4769
|
+
var newItems = _this.items.map(function (it) {
|
|
4770
|
+
if (it.variant_id !== variant_id)
|
|
4771
|
+
return it;
|
|
4772
|
+
var updated = __assign$a(__assign$a({}, it), { quantity: Number(quantity) });
|
|
4773
|
+
if (normalizedComments !== undefined) {
|
|
4774
|
+
updated.comments = normalizedComments;
|
|
4775
|
+
}
|
|
4776
|
+
return updated;
|
|
4777
|
+
});
|
|
4778
|
+
_this.items = newItems;
|
|
4768
4779
|
_this.cartItemsSubject.next(_this.items);
|
|
4769
4780
|
_this.requestInProcess.next(false);
|
|
4770
4781
|
_this.updateLocalCart();
|
|
4771
|
-
_this.toastrService.show('product-updated', { quantity:
|
|
4782
|
+
_this.toastrService.show('product-updated', { quantity: quantity });
|
|
4772
4783
|
};
|
|
4773
4784
|
this.appendToCart = function (cart) {
|
|
4774
4785
|
_this.updateCartObj(cart);
|
|
@@ -4790,11 +4801,11 @@ var CartService = /** @class */ (function () {
|
|
|
4790
4801
|
// this.googleAnalytics.removeFromCart(product);
|
|
4791
4802
|
_this.analyticsService.callEvent('remove_from_cart', __assign$a(__assign$a({}, product), { currency: _this.consts.currency.code }));
|
|
4792
4803
|
};
|
|
4793
|
-
this.addIfAllreadyExists = function (product, variant_id, quantityAdd) {
|
|
4804
|
+
this.addIfAllreadyExists = function (product, variant_id, quantityAdd, comments) {
|
|
4794
4805
|
if (quantityAdd === void 0) { quantityAdd = 1; }
|
|
4795
4806
|
return _this.items.find(function (item, index) {
|
|
4796
4807
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4797
|
-
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd);
|
|
4808
|
+
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd, comments);
|
|
4798
4809
|
return true;
|
|
4799
4810
|
}
|
|
4800
4811
|
return false;
|
|
@@ -4848,7 +4859,7 @@ var CartService = /** @class */ (function () {
|
|
|
4848
4859
|
return;
|
|
4849
4860
|
}
|
|
4850
4861
|
_this.requestInProcess.next(true);
|
|
4851
|
-
var added = _this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4862
|
+
var added = _this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4852
4863
|
if (!added) {
|
|
4853
4864
|
var payload = {
|
|
4854
4865
|
productCode: product.id,
|
|
@@ -4888,7 +4899,7 @@ var CartService = /** @class */ (function () {
|
|
|
4888
4899
|
!added && _this.connection.post(_this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id, id: id || '', order_item_id: order_item_id || '', lot_quantity: lot_quantity || '', unit_price: unit_price || '', unit_total: unit_total || '', ajustement_total: ajustement_total || '', total_lot: total_lot || '', lot_status: lot_status || '', date_request: date_request || '', notes: notes || '', shipping_address_id: shipping_address_id || '', shipping_address_name: shipping_address_name || '', action: action || 'newlot' })
|
|
4889
4900
|
.subscribe(function (res) { return _this.appendToCart(res); }, function (err) { return _this.handleError(err); });
|
|
4890
4901
|
};
|
|
4891
|
-
this.addToCartPromise = function (product, quantity, variant_id) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4902
|
+
this.addToCartPromise = function (product, quantity, variant_id, comments) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4892
4903
|
var added, result;
|
|
4893
4904
|
return __generator$5(this, function (_a) {
|
|
4894
4905
|
switch (_a.label) {
|
|
@@ -4898,7 +4909,7 @@ var CartService = /** @class */ (function () {
|
|
|
4898
4909
|
return [2 /*return*/];
|
|
4899
4910
|
}
|
|
4900
4911
|
this.requestInProcess.next(true);
|
|
4901
|
-
added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4912
|
+
added = this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4902
4913
|
if (!!added) return [3 /*break*/, 2];
|
|
4903
4914
|
return [4 /*yield*/, (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise())];
|
|
4904
4915
|
case 1:
|
|
@@ -4944,13 +4955,18 @@ var CartService = /** @class */ (function () {
|
|
|
4944
4955
|
items = items.filter(function (itemParam) { return !_this.items.find(function (item) { return itemParam.variantCode == item.variant_id; }); });
|
|
4945
4956
|
return __spread$3(items, paramsMerge);
|
|
4946
4957
|
};
|
|
4947
|
-
this.updateItemQuantity = function (item, quantity) {
|
|
4958
|
+
this.updateItemQuantity = function (item, quantity, comments) {
|
|
4948
4959
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4949
4960
|
_this.requestInProcess.next(true);
|
|
4961
|
+
var payload = { quantity: Number(quantity) };
|
|
4962
|
+
if (comments !== undefined) {
|
|
4963
|
+
var cleaned = ((comments !== null && comments !== void 0 ? comments : '')).trim();
|
|
4964
|
+
payload.comments = cleaned;
|
|
4965
|
+
}
|
|
4950
4966
|
_this.connection
|
|
4951
|
-
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)),
|
|
4967
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), payload)
|
|
4952
4968
|
.pipe(finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4953
|
-
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4969
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity), comments); }, function (err) { return _this.handleError(err); });
|
|
4954
4970
|
}
|
|
4955
4971
|
};
|
|
4956
4972
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7597,7 +7613,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7597
7613
|
};
|
|
7598
7614
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7599
7615
|
var _this = this;
|
|
7600
|
-
var _a;
|
|
7616
|
+
var _a, _b, _c;
|
|
7601
7617
|
if (this.cartLoading) {
|
|
7602
7618
|
return;
|
|
7603
7619
|
}
|
|
@@ -7617,10 +7633,11 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7617
7633
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
7618
7634
|
}
|
|
7619
7635
|
}
|
|
7636
|
+
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
7620
7637
|
if (id) {
|
|
7621
7638
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
7622
7639
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7623
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7640
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
7624
7641
|
}
|
|
7625
7642
|
else {
|
|
7626
7643
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -7631,7 +7648,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7631
7648
|
}
|
|
7632
7649
|
else {
|
|
7633
7650
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7634
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7651
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
7635
7652
|
}
|
|
7636
7653
|
else {
|
|
7637
7654
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -11206,6 +11223,22 @@ var __decorate$14 = (this && this.__decorate) || function (decorators, target, k
|
|
|
11206
11223
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11207
11224
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11208
11225
|
};
|
|
11226
|
+
var __read$7 = (this && this.__read) || function (o, n) {
|
|
11227
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11228
|
+
if (!m) return o;
|
|
11229
|
+
var i = m.call(o), r, ar = [], e;
|
|
11230
|
+
try {
|
|
11231
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11232
|
+
}
|
|
11233
|
+
catch (error) { e = { error: error }; }
|
|
11234
|
+
finally {
|
|
11235
|
+
try {
|
|
11236
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
11237
|
+
}
|
|
11238
|
+
finally { if (e) throw e.error; }
|
|
11239
|
+
}
|
|
11240
|
+
return ar;
|
|
11241
|
+
};
|
|
11209
11242
|
var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
11210
11243
|
__extends$w(ProductDetailEcComponent, _super);
|
|
11211
11244
|
function ProductDetailEcComponent(productService, consts, activedRoute, cartService, optionsService, productsService, analyticsService, router, toastrService, meta, injector) {
|
|
@@ -11234,7 +11267,8 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11234
11267
|
_this.enableFieldNotesInArticleFile = false;
|
|
11235
11268
|
_this.addToCart = function () {
|
|
11236
11269
|
var _a;
|
|
11237
|
-
|
|
11270
|
+
var note = ((_a = _this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null;
|
|
11271
|
+
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, note);
|
|
11238
11272
|
};
|
|
11239
11273
|
_this.addAllProductosToCart = function () {
|
|
11240
11274
|
var _a, _b;
|
|
@@ -11358,7 +11392,31 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11358
11392
|
return cadena.replace(expresionRegular, '');
|
|
11359
11393
|
};
|
|
11360
11394
|
ProductDetailEcComponent.prototype.ngOnInit = function () {
|
|
11395
|
+
var _this = this;
|
|
11361
11396
|
this.ecOnInit();
|
|
11397
|
+
// Prellenar comentarios cuando:
|
|
11398
|
+
// - cargue el producto
|
|
11399
|
+
// - cambie la variante seleccionada (asociatedData$)
|
|
11400
|
+
// - cambien los ítems del carrito
|
|
11401
|
+
this.prefillSub = combineLatest([
|
|
11402
|
+
this.productService.product$.pipe(filter(function (p) { return !!p && !!p.id; })),
|
|
11403
|
+
this.productService.asociatedData$.pipe(startWith(null)),
|
|
11404
|
+
this.cartService.cartItems.pipe(startWith([])),
|
|
11405
|
+
]).subscribe(function (_a) {
|
|
11406
|
+
var _b = __read$7(_a, 3), product = _b[0], data = _b[1], items = _b[2];
|
|
11407
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
11408
|
+
var variantId = (_k = (_f = (_d = (_c = data) === null || _c === void 0 ? void 0 : _c.variantCode, (_d !== null && _d !== void 0 ? _d : (_e = data) === null || _e === void 0 ? void 0 : _e.variant_id)), (_f !== null && _f !== void 0 ? _f : (_j = (_h = (_g = product) === null || _g === void 0 ? void 0 : _g.variants) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.code)), (_k !== null && _k !== void 0 ? _k : null));
|
|
11409
|
+
var match = (_l = items) === null || _l === void 0 ? void 0 : _l.find(function (it) {
|
|
11410
|
+
var _a, _b, _c, _d;
|
|
11411
|
+
return ((_b = (_a = it) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.id) === ((_c = product) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
11412
|
+
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
11413
|
+
});
|
|
11414
|
+
_this.comments = (_o = (_m = match) === null || _m === void 0 ? void 0 : _m.comments, (_o !== null && _o !== void 0 ? _o : ''));
|
|
11415
|
+
});
|
|
11416
|
+
};
|
|
11417
|
+
ProductDetailEcComponent.prototype.ngOnDestroy = function () {
|
|
11418
|
+
var _a;
|
|
11419
|
+
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11362
11420
|
};
|
|
11363
11421
|
ProductDetailEcComponent.prototype.scroll = function () {
|
|
11364
11422
|
var el = this.contact.nativeElement;
|
|
@@ -11507,7 +11565,6 @@ var ProductEcComponent = /** @class */ (function (_super) {
|
|
|
11507
11565
|
ProductEcComponent.prototype.ngOnChanges = function () {
|
|
11508
11566
|
};
|
|
11509
11567
|
ProductEcComponent.prototype.selectItem = function (product) {
|
|
11510
|
-
console.log('entro');
|
|
11511
11568
|
this.analyticsService.callEvent('select_item', product);
|
|
11512
11569
|
};
|
|
11513
11570
|
ProductEcComponent.ctorParameters = function () { return [
|
|
@@ -12778,7 +12835,7 @@ var __decorate$1g = (this && this.__decorate) || function (decorators, target, k
|
|
|
12778
12835
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12779
12836
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12780
12837
|
};
|
|
12781
|
-
var __read$
|
|
12838
|
+
var __read$8 = (this && this.__read) || function (o, n) {
|
|
12782
12839
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
12783
12840
|
if (!m) return o;
|
|
12784
12841
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -12822,7 +12879,7 @@ var RedsysCatchEcComponent = /** @class */ (function (_super) {
|
|
|
12822
12879
|
var _this = this;
|
|
12823
12880
|
var state;
|
|
12824
12881
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
12825
|
-
var _b = __read$
|
|
12882
|
+
var _b = __read$8(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
12826
12883
|
state = queryRouter.state;
|
|
12827
12884
|
state && state == 'statuspayment' && (state = queryParams.status);
|
|
12828
12885
|
console.log('PARAMETROS STATE -> ', state);
|
|
@@ -15445,12 +15502,10 @@ var PaypalExpressEcComponent = /** @class */ (function (_super) {
|
|
|
15445
15502
|
_this.loading = false;
|
|
15446
15503
|
}
|
|
15447
15504
|
else {
|
|
15448
|
-
/* console.log('Entro al else'); */
|
|
15449
15505
|
_this.renderPayPal();
|
|
15450
15506
|
}
|
|
15451
15507
|
}
|
|
15452
15508
|
catch (error) {
|
|
15453
|
-
/* console.log('Entro al catch'); */
|
|
15454
15509
|
_this.renderPayPal();
|
|
15455
15510
|
}
|
|
15456
15511
|
}, 1000);
|
|
@@ -16039,6 +16094,9 @@ var SelectChannelEcComponent = /** @class */ (function (_super) {
|
|
|
16039
16094
|
_this.modalService = modalService;
|
|
16040
16095
|
_this.router = router;
|
|
16041
16096
|
_this.channels = [];
|
|
16097
|
+
_this.unloadHandler = function () {
|
|
16098
|
+
_this.authService.logout();
|
|
16099
|
+
};
|
|
16042
16100
|
_this.navigateByUrl = function () {
|
|
16043
16101
|
_this.router.navigateByUrl('');
|
|
16044
16102
|
};
|
|
@@ -16052,7 +16110,9 @@ var SelectChannelEcComponent = /** @class */ (function (_super) {
|
|
|
16052
16110
|
_this.bsModalRef = _this.modalService.show(_this.template, { class: 'modal modal-dialog-centered ', keyboard: false, backdrop: 'static', animated: true });
|
|
16053
16111
|
_this.subsModal = _this.modalService.onHide.subscribe(function (onClose) {
|
|
16054
16112
|
_this.bsModalRef = null;
|
|
16113
|
+
window.removeEventListener('unload', _this.unloadHandler);
|
|
16055
16114
|
});
|
|
16115
|
+
window.addEventListener('unload', _this.unloadHandler);
|
|
16056
16116
|
}
|
|
16057
16117
|
};
|
|
16058
16118
|
_this.setSelect = function (chanelSelect) {
|
|
@@ -16066,6 +16126,7 @@ var SelectChannelEcComponent = /** @class */ (function (_super) {
|
|
|
16066
16126
|
if (_this.channels.find(function (chanel) { return chanel.selected; })) {
|
|
16067
16127
|
_this.authService.channelAccess(_this.channels.find(function (chanel) { return chanel.selected; }));
|
|
16068
16128
|
_this.bsModalRef.hide();
|
|
16129
|
+
window.removeEventListener('unload', _this.unloadHandler);
|
|
16069
16130
|
}
|
|
16070
16131
|
};
|
|
16071
16132
|
return _this;
|
|
@@ -16084,6 +16145,7 @@ var SelectChannelEcComponent = /** @class */ (function (_super) {
|
|
|
16084
16145
|
var _a, _b;
|
|
16085
16146
|
(_a = this.subs) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
16086
16147
|
(_b = this.subsModal) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
16148
|
+
window.removeEventListener('unload', this.unloadHandler);
|
|
16087
16149
|
};
|
|
16088
16150
|
SelectChannelEcComponent.ctorParameters = function () { return [
|
|
16089
16151
|
{ type: AuthService },
|
|
@@ -16123,7 +16185,7 @@ var __decorate$1D = (this && this.__decorate) || function (decorators, target, k
|
|
|
16123
16185
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16124
16186
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16125
16187
|
};
|
|
16126
|
-
var __read$
|
|
16188
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
16127
16189
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16128
16190
|
if (!m) return o;
|
|
16129
16191
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -16155,7 +16217,7 @@ var CartLoadEcComponent = /** @class */ (function (_super) {
|
|
|
16155
16217
|
var _this = this;
|
|
16156
16218
|
var token;
|
|
16157
16219
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
16158
|
-
var _b = __read$
|
|
16220
|
+
var _b = __read$9(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
16159
16221
|
token = queryRouter.token;
|
|
16160
16222
|
console.log('PARAMETROS token -> ', token);
|
|
16161
16223
|
_this.cartService.loadCartByToken(token).then(function (res) {
|
|
@@ -19301,7 +19363,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19301
19363
|
});
|
|
19302
19364
|
};
|
|
19303
19365
|
SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
19304
|
-
var _a;
|
|
19366
|
+
var _a, _b, _c;
|
|
19305
19367
|
if (this.cartLoading) {
|
|
19306
19368
|
return;
|
|
19307
19369
|
}
|
|
@@ -19321,13 +19383,14 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19321
19383
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
19322
19384
|
}
|
|
19323
19385
|
}
|
|
19386
|
+
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
19324
19387
|
if (id) {
|
|
19325
19388
|
var elem_1 = document.getElementById(id);
|
|
19326
19389
|
if (elem_1) {
|
|
19327
19390
|
elem_1.disabled = true;
|
|
19328
19391
|
}
|
|
19329
19392
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19330
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19393
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
19331
19394
|
}
|
|
19332
19395
|
else {
|
|
19333
19396
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -19340,7 +19403,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19340
19403
|
}
|
|
19341
19404
|
else {
|
|
19342
19405
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19343
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19406
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
19344
19407
|
}
|
|
19345
19408
|
}
|
|
19346
19409
|
};
|
|
@@ -20139,7 +20202,7 @@ var __decorate$27 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20139
20202
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20140
20203
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20141
20204
|
};
|
|
20142
|
-
var __read$
|
|
20205
|
+
var __read$a = (this && this.__read) || function (o, n) {
|
|
20143
20206
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20144
20207
|
if (!m) return o;
|
|
20145
20208
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -20205,7 +20268,7 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20205
20268
|
var forceShow = mode === 'alwaysShowDecimals';
|
|
20206
20269
|
var forceHide = mode === 'alwaysHideDecimals';
|
|
20207
20270
|
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20208
|
-
var _b = __read$
|
|
20271
|
+
var _b = __read$a((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20209
20272
|
if (showDecimals) {
|
|
20210
20273
|
if (dec.length > 2)
|
|
20211
20274
|
dec = dec.slice(0, 2);
|