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 +2 -0
- package/bundles/ng-easycommerce.umd.js +11 -3
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/classes/filters/PriceRangeFilter.js +9 -3
- package/esm2015/lib/services/products/products.service.js +4 -2
- package/esm5/lib/classes/filters/PriceRangeFilter.js +9 -3
- package/esm5/lib/services/products/products.service.js +4 -2
- package/fesm2015/ng-easycommerce.js +11 -3
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +11 -3
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -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
|
-
|
|
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) {
|