@ikas/storefront 0.0.166-alpha.2 → 0.0.166-alpha.4

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
@@ -23603,16 +23603,14 @@ var CheckoutViewModel = /** @class */ (function () {
23603
23603
  };
23604
23604
  this.changeStep = function (step) { return __awaiter(_this, void 0, void 0, function () {
23605
23605
  return __generator(this, function (_a) {
23606
- switch (_a.label) {
23607
- case 0:
23608
- if (!!isServer$1) return [3 /*break*/, 2];
23609
- return [4 /*yield*/, this.router.replace("/checkout?id=" + this.checkout.id + "&step=" + step)];
23610
- case 1:
23611
- _a.sent();
23612
- this.router.reload();
23613
- _a.label = 2;
23614
- case 2: return [2 /*return*/];
23606
+ if (!isServer$1) {
23607
+ window.location.replace("/checkout?id=" + this.checkout.id + "&step=" + step);
23608
+ // await this.router.replace(
23609
+ // `/checkout?id=${this.checkout.id}&step=${step}`
23610
+ // );
23611
+ // this.router.reload();
23615
23612
  }
23613
+ return [2 /*return*/];
23616
23614
  });
23617
23615
  }); };
23618
23616
  this.logout = function () { return __awaiter(_this, void 0, void 0, function () {
@@ -23718,6 +23716,8 @@ var CheckoutViewModel = /** @class */ (function () {
23718
23716
  });
23719
23717
  Object.defineProperty(CheckoutViewModel.prototype, "finalPrice", {
23720
23718
  get: function () {
23719
+ if (this.step === CheckoutStep.SUCCESS)
23720
+ return this.checkout.totalFinalPrice;
23721
23721
  return this.installmentPrice || this.checkout.$totalFinalPrice;
23722
23722
  },
23723
23723
  enumerable: false,
@@ -29178,6 +29178,9 @@ var IkasProductList = /** @class */ (function () {
29178
29178
  //@ts-ignore
29179
29179
  if (this.initialSort === "A_Z" || this.initialSort === "Z_A")
29180
29180
  this._sort = IkasProductListSortType.LAST_ADDED;
29181
+ if (this._pageType === IkasThemePageType.SEARCH) {
29182
+ this._sort = IkasProductListSortType.FEATURED;
29183
+ }
29181
29184
  this._limit = data.limit || data.productListPropValue.initialLimit || 20;
29182
29185
  this._page = data.page || 1;
29183
29186
  this._minPage = data.minPage || null;
@@ -29485,8 +29488,13 @@ var IkasProductList = /** @class */ (function () {
29485
29488
  type = SortByTypeEnum.DISCOUNT_RATIO;
29486
29489
  break;
29487
29490
  case IkasProductListSortType.FEATURED:
29488
- direction = SortByDirectionEnum.ASC;
29489
- type = SortByTypeEnum.MANUAL_SORT;
29491
+ if (!this.isSearch) {
29492
+ direction = SortByDirectionEnum.ASC;
29493
+ type = SortByTypeEnum.MANUAL_SORT;
29494
+ }
29495
+ else {
29496
+ return;
29497
+ }
29490
29498
  break;
29491
29499
  }
29492
29500
  return {
@@ -29497,7 +29505,7 @@ var IkasProductList = /** @class */ (function () {
29497
29505
  IkasProductList.prototype.searchProducts = function (page, limit, productIdList) {
29498
29506
  var _a, _b, _c;
29499
29507
  return __awaiter(this, void 0, void 0, function () {
29500
- var filterList, facetList, selectedCategoryIds;
29508
+ var filterList, facetList, selectedCategoryIds, sortParams;
29501
29509
  return __generator(this, function (_d) {
29502
29510
  switch (_d.label) {
29503
29511
  case 0:
@@ -29521,6 +29529,7 @@ var IkasProductList = /** @class */ (function () {
29521
29529
  }
29522
29530
  });
29523
29531
  selectedCategoryIds = (_b = this._filterCategories) === null || _b === void 0 ? void 0 : _b.filter(function (fc) { return fc.isSelected; }).map(function (fc) { return fc.id; });
29532
+ sortParams = this.getSortParams();
29524
29533
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29525
29534
  page: page,
29526
29535
  perPage: limit,
@@ -29540,7 +29549,11 @@ var IkasProductList = /** @class */ (function () {
29540
29549
  priceListId: IkasStorefrontConfig.priceListId,
29541
29550
  salesChannelId: IkasStorefrontConfig.salesChannelId,
29542
29551
  query: this._searchKeyword,
29543
- order: [this.getSortParams()],
29552
+ order: this._type === IkasProductListType.SEARCH
29553
+ ? null
29554
+ : sortParams
29555
+ ? [sortParams]
29556
+ : null,
29544
29557
  }, true)];
29545
29558
  case 1: return [2 /*return*/, _d.sent()];
29546
29559
  }
@@ -32391,6 +32404,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
32391
32404
  case 3:
32392
32405
  if (!productDetail)
32393
32406
  return [2 /*return*/, []];
32407
+ debugger;
32394
32408
  return [2 /*return*/, productDetail.product.hasVariant
32395
32409
  ? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
32396
32410
  : productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
@@ -61835,7 +61849,6 @@ var ThemeEditorComponent = observer(function (_a) {
61835
61849
  returnPolicy: "",
61836
61850
  privacyPolicy: "",
61837
61851
  termsOfService: "",
61838
- queryParams: {},
61839
61852
  };
61840
61853
  propValues = checkoutProps;
61841
61854
  }
package/build/index.js CHANGED
@@ -23611,16 +23611,14 @@ var CheckoutViewModel = /** @class */ (function () {
23611
23611
  };
23612
23612
  this.changeStep = function (step) { return __awaiter(_this, void 0, void 0, function () {
23613
23613
  return __generator(this, function (_a) {
23614
- switch (_a.label) {
23615
- case 0:
23616
- if (!!isServer$1) return [3 /*break*/, 2];
23617
- return [4 /*yield*/, this.router.replace("/checkout?id=" + this.checkout.id + "&step=" + step)];
23618
- case 1:
23619
- _a.sent();
23620
- this.router.reload();
23621
- _a.label = 2;
23622
- case 2: return [2 /*return*/];
23614
+ if (!isServer$1) {
23615
+ window.location.replace("/checkout?id=" + this.checkout.id + "&step=" + step);
23616
+ // await this.router.replace(
23617
+ // `/checkout?id=${this.checkout.id}&step=${step}`
23618
+ // );
23619
+ // this.router.reload();
23623
23620
  }
23621
+ return [2 /*return*/];
23624
23622
  });
23625
23623
  }); };
23626
23624
  this.logout = function () { return __awaiter(_this, void 0, void 0, function () {
@@ -23726,6 +23724,8 @@ var CheckoutViewModel = /** @class */ (function () {
23726
23724
  });
23727
23725
  Object.defineProperty(CheckoutViewModel.prototype, "finalPrice", {
23728
23726
  get: function () {
23727
+ if (this.step === CheckoutStep.SUCCESS)
23728
+ return this.checkout.totalFinalPrice;
23729
23729
  return this.installmentPrice || this.checkout.$totalFinalPrice;
23730
23730
  },
23731
23731
  enumerable: false,
@@ -29161,6 +29161,9 @@ var IkasProductList = /** @class */ (function () {
29161
29161
  //@ts-ignore
29162
29162
  if (this.initialSort === "A_Z" || this.initialSort === "Z_A")
29163
29163
  this._sort = exports.IkasProductListSortType.LAST_ADDED;
29164
+ if (this._pageType === exports.IkasThemePageType.SEARCH) {
29165
+ this._sort = exports.IkasProductListSortType.FEATURED;
29166
+ }
29164
29167
  this._limit = data.limit || data.productListPropValue.initialLimit || 20;
29165
29168
  this._page = data.page || 1;
29166
29169
  this._minPage = data.minPage || null;
@@ -29468,8 +29471,13 @@ var IkasProductList = /** @class */ (function () {
29468
29471
  type = SortByTypeEnum.DISCOUNT_RATIO;
29469
29472
  break;
29470
29473
  case exports.IkasProductListSortType.FEATURED:
29471
- direction = SortByDirectionEnum.ASC;
29472
- type = SortByTypeEnum.MANUAL_SORT;
29474
+ if (!this.isSearch) {
29475
+ direction = SortByDirectionEnum.ASC;
29476
+ type = SortByTypeEnum.MANUAL_SORT;
29477
+ }
29478
+ else {
29479
+ return;
29480
+ }
29473
29481
  break;
29474
29482
  }
29475
29483
  return {
@@ -29480,7 +29488,7 @@ var IkasProductList = /** @class */ (function () {
29480
29488
  IkasProductList.prototype.searchProducts = function (page, limit, productIdList) {
29481
29489
  var _a, _b, _c;
29482
29490
  return __awaiter(this, void 0, void 0, function () {
29483
- var filterList, facetList, selectedCategoryIds;
29491
+ var filterList, facetList, selectedCategoryIds, sortParams;
29484
29492
  return __generator(this, function (_d) {
29485
29493
  switch (_d.label) {
29486
29494
  case 0:
@@ -29504,6 +29512,7 @@ var IkasProductList = /** @class */ (function () {
29504
29512
  }
29505
29513
  });
29506
29514
  selectedCategoryIds = (_b = this._filterCategories) === null || _b === void 0 ? void 0 : _b.filter(function (fc) { return fc.isSelected; }).map(function (fc) { return fc.id; });
29515
+ sortParams = this.getSortParams();
29507
29516
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29508
29517
  page: page,
29509
29518
  perPage: limit,
@@ -29523,7 +29532,11 @@ var IkasProductList = /** @class */ (function () {
29523
29532
  priceListId: IkasStorefrontConfig.priceListId,
29524
29533
  salesChannelId: IkasStorefrontConfig.salesChannelId,
29525
29534
  query: this._searchKeyword,
29526
- order: [this.getSortParams()],
29535
+ order: this._type === exports.IkasProductListType.SEARCH
29536
+ ? null
29537
+ : sortParams
29538
+ ? [sortParams]
29539
+ : null,
29527
29540
  }, true)];
29528
29541
  case 1: return [2 /*return*/, _d.sent()];
29529
29542
  }
@@ -32371,6 +32384,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
32371
32384
  case 3:
32372
32385
  if (!productDetail)
32373
32386
  return [2 /*return*/, []];
32387
+ debugger;
32374
32388
  return [2 /*return*/, productDetail.product.hasVariant
32375
32389
  ? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
32376
32390
  : productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
@@ -61814,7 +61828,6 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
61814
61828
  returnPolicy: "",
61815
61829
  privacyPolicy: "",
61816
61830
  termsOfService: "",
61817
- queryParams: {},
61818
61831
  };
61819
61832
  propValues = checkoutProps;
61820
61833
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.166-alpha.2",
3
+ "version": "0.0.166-alpha.4",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",