ng-easycommerce 0.0.627 → 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.
@@ -1577,8 +1577,8 @@ var PriceRangeFilter = /** @class */ (function (_super) {
1577
1577
  };
1578
1578
  // Método para actualizar los valores seleccionados
1579
1579
  _this.setSelected = function (min, max) {
1580
- _this.currentMinPrice = min;
1581
- _this.currentMaxPrice = max;
1580
+ _this.currentMinPrice = (min !== _this.minPrice) ? min : null;
1581
+ _this.currentMaxPrice = (max !== _this.maxPrice) ? max : null;
1582
1582
  };
1583
1583
  // Retorna los valores seleccionados (rango de precios)
1584
1584
  _this.getSelectedRange = function () {
@@ -1608,6 +1608,12 @@ var PriceRangeFilter = /** @class */ (function (_super) {
1608
1608
  PriceRangeFilter.prototype.updatePrices = function (min, max) {
1609
1609
  this.minPrice = min;
1610
1610
  this.maxPrice = max;
1611
+ if (this.currentMinPrice !== null && (this.currentMinPrice < min || this.currentMinPrice > max)) {
1612
+ this.currentMinPrice = null;
1613
+ }
1614
+ if (this.currentMaxPrice !== null && (this.currentMaxPrice > max || this.currentMaxPrice < min)) {
1615
+ this.currentMaxPrice = null;
1616
+ }
1611
1617
  };
1612
1618
  return PriceRangeFilter;
1613
1619
  }(Filter));
@@ -2031,7 +2037,9 @@ var ProductsService = /** @class */ (function () {
2031
2037
  this.getTotal = function () { return _this.pagination.total; };
2032
2038
  // Suscribirse a los cambios en el rango de precios
2033
2039
  this.pagination.priceRange$.subscribe(function (range) {
2034
- _this.updatePriceRangeFilter(range.price_min, range.price_max);
2040
+ var min = Math.floor(range.price_min);
2041
+ var max = Math.ceil(range.price_max);
2042
+ _this.updatePriceRangeFilter(min, max);
2035
2043
  });
2036
2044
  }
2037
2045
  ProductsService.prototype.updatePriceRangeFilter = function (min, max) {
@@ -11068,8 +11076,9 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
11068
11076
  * @param changeAmount cantidad que se quiere restar.
11069
11077
  * @param forceMultiple si es true, obliga a que el resultado sea múltiplo de changeAmount.
11070
11078
  */
11071
- _this.less = function (changeAmount, forceMultiple) {
11079
+ _this.less = function (changeAmount, minimum, forceMultiple) {
11072
11080
  if (changeAmount === void 0) { changeAmount = 1; }
11081
+ if (minimum === void 0) { minimum = 1; }
11073
11082
  if (forceMultiple === void 0) { forceMultiple = false; }
11074
11083
  var newQuantity = _this.quantity - changeAmount;
11075
11084
  if (forceMultiple && changeAmount > 0) {
@@ -11083,9 +11092,12 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
11083
11092
  newQuantity = changeAmount;
11084
11093
  }
11085
11094
  }
11086
- if (newQuantity >= 1) {
11095
+ if (newQuantity >= minimum) {
11087
11096
  _this.quantity = newQuantity;
11088
11097
  }
11098
+ else {
11099
+ _this.quantity = minimum;
11100
+ }
11089
11101
  };
11090
11102
  _this.showContact = function () { return _this.show = true; };
11091
11103
  _this.hideContact = function () { return _this.show = false; };