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 CHANGED
@@ -1,3 +1,5 @@
1
+ # version 0.0.580
2
+ - funciones para bloquear botones de cantidad en sidebar y cart.
1
3
  # version 0.0.579
2
4
  - Mejora la apariencia del componente `password-reset-ec.component.html`
3
5
  # version 0.0.577 y 0.0.578
@@ -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
- document.getElementById(id).disabled = true;
7285
- cantidad > 0 && cantidad <= stock ? _this.cartService.updateItemQuantity(item, cantidad) : _this.toastrService.show('out-of-stock-actually');
7286
- setTimeout(function () { document.getElementById(id).disabled = false; }, 1000);
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 ? _this.cartService.updateItemQuantity(item, cantidad) : _this.toastrService.show('out-of-stock-actually');
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
- cantidad > 0 && cantidad <= stock && _this.cartService.updateItemQuantity(item, cantidad);
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({