ng-easycommerce 0.0.579 → 0.0.580
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 +2 -0
- package/bundles/ng-easycommerce.umd.js +35 -8
- 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/ec-component/cart-ec/cart-ec.component.js +18 -5
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +20 -5
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +18 -5
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +20 -5
- package/fesm2015/ng-easycommerce.js +35 -8
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +35 -8
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +4 -2
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7278,15 +7278,28 @@
|
|
|
7278
7278
|
_this.channel = {};
|
|
7279
7279
|
_this.updateStock = false;
|
|
7280
7280
|
_this.exitUpdate = false;
|
|
7281
|
+
_this.isDisabled = false;
|
|
7281
7282
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7282
7283
|
_this.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7283
7284
|
if (id) {
|
|
7284
|
-
|
|
7285
|
-
cantidad > 0 && cantidad <= stock
|
|
7286
|
-
|
|
7285
|
+
_this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
7286
|
+
if (cantidad > 0 && cantidad <= stock) {
|
|
7287
|
+
_this.cartService.updateItemQuantity(item, cantidad);
|
|
7288
|
+
}
|
|
7289
|
+
else {
|
|
7290
|
+
_this.toastrService.show('out-of-stock-actually');
|
|
7291
|
+
}
|
|
7292
|
+
setTimeout(function () {
|
|
7293
|
+
_this.isDisabled = false;
|
|
7294
|
+
}, 1000);
|
|
7287
7295
|
}
|
|
7288
7296
|
else {
|
|
7289
|
-
cantidad > 0 && cantidad <= stock
|
|
7297
|
+
if (cantidad > 0 && cantidad <= stock) {
|
|
7298
|
+
_this.cartService.updateItemQuantity(item, cantidad);
|
|
7299
|
+
}
|
|
7300
|
+
else {
|
|
7301
|
+
_this.toastrService.show('out-of-stock-actually');
|
|
7302
|
+
}
|
|
7290
7303
|
}
|
|
7291
7304
|
};
|
|
7292
7305
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
@@ -18233,17 +18246,30 @@
|
|
|
18233
18246
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18234
18247
|
};
|
|
18235
18248
|
var SidebarEcComponent = /** @class */ (function () {
|
|
18236
|
-
function SidebarEcComponent(cartService, consts, authService, router) {
|
|
18249
|
+
function SidebarEcComponent(cartService, consts, authService, router, toastrService) {
|
|
18237
18250
|
var _this = this;
|
|
18238
18251
|
this.cartService = cartService;
|
|
18239
18252
|
this.consts = consts;
|
|
18240
18253
|
this.authService = authService;
|
|
18241
18254
|
this.router = router;
|
|
18255
|
+
this.toastrService = toastrService;
|
|
18242
18256
|
this.user = null;
|
|
18243
18257
|
this.promotions = [];
|
|
18244
18258
|
this.variantsToShow = ['TALLE', 'COLOR'];
|
|
18245
|
-
this.actualizarCantidad = function (item, cantidad, stock) {
|
|
18246
|
-
|
|
18259
|
+
this.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
18260
|
+
if (id) {
|
|
18261
|
+
var elem_1 = document.getElementById(id);
|
|
18262
|
+
elem_1.disabled = true;
|
|
18263
|
+
cantidad > 0 && cantidad <= stock
|
|
18264
|
+
? _this.cartService.updateItemQuantity(item, cantidad)
|
|
18265
|
+
: _this.toastrService.show('out-of-stock-actually');
|
|
18266
|
+
setTimeout(function () {
|
|
18267
|
+
elem_1.disabled = false;
|
|
18268
|
+
}, 1000);
|
|
18269
|
+
}
|
|
18270
|
+
else {
|
|
18271
|
+
cantidad > 0 && cantidad <= stock && _this.cartService.updateItemQuantity(item, cantidad);
|
|
18272
|
+
}
|
|
18247
18273
|
};
|
|
18248
18274
|
this.getVariants = function (product) {
|
|
18249
18275
|
var item = product.product;
|
|
@@ -18313,7 +18339,8 @@
|
|
|
18313
18339
|
{ type: CartService },
|
|
18314
18340
|
{ type: Constants },
|
|
18315
18341
|
{ type: AuthService },
|
|
18316
|
-
{ type: router.Router }
|
|
18342
|
+
{ type: router.Router },
|
|
18343
|
+
{ type: ToastService }
|
|
18317
18344
|
]; };
|
|
18318
18345
|
SidebarEcComponent = __decorate$1_([
|
|
18319
18346
|
core.Component({
|