@ikas/storefront 0.0.123 → 0.0.124

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/build/index.es.js CHANGED
@@ -20811,12 +20811,19 @@ var IkasBrandList = /** @class */ (function () {
20811
20811
  })];
20812
20812
  case 2:
20813
20813
  response_1 = _a.sent();
20814
- runInAction(function () {
20815
- _this.data = response_1.brands;
20816
- _this._count = response_1.count;
20817
- _this._initialized = true;
20818
- _this._minPage = _this.page;
20819
- });
20814
+ if (this.isStatic) {
20815
+ this.data = this._brandListPropValue
20816
+ .brandIds.map(function (bID) {
20817
+ return response_1.brands.find(function (b) { return b.id === bID; });
20818
+ })
20819
+ .filter(function (b) { return !!b; });
20820
+ }
20821
+ else {
20822
+ this.data = response_1.brands;
20823
+ }
20824
+ this._count = response_1.count;
20825
+ this._initialized = true;
20826
+ this._minPage = this.page;
20820
20827
  return [3 /*break*/, 5];
20821
20828
  case 3:
20822
20829
  err_1 = _a.sent();
@@ -21098,12 +21105,19 @@ var IkasCategoryList = /** @class */ (function () {
21098
21105
  })];
21099
21106
  case 2:
21100
21107
  response_1 = _a.sent();
21101
- runInAction(function () {
21102
- _this.data = response_1.categories;
21103
- _this._count = response_1.count;
21104
- _this._initialized = true;
21105
- _this._minPage = _this.page;
21106
- });
21108
+ if (this.isStatic) {
21109
+ this.data = this._categoryListPropValue
21110
+ .categoryIds.map(function (cID) {
21111
+ return response_1.categories.find(function (c) { return c.id === cID; });
21112
+ })
21113
+ .filter(function (c) { return !!c; });
21114
+ }
21115
+ else {
21116
+ this.data = response_1.categories;
21117
+ }
21118
+ this._count = response_1.count;
21119
+ this._initialized = true;
21120
+ this._minPage = this.page;
21107
21121
  return [3 /*break*/, 5];
21108
21122
  case 3:
21109
21123
  err_1 = _a.sent();
@@ -24778,8 +24792,8 @@ var IkasCategoryListPropValue = /** @class */ (function () {
24778
24792
  this.categoryListType = data.categoryListType || IkasCategoryListType.ALL;
24779
24793
  this.initialSort = data.initialSort || IkasCategoryListSortType.A_Z;
24780
24794
  this.initialLimit = data.initialLimit || 20;
24781
- this.categoryCount = data.categoryCount;
24782
- this.categoryIds = data.categoryIds;
24795
+ this.categoryCount = data.categoryCount || null;
24796
+ this.categoryIds = data.categoryIds || null;
24783
24797
  makeAutoObservable(this);
24784
24798
  }
24785
24799
  return IkasCategoryListPropValue;
package/build/index.js CHANGED
@@ -20798,12 +20798,19 @@ var IkasBrandList = /** @class */ (function () {
20798
20798
  })];
20799
20799
  case 2:
20800
20800
  response_1 = _a.sent();
20801
- mobx.runInAction(function () {
20802
- _this.data = response_1.brands;
20803
- _this._count = response_1.count;
20804
- _this._initialized = true;
20805
- _this._minPage = _this.page;
20806
- });
20801
+ if (this.isStatic) {
20802
+ this.data = this._brandListPropValue
20803
+ .brandIds.map(function (bID) {
20804
+ return response_1.brands.find(function (b) { return b.id === bID; });
20805
+ })
20806
+ .filter(function (b) { return !!b; });
20807
+ }
20808
+ else {
20809
+ this.data = response_1.brands;
20810
+ }
20811
+ this._count = response_1.count;
20812
+ this._initialized = true;
20813
+ this._minPage = this.page;
20807
20814
  return [3 /*break*/, 5];
20808
20815
  case 3:
20809
20816
  err_1 = _a.sent();
@@ -21083,12 +21090,19 @@ var IkasCategoryList = /** @class */ (function () {
21083
21090
  })];
21084
21091
  case 2:
21085
21092
  response_1 = _a.sent();
21086
- mobx.runInAction(function () {
21087
- _this.data = response_1.categories;
21088
- _this._count = response_1.count;
21089
- _this._initialized = true;
21090
- _this._minPage = _this.page;
21091
- });
21093
+ if (this.isStatic) {
21094
+ this.data = this._categoryListPropValue
21095
+ .categoryIds.map(function (cID) {
21096
+ return response_1.categories.find(function (c) { return c.id === cID; });
21097
+ })
21098
+ .filter(function (c) { return !!c; });
21099
+ }
21100
+ else {
21101
+ this.data = response_1.categories;
21102
+ }
21103
+ this._count = response_1.count;
21104
+ this._initialized = true;
21105
+ this._minPage = this.page;
21092
21106
  return [3 /*break*/, 5];
21093
21107
  case 3:
21094
21108
  err_1 = _a.sent();
@@ -24758,8 +24772,8 @@ var IkasCategoryListPropValue = /** @class */ (function () {
24758
24772
  this.categoryListType = data.categoryListType || exports.IkasCategoryListType.ALL;
24759
24773
  this.initialSort = data.initialSort || exports.IkasCategoryListSortType.A_Z;
24760
24774
  this.initialLimit = data.initialLimit || 20;
24761
- this.categoryCount = data.categoryCount;
24762
- this.categoryIds = data.categoryIds;
24775
+ this.categoryCount = data.categoryCount || null;
24776
+ this.categoryIds = data.categoryIds || null;
24763
24777
  mobx.makeAutoObservable(this);
24764
24778
  }
24765
24779
  return IkasCategoryListPropValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",