ng-easycommerce 0.0.633 → 0.0.634

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.634
2
+ - Se volvio para atras el cambio de generación de breadcrumbs
1
3
  # version 0.0.633
2
4
  - mejorar la lógica de actualización de cantidad en el carrito
3
5
  - optimizar la generación de breadcrumbs
@@ -989,17 +989,6 @@
989
989
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
990
990
  return ar;
991
991
  };
992
- var __values = (this && this.__values) || function(o) {
993
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
994
- if (m) return m.call(o);
995
- if (o && typeof o.length === "number") return {
996
- next: function () {
997
- if (o && i >= o.length) o = void 0;
998
- return { value: o && o[i++], done: !o };
999
- }
1000
- };
1001
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1002
- };
1003
992
  var OptionsService = /** @class */ (function () {
1004
993
  function OptionsService(connection, constants) {
1005
994
  var _this = this;
@@ -1133,31 +1122,26 @@
1133
1122
  });
1134
1123
  return final_result;
1135
1124
  };
1136
- this.generateBreadcrumb = function (code, elements, path) {
1137
- var e_1, _a;
1138
- if (path === void 0) { path = []; }
1139
- var _b;
1140
- try {
1141
- for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
1142
- var elem = elements_1_1.value;
1143
- if (elem.code === code) {
1144
- return __spread(path, [elem]);
1145
- }
1146
- if ((_b = elem.children) === null || _b === void 0 ? void 0 : _b.length) {
1147
- var childPath = _this.generateBreadcrumb(code, elem.children, __spread(path, [elem]));
1148
- if (childPath.length)
1149
- return childPath;
1150
- }
1151
- }
1125
+ this.generateBreadcrumb = function (code, elements, result) {
1126
+ var element = elements.find(function (elem) { return elem.code == code; });
1127
+ if (element) {
1128
+ result.push(element);
1152
1129
  }
1153
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1154
- finally {
1155
- try {
1156
- if (elements_1_1 && !elements_1_1.done && (_a = elements_1.return)) _a.call(elements_1);
1157
- }
1158
- finally { if (e_1) throw e_1.error; }
1130
+ else {
1131
+ elements.some(function (elem) {
1132
+ if (elem.children && elem.children.length) {
1133
+ var length_1 = result.length;
1134
+ var new_result = _this.generateBreadcrumb(code, elem.children, result);
1135
+ if (new_result.length > length_1) {
1136
+ result = new_result;
1137
+ result.push(elem);
1138
+ return true;
1139
+ }
1140
+ }
1141
+ return false;
1142
+ });
1159
1143
  }
1160
- return [];
1144
+ return result;
1161
1145
  };
1162
1146
  this.getAllData();
1163
1147
  // this.authService.loggedIn.subscribe(res => res && this.getAllData());
@@ -7422,7 +7406,7 @@
7422
7406
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
7423
7407
  }
7424
7408
  };
7425
- var __values$1 = (this && this.__values) || function(o) {
7409
+ var __values = (this && this.__values) || function(o) {
7426
7410
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
7427
7411
  if (m) return m.call(o);
7428
7412
  if (o && typeof o.length === "number") return {
@@ -7762,7 +7746,7 @@
7762
7746
  CartEcComponent.prototype.checkStock = function (item) {
7763
7747
  var e_1, _a;
7764
7748
  try {
7765
- for (var _b = __values$1(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
7749
+ for (var _b = __values(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
7766
7750
  var variant = _c.value;
7767
7751
  if (item.variant_id === variant.code) {
7768
7752
  if (variant.stock === 0) {
@@ -7793,7 +7777,7 @@
7793
7777
  res.forEach(function (item) {
7794
7778
  var e_2, _a;
7795
7779
  try {
7796
- for (var _b = __values$1(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
7780
+ for (var _b = __values(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
7797
7781
  var variant = _c.value;
7798
7782
  if (item.variant_id === variant.code && !_this.exitUpdate) {
7799
7783
  if (variant.stock === 0) {
@@ -8698,7 +8682,7 @@
8698
8682
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8699
8683
  }
8700
8684
  };
8701
- var __values$2 = (this && this.__values) || function(o) {
8685
+ var __values$1 = (this && this.__values) || function(o) {
8702
8686
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
8703
8687
  if (m) return m.call(o);
8704
8688
  if (o && typeof o.length === "number") return {
@@ -8843,7 +8827,7 @@
8843
8827
  var e_1, _a;
8844
8828
  var parent = e.target.parentElement.children;
8845
8829
  try {
8846
- for (var parent_1 = __values$2(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
8830
+ for (var parent_1 = __values$1(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
8847
8831
  var button = parent_1_1.value;
8848
8832
  if (button.classList.contains('active')) {
8849
8833
  button.classList.remove('active');
@@ -8913,7 +8897,7 @@
8913
8897
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8914
8898
  return c > 3 && r && Object.defineProperty(target, key, r), r;
8915
8899
  };
8916
- var __values$3 = (this && this.__values) || function(o) {
8900
+ var __values$2 = (this && this.__values) || function(o) {
8917
8901
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
8918
8902
  if (m) return m.call(o);
8919
8903
  if (o && typeof o.length === "number") return {
@@ -9002,7 +8986,7 @@
9002
8986
  var e_1, _a;
9003
8987
  var parent = e.target.parentElement.children;
9004
8988
  try {
9005
- for (var parent_1 = __values$3(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
8989
+ for (var parent_1 = __values$2(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
9006
8990
  var button = parent_1_1.value;
9007
8991
  if (button.classList.contains('active')) {
9008
8992
  button.classList.remove('active');