ng-easycommerce 0.0.626 → 0.0.628
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 +4 -0
- package/bundles/ng-easycommerce.umd.js +27 -4
- 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 +3 -3
- package/esm2015/lib/ec-component/filters-ec/filters-ec.component.js +20 -1
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +6 -3
- package/esm5/lib/classes/filters/PriceRangeFilter.js +3 -3
- package/esm5/lib/ec-component/filters-ec/filters-ec.component.js +20 -1
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +7 -3
- package/fesm2015/ng-easycommerce.js +26 -4
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +27 -4
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/filters-ec/filters-ec.component.d.ts +1 -0
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +1 -1
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -1590,10 +1590,10 @@ var PriceRangeFilter = /** @class */ (function (_super) {
|
|
|
1590
1590
|
// Genera los parámetros de la URL en base al rango de precios seleccionado
|
|
1591
1591
|
_this.toUrlParams = function () {
|
|
1592
1592
|
var params = '';
|
|
1593
|
-
if (_this.currentMinPrice !== null) {
|
|
1593
|
+
if (_this.currentMinPrice !== null && _this.currentMinPrice !== _this.minPrice) {
|
|
1594
1594
|
params += "&price_min=" + _this.currentMinPrice;
|
|
1595
1595
|
}
|
|
1596
|
-
if (_this.currentMaxPrice !== null) {
|
|
1596
|
+
if (_this.currentMaxPrice !== null && _this.currentMaxPrice !== _this.maxPrice) {
|
|
1597
1597
|
params += "&price_max=" + _this.currentMaxPrice;
|
|
1598
1598
|
}
|
|
1599
1599
|
return params;
|
|
@@ -9616,6 +9616,25 @@ var FiltersEcComponent = /** @class */ (function (_super) {
|
|
|
9616
9616
|
filter.currentMinPrice = currentMin;
|
|
9617
9617
|
}
|
|
9618
9618
|
};
|
|
9619
|
+
FiltersEcComponent.prototype.hasAppliedFilters = function () {
|
|
9620
|
+
var _a, _b;
|
|
9621
|
+
return _b = (_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (filter) {
|
|
9622
|
+
var _a, _b, _c;
|
|
9623
|
+
if (((_b = (_a = filter).type) === null || _b === void 0 ? void 0 : _b.call(_a)) === 'price_range') {
|
|
9624
|
+
var minSet = filter.currentMinPrice !== null && filter.currentMinPrice !== 0;
|
|
9625
|
+
var maxSet = filter.currentMaxPrice !== null && filter.currentMaxPrice !== filter.maxPrice;
|
|
9626
|
+
if (minSet || maxSet) {
|
|
9627
|
+
return true;
|
|
9628
|
+
}
|
|
9629
|
+
}
|
|
9630
|
+
return (_c = filter.data) === null || _c === void 0 ? void 0 : _c.some(function (filterElement) {
|
|
9631
|
+
if (Array.isArray(filterElement.children)) {
|
|
9632
|
+
return filterElement.children.some(function (child) { return child.selected; });
|
|
9633
|
+
}
|
|
9634
|
+
return filterElement.selected;
|
|
9635
|
+
});
|
|
9636
|
+
}), (_b !== null && _b !== void 0 ? _b : false);
|
|
9637
|
+
};
|
|
9619
9638
|
FiltersEcComponent.ctorParameters = function () { return [
|
|
9620
9639
|
{ type: Constants },
|
|
9621
9640
|
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
@@ -11049,8 +11068,9 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11049
11068
|
* @param changeAmount cantidad que se quiere restar.
|
|
11050
11069
|
* @param forceMultiple si es true, obliga a que el resultado sea múltiplo de changeAmount.
|
|
11051
11070
|
*/
|
|
11052
|
-
_this.less = function (changeAmount, forceMultiple) {
|
|
11071
|
+
_this.less = function (changeAmount, minimum, forceMultiple) {
|
|
11053
11072
|
if (changeAmount === void 0) { changeAmount = 1; }
|
|
11073
|
+
if (minimum === void 0) { minimum = 1; }
|
|
11054
11074
|
if (forceMultiple === void 0) { forceMultiple = false; }
|
|
11055
11075
|
var newQuantity = _this.quantity - changeAmount;
|
|
11056
11076
|
if (forceMultiple && changeAmount > 0) {
|
|
@@ -11064,9 +11084,12 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11064
11084
|
newQuantity = changeAmount;
|
|
11065
11085
|
}
|
|
11066
11086
|
}
|
|
11067
|
-
if (newQuantity >=
|
|
11087
|
+
if (newQuantity >= minimum) {
|
|
11068
11088
|
_this.quantity = newQuantity;
|
|
11069
11089
|
}
|
|
11090
|
+
else {
|
|
11091
|
+
_this.quantity = minimum;
|
|
11092
|
+
}
|
|
11070
11093
|
};
|
|
11071
11094
|
_this.showContact = function () { return _this.show = true; };
|
|
11072
11095
|
_this.hideContact = function () { return _this.show = false; };
|