ng-easycommerce 0.0.628 → 0.0.629

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.629
2
+ - ajustar límites de precios en el filtro y restablecer valores seleccionados
1
3
  # version 0.0.628
2
4
  - Se ajustó el método `less` en `product-detail.component` para que reciba y aplique correctamente la cantidad mínima (`minimumItemsQuantity`), evitando que la cantidad seleccionada del producto pueda ser inferior al mínimo establecido.
3
5
  # version 0.0.627
@@ -1563,8 +1563,8 @@
1563
1563
  };
1564
1564
  // Método para actualizar los valores seleccionados
1565
1565
  _this.setSelected = function (min, max) {
1566
- _this.currentMinPrice = min;
1567
- _this.currentMaxPrice = max;
1566
+ _this.currentMinPrice = (min !== _this.minPrice) ? min : null;
1567
+ _this.currentMaxPrice = (max !== _this.maxPrice) ? max : null;
1568
1568
  };
1569
1569
  // Retorna los valores seleccionados (rango de precios)
1570
1570
  _this.getSelectedRange = function () {
@@ -1594,6 +1594,12 @@
1594
1594
  PriceRangeFilter.prototype.updatePrices = function (min, max) {
1595
1595
  this.minPrice = min;
1596
1596
  this.maxPrice = max;
1597
+ if (this.currentMinPrice !== null && (this.currentMinPrice < min || this.currentMinPrice > max)) {
1598
+ this.currentMinPrice = null;
1599
+ }
1600
+ if (this.currentMaxPrice !== null && (this.currentMaxPrice > max || this.currentMaxPrice < min)) {
1601
+ this.currentMaxPrice = null;
1602
+ }
1597
1603
  };
1598
1604
  return PriceRangeFilter;
1599
1605
  }(Filter));
@@ -2017,7 +2023,9 @@
2017
2023
  this.getTotal = function () { return _this.pagination.total; };
2018
2024
  // Suscribirse a los cambios en el rango de precios
2019
2025
  this.pagination.priceRange$.subscribe(function (range) {
2020
- _this.updatePriceRangeFilter(range.price_min, range.price_max);
2026
+ var min = Math.floor(range.price_min);
2027
+ var max = Math.ceil(range.price_max);
2028
+ _this.updatePriceRangeFilter(min, max);
2021
2029
  });
2022
2030
  }
2023
2031
  ProductsService.prototype.updatePriceRangeFilter = function (min, max) {