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 CHANGED
@@ -1,3 +1,7 @@
1
+ # version 0.0.628
2
+ - 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
+ # version 0.0.627
4
+ - En el componente `filters-ec.component` se agrego un metodo `hasAppliedFilters` para verificar si hay filtros aplicados
1
5
  # version 0.0.626
2
6
  - Se amplió el formulario de registro `register-form-ec.component` para incluir nuevos campos adicionales, simulando un flujo de registro tipo B2B.
3
7
  - Ahora se envían opcionalmente los siguientes datos:
@@ -1576,10 +1576,10 @@
1576
1576
  // Genera los parámetros de la URL en base al rango de precios seleccionado
1577
1577
  _this.toUrlParams = function () {
1578
1578
  var params = '';
1579
- if (_this.currentMinPrice !== null) {
1579
+ if (_this.currentMinPrice !== null && _this.currentMinPrice !== _this.minPrice) {
1580
1580
  params += "&price_min=" + _this.currentMinPrice;
1581
1581
  }
1582
- if (_this.currentMaxPrice !== null) {
1582
+ if (_this.currentMaxPrice !== null && _this.currentMaxPrice !== _this.maxPrice) {
1583
1583
  params += "&price_max=" + _this.currentMaxPrice;
1584
1584
  }
1585
1585
  return params;
@@ -9602,6 +9602,25 @@
9602
9602
  filter.currentMinPrice = currentMin;
9603
9603
  }
9604
9604
  };
9605
+ FiltersEcComponent.prototype.hasAppliedFilters = function () {
9606
+ var _a, _b;
9607
+ return _b = (_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (filter) {
9608
+ var _a, _b, _c;
9609
+ if (((_b = (_a = filter).type) === null || _b === void 0 ? void 0 : _b.call(_a)) === 'price_range') {
9610
+ var minSet = filter.currentMinPrice !== null && filter.currentMinPrice !== 0;
9611
+ var maxSet = filter.currentMaxPrice !== null && filter.currentMaxPrice !== filter.maxPrice;
9612
+ if (minSet || maxSet) {
9613
+ return true;
9614
+ }
9615
+ }
9616
+ return (_c = filter.data) === null || _c === void 0 ? void 0 : _c.some(function (filterElement) {
9617
+ if (Array.isArray(filterElement.children)) {
9618
+ return filterElement.children.some(function (child) { return child.selected; });
9619
+ }
9620
+ return filterElement.selected;
9621
+ });
9622
+ }), (_b !== null && _b !== void 0 ? _b : false);
9623
+ };
9605
9624
  FiltersEcComponent.ctorParameters = function () { return [
9606
9625
  { type: Constants },
9607
9626
  { type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
@@ -11035,8 +11054,9 @@
11035
11054
  * @param changeAmount cantidad que se quiere restar.
11036
11055
  * @param forceMultiple si es true, obliga a que el resultado sea múltiplo de changeAmount.
11037
11056
  */
11038
- _this.less = function (changeAmount, forceMultiple) {
11057
+ _this.less = function (changeAmount, minimum, forceMultiple) {
11039
11058
  if (changeAmount === void 0) { changeAmount = 1; }
11059
+ if (minimum === void 0) { minimum = 1; }
11040
11060
  if (forceMultiple === void 0) { forceMultiple = false; }
11041
11061
  var newQuantity = _this.quantity - changeAmount;
11042
11062
  if (forceMultiple && changeAmount > 0) {
@@ -11050,9 +11070,12 @@
11050
11070
  newQuantity = changeAmount;
11051
11071
  }
11052
11072
  }
11053
- if (newQuantity >= 1) {
11073
+ if (newQuantity >= minimum) {
11054
11074
  _this.quantity = newQuantity;
11055
11075
  }
11076
+ else {
11077
+ _this.quantity = minimum;
11078
+ }
11056
11079
  };
11057
11080
  _this.showContact = function () { return _this.show = true; };
11058
11081
  _this.hideContact = function () { return _this.show = false; };