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.
@@ -6112,15 +6112,28 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
6112
6112
  this.channel = {};
6113
6113
  this.updateStock = false;
6114
6114
  this.exitUpdate = false;
6115
+ this.isDisabled = false;
6115
6116
  this.toDecimal = (amount) => this.consts.toDecimal(amount);
6116
6117
  this.actualizarCantidad = (item, cantidad, stock, id) => {
6117
6118
  if (id) {
6118
- document.getElementById(id).disabled = true;
6119
- cantidad > 0 && cantidad <= stock ? this.cartService.updateItemQuantity(item, cantidad) : this.toastrService.show('out-of-stock-actually');
6120
- setTimeout(function () { document.getElementById(id).disabled = false; }, 1000);
6119
+ this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
6120
+ if (cantidad > 0 && cantidad <= stock) {
6121
+ this.cartService.updateItemQuantity(item, cantidad);
6122
+ }
6123
+ else {
6124
+ this.toastrService.show('out-of-stock-actually');
6125
+ }
6126
+ setTimeout(() => {
6127
+ this.isDisabled = false;
6128
+ }, 1000);
6121
6129
  }
6122
6130
  else {
6123
- cantidad > 0 && cantidad <= stock ? this.cartService.updateItemQuantity(item, cantidad) : this.toastrService.show('out-of-stock-actually');
6131
+ if (cantidad > 0 && cantidad <= stock) {
6132
+ this.cartService.updateItemQuantity(item, cantidad);
6133
+ }
6134
+ else {
6135
+ this.toastrService.show('out-of-stock-actually');
6136
+ }
6124
6137
  }
6125
6138
  };
6126
6139
  this.redirectRegister = () => this.router.navigateByUrl(`/auth/login`);
@@ -7823,7 +7836,7 @@ var __decorate$_ = (this && this.__decorate) || function (decorators, target, ke
7823
7836
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7824
7837
  };
7825
7838
  let HeaderEcComponent = class HeaderEcComponent extends ComponentHelper {
7826
- constructor(router, consts, cartService, optionsService, paramsService, productsService, authService, translate, renderer) {
7839
+ constructor(router, consts, cartService, optionsService, paramsService, productsService, authService, translate, renderer, channelConfigService) {
7827
7840
  super();
7828
7841
  this.router = router;
7829
7842
  this.consts = consts;
@@ -7834,6 +7847,7 @@ let HeaderEcComponent = class HeaderEcComponent extends ComponentHelper {
7834
7847
  this.authService = authService;
7835
7848
  this.translate = translate;
7836
7849
  this.renderer = renderer;
7850
+ this.channelConfigService = channelConfigService;
7837
7851
  //og elden
7838
7852
  this.menuItems = [];
7839
7853
  this.menuItemsSections = [];
@@ -7843,6 +7857,8 @@ let HeaderEcComponent = class HeaderEcComponent extends ComponentHelper {
7843
7857
  this.envetUrlTransparent = ["/home", "/"];
7844
7858
  this.params = {};
7845
7859
  this.toggled = false;
7860
+ this.locales = [];
7861
+ this.selectedLocale = 'ESP';
7846
7862
  this.updateMenuItemSection = (elements) => {
7847
7863
  this.menuItemsSections = this.optionsService.generateMenu(elements);
7848
7864
  this.menuItemsSections = this.ecUpdateMenuItemSection(this.menuItemsSections);
@@ -7950,6 +7966,12 @@ let HeaderEcComponent = class HeaderEcComponent extends ComponentHelper {
7950
7966
  this.mediaMenu = mediaQuery.matches;
7951
7967
  this.subscribeToBalance();
7952
7968
  this.ecOnInit();
7969
+ this.channelConfigService.locales.subscribe((res) => {
7970
+ this.locales = res;
7971
+ if (this.locales.length > 0) {
7972
+ this.selectedLocale = this.locales[0].name;
7973
+ }
7974
+ });
7953
7975
  }
7954
7976
  subscribeToBalance() {
7955
7977
  this.balanceSubscription = this.cartService.balanceCustomer$.subscribe(balanceData => {
@@ -7966,7 +7988,8 @@ HeaderEcComponent.ctorParameters = () => [
7966
7988
  { type: ProductsService },
7967
7989
  { type: AuthService },
7968
7990
  { type: TranslateService },
7969
- { type: Renderer2 }
7991
+ { type: Renderer2 },
7992
+ { type: ChannelConfigService }
7970
7993
  ];
7971
7994
  __decorate$_([
7972
7995
  ViewChild("menu")
@@ -15342,16 +15365,29 @@ var __decorate$1_ = (this && this.__decorate) || function (decorators, target, k
15342
15365
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15343
15366
  };
15344
15367
  let SidebarEcComponent = class SidebarEcComponent {
15345
- constructor(cartService, consts, authService, router) {
15368
+ constructor(cartService, consts, authService, router, toastrService) {
15346
15369
  this.cartService = cartService;
15347
15370
  this.consts = consts;
15348
15371
  this.authService = authService;
15349
15372
  this.router = router;
15373
+ this.toastrService = toastrService;
15350
15374
  this.user = null;
15351
15375
  this.promotions = [];
15352
15376
  this.variantsToShow = ['TALLE', 'COLOR'];
15353
- this.actualizarCantidad = (item, cantidad, stock) => {
15354
- cantidad > 0 && cantidad <= stock && this.cartService.updateItemQuantity(item, cantidad);
15377
+ this.actualizarCantidad = (item, cantidad, stock, id) => {
15378
+ if (id) {
15379
+ const elem = document.getElementById(id);
15380
+ elem.disabled = true;
15381
+ cantidad > 0 && cantidad <= stock
15382
+ ? this.cartService.updateItemQuantity(item, cantidad)
15383
+ : this.toastrService.show('out-of-stock-actually');
15384
+ setTimeout(function () {
15385
+ elem.disabled = false;
15386
+ }, 1000);
15387
+ }
15388
+ else {
15389
+ cantidad > 0 && cantidad <= stock && this.cartService.updateItemQuantity(item, cantidad);
15390
+ }
15355
15391
  };
15356
15392
  this.getVariants = product => {
15357
15393
  let item = product.product;
@@ -15421,7 +15457,8 @@ SidebarEcComponent.ctorParameters = () => [
15421
15457
  { type: CartService },
15422
15458
  { type: Constants },
15423
15459
  { type: AuthService },
15424
- { type: Router }
15460
+ { type: Router },
15461
+ { type: ToastService }
15425
15462
  ];
15426
15463
  SidebarEcComponent = __decorate$1_([
15427
15464
  Component({