@ikas/storefront 0.0.166-alpha.3 → 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.
@@ -53,7 +53,7 @@ export default class CheckoutViewModel {
53
53
  }[];
54
54
  get installmentPrice(): number | null | undefined;
55
55
  get installmentExtraPrice(): number | undefined;
56
- get finalPrice(): number | null | undefined;
56
+ get finalPrice(): number;
57
57
  get hasStockError(): boolean;
58
58
  get canProceedToShipping(): boolean | undefined;
59
59
  get canProceedToPayment(): boolean | undefined;
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 () {
@@ -29180,6 +29178,9 @@ var IkasProductList = /** @class */ (function () {
29180
29178
  //@ts-ignore
29181
29179
  if (this.initialSort === "A_Z" || this.initialSort === "Z_A")
29182
29180
  this._sort = IkasProductListSortType.LAST_ADDED;
29181
+ if (this._pageType === IkasThemePageType.SEARCH) {
29182
+ this._sort = IkasProductListSortType.FEATURED;
29183
+ }
29183
29184
  this._limit = data.limit || data.productListPropValue.initialLimit || 20;
29184
29185
  this._page = data.page || 1;
29185
29186
  this._minPage = data.minPage || null;
@@ -29487,8 +29488,13 @@ var IkasProductList = /** @class */ (function () {
29487
29488
  type = SortByTypeEnum.DISCOUNT_RATIO;
29488
29489
  break;
29489
29490
  case IkasProductListSortType.FEATURED:
29490
- direction = SortByDirectionEnum.ASC;
29491
- type = SortByTypeEnum.MANUAL_SORT;
29491
+ if (!this.isSearch) {
29492
+ direction = SortByDirectionEnum.ASC;
29493
+ type = SortByTypeEnum.MANUAL_SORT;
29494
+ }
29495
+ else {
29496
+ return;
29497
+ }
29492
29498
  break;
29493
29499
  }
29494
29500
  return {
@@ -29499,7 +29505,7 @@ var IkasProductList = /** @class */ (function () {
29499
29505
  IkasProductList.prototype.searchProducts = function (page, limit, productIdList) {
29500
29506
  var _a, _b, _c;
29501
29507
  return __awaiter(this, void 0, void 0, function () {
29502
- var filterList, facetList, selectedCategoryIds;
29508
+ var filterList, facetList, selectedCategoryIds, sortParams;
29503
29509
  return __generator(this, function (_d) {
29504
29510
  switch (_d.label) {
29505
29511
  case 0:
@@ -29523,6 +29529,7 @@ var IkasProductList = /** @class */ (function () {
29523
29529
  }
29524
29530
  });
29525
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();
29526
29533
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29527
29534
  page: page,
29528
29535
  perPage: limit,
@@ -29542,7 +29549,11 @@ var IkasProductList = /** @class */ (function () {
29542
29549
  priceListId: IkasStorefrontConfig.priceListId,
29543
29550
  salesChannelId: IkasStorefrontConfig.salesChannelId,
29544
29551
  query: this._searchKeyword,
29545
- order: [this.getSortParams()],
29552
+ order: this._type === IkasProductListType.SEARCH
29553
+ ? null
29554
+ : sortParams
29555
+ ? [sortParams]
29556
+ : null,
29546
29557
  }, true)];
29547
29558
  case 1: return [2 /*return*/, _d.sent()];
29548
29559
  }
@@ -32393,6 +32404,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
32393
32404
  case 3:
32394
32405
  if (!productDetail)
32395
32406
  return [2 /*return*/, []];
32407
+ debugger;
32396
32408
  return [2 /*return*/, productDetail.product.hasVariant
32397
32409
  ? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
32398
32410
  : productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
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 () {
@@ -29163,6 +29161,9 @@ var IkasProductList = /** @class */ (function () {
29163
29161
  //@ts-ignore
29164
29162
  if (this.initialSort === "A_Z" || this.initialSort === "Z_A")
29165
29163
  this._sort = exports.IkasProductListSortType.LAST_ADDED;
29164
+ if (this._pageType === exports.IkasThemePageType.SEARCH) {
29165
+ this._sort = exports.IkasProductListSortType.FEATURED;
29166
+ }
29166
29167
  this._limit = data.limit || data.productListPropValue.initialLimit || 20;
29167
29168
  this._page = data.page || 1;
29168
29169
  this._minPage = data.minPage || null;
@@ -29470,8 +29471,13 @@ var IkasProductList = /** @class */ (function () {
29470
29471
  type = SortByTypeEnum.DISCOUNT_RATIO;
29471
29472
  break;
29472
29473
  case exports.IkasProductListSortType.FEATURED:
29473
- direction = SortByDirectionEnum.ASC;
29474
- type = SortByTypeEnum.MANUAL_SORT;
29474
+ if (!this.isSearch) {
29475
+ direction = SortByDirectionEnum.ASC;
29476
+ type = SortByTypeEnum.MANUAL_SORT;
29477
+ }
29478
+ else {
29479
+ return;
29480
+ }
29475
29481
  break;
29476
29482
  }
29477
29483
  return {
@@ -29482,7 +29488,7 @@ var IkasProductList = /** @class */ (function () {
29482
29488
  IkasProductList.prototype.searchProducts = function (page, limit, productIdList) {
29483
29489
  var _a, _b, _c;
29484
29490
  return __awaiter(this, void 0, void 0, function () {
29485
- var filterList, facetList, selectedCategoryIds;
29491
+ var filterList, facetList, selectedCategoryIds, sortParams;
29486
29492
  return __generator(this, function (_d) {
29487
29493
  switch (_d.label) {
29488
29494
  case 0:
@@ -29506,6 +29512,7 @@ var IkasProductList = /** @class */ (function () {
29506
29512
  }
29507
29513
  });
29508
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();
29509
29516
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29510
29517
  page: page,
29511
29518
  perPage: limit,
@@ -29525,7 +29532,11 @@ var IkasProductList = /** @class */ (function () {
29525
29532
  priceListId: IkasStorefrontConfig.priceListId,
29526
29533
  salesChannelId: IkasStorefrontConfig.salesChannelId,
29527
29534
  query: this._searchKeyword,
29528
- order: [this.getSortParams()],
29535
+ order: this._type === exports.IkasProductListType.SEARCH
29536
+ ? null
29537
+ : sortParams
29538
+ ? [sortParams]
29539
+ : null,
29529
29540
  }, true)];
29530
29541
  case 1: return [2 /*return*/, _d.sent()];
29531
29542
  }
@@ -32373,6 +32384,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
32373
32384
  case 3:
32374
32385
  if (!productDetail)
32375
32386
  return [2 /*return*/, []];
32387
+ debugger;
32376
32388
  return [2 /*return*/, productDetail.product.hasVariant
32377
32389
  ? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
32378
32390
  : productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.166-alpha.3",
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",