ng-easycommerce 0.0.579 → 0.0.581

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,7 @@
1
+ # version 0.0.581
2
+ - Se añadió el servicio `ChannelConfigService` y una variable `locales` en `header-ec.component`, para controlar los idiomas desde el header.
3
+ # version 0.0.580
4
+ - funciones para bloquear botones de cantidad en sidebar y cart.
1
5
  # version 0.0.579
2
6
  - Mejora la apariencia del componente `password-reset-ec.component.html`
3
7
  # 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"); };
@@ -9510,7 +9523,7 @@
9510
9523
  };
9511
9524
  var HeaderEcComponent = /** @class */ (function (_super) {
9512
9525
  __extends$t(HeaderEcComponent, _super);
9513
- function HeaderEcComponent(router$1, consts, cartService, optionsService, paramsService, productsService, authService, translate, renderer) {
9526
+ function HeaderEcComponent(router$1, consts, cartService, optionsService, paramsService, productsService, authService, translate, renderer, channelConfigService) {
9514
9527
  var _this = _super.call(this) || this;
9515
9528
  _this.router = router$1;
9516
9529
  _this.consts = consts;
@@ -9521,6 +9534,7 @@
9521
9534
  _this.authService = authService;
9522
9535
  _this.translate = translate;
9523
9536
  _this.renderer = renderer;
9537
+ _this.channelConfigService = channelConfigService;
9524
9538
  //og elden
9525
9539
  _this.menuItems = [];
9526
9540
  _this.menuItemsSections = [];
@@ -9530,6 +9544,8 @@
9530
9544
  _this.envetUrlTransparent = ["/home", "/"];
9531
9545
  _this.params = {};
9532
9546
  _this.toggled = false;
9547
+ _this.locales = [];
9548
+ _this.selectedLocale = 'ESP';
9533
9549
  _this.updateMenuItemSection = function (elements) {
9534
9550
  _this.menuItemsSections = _this.optionsService.generateMenu(elements);
9535
9551
  _this.menuItemsSections = _this.ecUpdateMenuItemSection(_this.menuItemsSections);
@@ -9649,6 +9665,12 @@
9649
9665
  this.mediaMenu = mediaQuery.matches;
9650
9666
  this.subscribeToBalance();
9651
9667
  this.ecOnInit();
9668
+ this.channelConfigService.locales.subscribe(function (res) {
9669
+ _this.locales = res;
9670
+ if (_this.locales.length > 0) {
9671
+ _this.selectedLocale = _this.locales[0].name;
9672
+ }
9673
+ });
9652
9674
  };
9653
9675
  HeaderEcComponent.prototype.subscribeToBalance = function () {
9654
9676
  var _this = this;
@@ -9665,7 +9687,8 @@
9665
9687
  { type: ProductsService },
9666
9688
  { type: AuthService },
9667
9689
  { type: core$1.TranslateService },
9668
- { type: core.Renderer2 }
9690
+ { type: core.Renderer2 },
9691
+ { type: ChannelConfigService }
9669
9692
  ]; };
9670
9693
  __decorate$_([
9671
9694
  core.ViewChild("menu")
@@ -18233,17 +18256,30 @@
18233
18256
  return c > 3 && r && Object.defineProperty(target, key, r), r;
18234
18257
  };
18235
18258
  var SidebarEcComponent = /** @class */ (function () {
18236
- function SidebarEcComponent(cartService, consts, authService, router) {
18259
+ function SidebarEcComponent(cartService, consts, authService, router, toastrService) {
18237
18260
  var _this = this;
18238
18261
  this.cartService = cartService;
18239
18262
  this.consts = consts;
18240
18263
  this.authService = authService;
18241
18264
  this.router = router;
18265
+ this.toastrService = toastrService;
18242
18266
  this.user = null;
18243
18267
  this.promotions = [];
18244
18268
  this.variantsToShow = ['TALLE', 'COLOR'];
18245
- this.actualizarCantidad = function (item, cantidad, stock) {
18246
- cantidad > 0 && cantidad <= stock && _this.cartService.updateItemQuantity(item, cantidad);
18269
+ this.actualizarCantidad = function (item, cantidad, stock, id) {
18270
+ if (id) {
18271
+ var elem_1 = document.getElementById(id);
18272
+ elem_1.disabled = true;
18273
+ cantidad > 0 && cantidad <= stock
18274
+ ? _this.cartService.updateItemQuantity(item, cantidad)
18275
+ : _this.toastrService.show('out-of-stock-actually');
18276
+ setTimeout(function () {
18277
+ elem_1.disabled = false;
18278
+ }, 1000);
18279
+ }
18280
+ else {
18281
+ cantidad > 0 && cantidad <= stock && _this.cartService.updateItemQuantity(item, cantidad);
18282
+ }
18247
18283
  };
18248
18284
  this.getVariants = function (product) {
18249
18285
  var item = product.product;
@@ -18313,7 +18349,8 @@
18313
18349
  { type: CartService },
18314
18350
  { type: Constants },
18315
18351
  { type: AuthService },
18316
- { type: router.Router }
18352
+ { type: router.Router },
18353
+ { type: ToastService }
18317
18354
  ]; };
18318
18355
  SidebarEcComponent = __decorate$1_([
18319
18356
  core.Component({