@ikas/storefront 0.0.158-alpha.14 → 0.0.158-alpha.15
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 +269 -135
- package/build/index.js +269 -135
- package/build/models/theme/component/prop/index.d.ts +3 -0
- package/build/models/theme/custom-data/index.d.ts +2 -0
- package/build/models/theme/page/component/prop-value/attribute-list.d.ts +7 -0
- package/build/utils/providers/page-data.d.ts +7 -1
- package/build/utils/providers/prop-value/attribute-list.d.ts +13 -0
- package/build/utils/providers/prop-value/custom.d.ts +2 -0
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -11345,7 +11345,9 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
11345
11345
|
});
|
|
11346
11346
|
Object.defineProperty(IkasOrderLineItem.prototype, "finalPriceWithQuantity", {
|
|
11347
11347
|
get: function () {
|
|
11348
|
-
return this.
|
|
11348
|
+
return ((this.discountPrice !== undefined && this.discountPrice !== null
|
|
11349
|
+
? this.discountPrice
|
|
11350
|
+
: this.price) * this.quantity);
|
|
11349
11351
|
},
|
|
11350
11352
|
enumerable: false,
|
|
11351
11353
|
configurable: true
|
|
@@ -11353,7 +11355,7 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
11353
11355
|
Object.defineProperty(IkasOrderLineItem.prototype, "tax", {
|
|
11354
11356
|
get: function () {
|
|
11355
11357
|
var taxValue = this.taxValue || 0;
|
|
11356
|
-
return (this.
|
|
11358
|
+
return ((this.finalPrice * this.quantity) / (100 + taxValue)) * taxValue;
|
|
11357
11359
|
},
|
|
11358
11360
|
enumerable: false,
|
|
11359
11361
|
configurable: true
|
|
@@ -18897,6 +18899,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
18897
18899
|
this.type = data.type || IkasThemeComponentPropType.TEXT;
|
|
18898
18900
|
this.isRequired = data.isRequired || false;
|
|
18899
18901
|
this.customDataId = data.customDataId || null;
|
|
18902
|
+
this.attributeTypes = data.attributeTypes || null;
|
|
18900
18903
|
makeAutoObservable(this);
|
|
18901
18904
|
}
|
|
18902
18905
|
return IkasThemeComponentProp;
|
|
@@ -18913,6 +18916,7 @@ var IkasThemeComponentPropType;
|
|
|
18913
18916
|
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18914
18917
|
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18915
18918
|
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE"] = "PRODUCT_ATTRIBUTE";
|
|
18919
|
+
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE_LIST"] = "PRODUCT_ATTRIBUTE_LIST";
|
|
18916
18920
|
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
18917
18921
|
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
18918
18922
|
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
@@ -18954,6 +18958,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18954
18958
|
this.key = data.key || null;
|
|
18955
18959
|
this.parent = data.parent || null;
|
|
18956
18960
|
this.itemCount = data.itemCount || null;
|
|
18961
|
+
this.attributeTypes = data.attributeTypes || null;
|
|
18957
18962
|
this.isRoot = data.isRoot || false;
|
|
18958
18963
|
this.nestedData = data.nestedData
|
|
18959
18964
|
? data.nestedData.map(function (nd) {
|
|
@@ -24678,6 +24683,132 @@ var IkasBlogListPropValueProvider = /** @class */ (function () {
|
|
|
24678
24683
|
return IkasBlogListPropValueProvider;
|
|
24679
24684
|
}());
|
|
24680
24685
|
|
|
24686
|
+
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
24687
|
+
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
24688
|
+
this.attributePropValue = prop;
|
|
24689
|
+
this.pageSpecificData = pageSpecificData;
|
|
24690
|
+
}
|
|
24691
|
+
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
24692
|
+
var _a;
|
|
24693
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24694
|
+
var productDetail, productSearchResponse, productList, product, variant;
|
|
24695
|
+
var _this = this;
|
|
24696
|
+
return __generator(this, function (_b) {
|
|
24697
|
+
switch (_b.label) {
|
|
24698
|
+
case 0:
|
|
24699
|
+
if (!this.attributePropValue.attributeId ||
|
|
24700
|
+
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
24701
|
+
(!this.attributePropValue.usePageData &&
|
|
24702
|
+
!this.attributePropValue.variantId)) {
|
|
24703
|
+
return [2 /*return*/, []];
|
|
24704
|
+
}
|
|
24705
|
+
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
24706
|
+
productDetail = this.pageSpecificData;
|
|
24707
|
+
return [3 /*break*/, 3];
|
|
24708
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24709
|
+
productIdList: [this.attributePropValue.productId],
|
|
24710
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
24711
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
24712
|
+
})];
|
|
24713
|
+
case 2:
|
|
24714
|
+
productSearchResponse = _b.sent();
|
|
24715
|
+
if (productSearchResponse) {
|
|
24716
|
+
productList = productSearchResponse.data;
|
|
24717
|
+
if (productList.length) {
|
|
24718
|
+
product = productList[0];
|
|
24719
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
24720
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
24721
|
+
if (variant) {
|
|
24722
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
24723
|
+
}
|
|
24724
|
+
}
|
|
24725
|
+
else {
|
|
24726
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
24727
|
+
}
|
|
24728
|
+
}
|
|
24729
|
+
}
|
|
24730
|
+
_b.label = 3;
|
|
24731
|
+
case 3:
|
|
24732
|
+
if (!productDetail)
|
|
24733
|
+
return [2 /*return*/, []];
|
|
24734
|
+
return [2 /*return*/, productDetail.product.hasVariant
|
|
24735
|
+
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
24736
|
+
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
24737
|
+
}
|
|
24738
|
+
});
|
|
24739
|
+
});
|
|
24740
|
+
};
|
|
24741
|
+
return IkasAttributePropValueProvider;
|
|
24742
|
+
}());
|
|
24743
|
+
|
|
24744
|
+
var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
24745
|
+
function IkasAttributeListPropValueProvider(prop, pageSpecificData) {
|
|
24746
|
+
this.attributeListPropValue = prop;
|
|
24747
|
+
this.pageSpecificData = pageSpecificData;
|
|
24748
|
+
}
|
|
24749
|
+
IkasAttributeListPropValueProvider.prototype.getValue = function () {
|
|
24750
|
+
var _a, _b;
|
|
24751
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24752
|
+
var productDetail, productSearchResponse, productList, product, variant, groupedValues;
|
|
24753
|
+
var _this = this;
|
|
24754
|
+
return __generator(this, function (_c) {
|
|
24755
|
+
switch (_c.label) {
|
|
24756
|
+
case 0:
|
|
24757
|
+
if (!((_a = this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
24758
|
+
(this.attributeListPropValue.usePageData && !this.pageSpecificData) ||
|
|
24759
|
+
(!this.attributeListPropValue.usePageData &&
|
|
24760
|
+
!this.attributeListPropValue.variantId)) {
|
|
24761
|
+
return [2 /*return*/, []];
|
|
24762
|
+
}
|
|
24763
|
+
if (!((_b = this.attributeListPropValue) === null || _b === void 0 ? void 0 : _b.usePageData)) return [3 /*break*/, 1];
|
|
24764
|
+
productDetail = this.pageSpecificData;
|
|
24765
|
+
return [3 /*break*/, 3];
|
|
24766
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24767
|
+
productIdList: [this.attributeListPropValue.productId],
|
|
24768
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
24769
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
24770
|
+
})];
|
|
24771
|
+
case 2:
|
|
24772
|
+
productSearchResponse = _c.sent();
|
|
24773
|
+
if (productSearchResponse) {
|
|
24774
|
+
productList = productSearchResponse.data;
|
|
24775
|
+
if (productList.length) {
|
|
24776
|
+
product = productList[0];
|
|
24777
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
24778
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributeListPropValue.variantId; });
|
|
24779
|
+
if (variant) {
|
|
24780
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
24781
|
+
}
|
|
24782
|
+
}
|
|
24783
|
+
else {
|
|
24784
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
24785
|
+
}
|
|
24786
|
+
}
|
|
24787
|
+
}
|
|
24788
|
+
_c.label = 3;
|
|
24789
|
+
case 3:
|
|
24790
|
+
if (!productDetail)
|
|
24791
|
+
return [2 /*return*/, []];
|
|
24792
|
+
groupedValues = productDetail.product.hasVariant
|
|
24793
|
+
? groupBy_1(productDetail.selectedVariant.attributes.filter(function (a) { var _a; return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || ""); }), "productAttributeId")
|
|
24794
|
+
: groupBy_1(productDetail.product.attributes.filter(function (a) { var _a; return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || ""); }), "productAttributeId");
|
|
24795
|
+
return [2 /*return*/, this.attributeListPropValue.attributeIds
|
|
24796
|
+
.map(function (attributeId) {
|
|
24797
|
+
var values = groupedValues[attributeId];
|
|
24798
|
+
if ((values === null || values === void 0 ? void 0 : values.length) && values[0].productAttribute)
|
|
24799
|
+
return {
|
|
24800
|
+
attribute: values[0].productAttribute,
|
|
24801
|
+
values: values,
|
|
24802
|
+
};
|
|
24803
|
+
})
|
|
24804
|
+
.filter(function (v) { return !!v; })];
|
|
24805
|
+
}
|
|
24806
|
+
});
|
|
24807
|
+
});
|
|
24808
|
+
};
|
|
24809
|
+
return IkasAttributeListPropValueProvider;
|
|
24810
|
+
}());
|
|
24811
|
+
|
|
24681
24812
|
var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
24682
24813
|
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageDataProvider, pageSpecificData, pageParams) {
|
|
24683
24814
|
this.value = value;
|
|
@@ -24698,7 +24829,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24698
24829
|
return [2 /*return*/];
|
|
24699
24830
|
_b.label = 1;
|
|
24700
24831
|
case 1:
|
|
24701
|
-
_b.trys.push([1,
|
|
24832
|
+
_b.trys.push([1, 44, , 45]);
|
|
24702
24833
|
_a = this.customData.type;
|
|
24703
24834
|
switch (_a) {
|
|
24704
24835
|
case IkasThemeComponentPropType.TEXT: return [3 /*break*/, 2];
|
|
@@ -24715,93 +24846,103 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24715
24846
|
case IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
24716
24847
|
case IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
24717
24848
|
case IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
24718
|
-
case IkasThemeComponentPropType.
|
|
24719
|
-
case IkasThemeComponentPropType.
|
|
24720
|
-
case IkasThemeComponentPropType.
|
|
24721
|
-
case IkasThemeComponentPropType.
|
|
24722
|
-
case IkasThemeComponentPropType.
|
|
24723
|
-
case IkasThemeComponentPropType.
|
|
24724
|
-
case IkasThemeComponentPropType.
|
|
24849
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 28];
|
|
24850
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE_LIST: return [3 /*break*/, 30];
|
|
24851
|
+
case IkasThemeComponentPropType.OBJECT: return [3 /*break*/, 32];
|
|
24852
|
+
case IkasThemeComponentPropType.DYNAMIC_LIST: return [3 /*break*/, 34];
|
|
24853
|
+
case IkasThemeComponentPropType.STATIC_LIST: return [3 /*break*/, 34];
|
|
24854
|
+
case IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 36];
|
|
24855
|
+
case IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 36];
|
|
24856
|
+
case IkasThemeComponentPropType.BLOG: return [3 /*break*/, 38];
|
|
24857
|
+
case IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 40];
|
|
24725
24858
|
}
|
|
24726
|
-
return [3 /*break*/,
|
|
24859
|
+
return [3 /*break*/, 42];
|
|
24727
24860
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
24728
24861
|
case 3:
|
|
24729
24862
|
customDataValue = _b.sent();
|
|
24730
|
-
return [3 /*break*/,
|
|
24863
|
+
return [3 /*break*/, 43];
|
|
24731
24864
|
case 4: return [4 /*yield*/, this.getRichTextPropValue()];
|
|
24732
24865
|
case 5:
|
|
24733
24866
|
customDataValue = _b.sent();
|
|
24734
|
-
return [3 /*break*/,
|
|
24867
|
+
return [3 /*break*/, 43];
|
|
24735
24868
|
case 6: return [4 /*yield*/, this.getBooleanValue()];
|
|
24736
24869
|
case 7:
|
|
24737
24870
|
customDataValue = _b.sent();
|
|
24738
|
-
return [3 /*break*/,
|
|
24871
|
+
return [3 /*break*/, 43];
|
|
24739
24872
|
case 8: return [4 /*yield*/, this.getBrandListPropValue()];
|
|
24740
24873
|
case 9:
|
|
24741
24874
|
customDataValue = _b.sent();
|
|
24742
|
-
return [3 /*break*/,
|
|
24875
|
+
return [3 /*break*/, 43];
|
|
24743
24876
|
case 10: return [4 /*yield*/, this.getBrandPropValue()];
|
|
24744
24877
|
case 11:
|
|
24745
24878
|
customDataValue = _b.sent();
|
|
24746
|
-
return [3 /*break*/,
|
|
24879
|
+
return [3 /*break*/, 43];
|
|
24747
24880
|
case 12: return [4 /*yield*/, this.getCategoryListPropValue()];
|
|
24748
24881
|
case 13:
|
|
24749
24882
|
customDataValue = _b.sent();
|
|
24750
|
-
return [3 /*break*/,
|
|
24883
|
+
return [3 /*break*/, 43];
|
|
24751
24884
|
case 14: return [4 /*yield*/, this.getCategoryPropValue()];
|
|
24752
24885
|
case 15:
|
|
24753
24886
|
customDataValue = _b.sent();
|
|
24754
|
-
return [3 /*break*/,
|
|
24887
|
+
return [3 /*break*/, 43];
|
|
24755
24888
|
case 16: return [4 /*yield*/, this.getColorPropValue()];
|
|
24756
24889
|
case 17:
|
|
24757
24890
|
customDataValue = _b.sent();
|
|
24758
|
-
return [3 /*break*/,
|
|
24891
|
+
return [3 /*break*/, 43];
|
|
24759
24892
|
case 18: return [4 /*yield*/, this.getImageListPropValue()];
|
|
24760
24893
|
case 19:
|
|
24761
24894
|
customDataValue = _b.sent();
|
|
24762
|
-
return [3 /*break*/,
|
|
24895
|
+
return [3 /*break*/, 43];
|
|
24763
24896
|
case 20: return [4 /*yield*/, this.getImagePropValue()];
|
|
24764
24897
|
case 21:
|
|
24765
24898
|
customDataValue = _b.sent();
|
|
24766
|
-
return [3 /*break*/,
|
|
24899
|
+
return [3 /*break*/, 43];
|
|
24767
24900
|
case 22: return [4 /*yield*/, this.getLinkPropValue()];
|
|
24768
24901
|
case 23:
|
|
24769
24902
|
customDataValue = _b.sent();
|
|
24770
|
-
return [3 /*break*/,
|
|
24903
|
+
return [3 /*break*/, 43];
|
|
24771
24904
|
case 24: return [4 /*yield*/, this.getProductDetailPropValue()];
|
|
24772
24905
|
case 25:
|
|
24773
24906
|
customDataValue = _b.sent();
|
|
24774
|
-
return [3 /*break*/,
|
|
24907
|
+
return [3 /*break*/, 43];
|
|
24775
24908
|
case 26: return [4 /*yield*/, this.getProductListPropValue()];
|
|
24776
24909
|
case 27:
|
|
24777
24910
|
customDataValue = _b.sent();
|
|
24778
|
-
return [3 /*break*/,
|
|
24779
|
-
case 28: return [4 /*yield*/, this.
|
|
24911
|
+
return [3 /*break*/, 43];
|
|
24912
|
+
case 28: return [4 /*yield*/, this.getProductAttributePropValue()];
|
|
24780
24913
|
case 29:
|
|
24781
24914
|
customDataValue = _b.sent();
|
|
24782
|
-
return [3 /*break*/,
|
|
24783
|
-
case 30: return [4 /*yield*/, this.
|
|
24915
|
+
return [3 /*break*/, 43];
|
|
24916
|
+
case 30: return [4 /*yield*/, this.getProductAttributeListPropValue()];
|
|
24784
24917
|
case 31:
|
|
24785
24918
|
customDataValue = _b.sent();
|
|
24786
|
-
return [3 /*break*/,
|
|
24787
|
-
case 32: return [4 /*yield*/, this.
|
|
24919
|
+
return [3 /*break*/, 43];
|
|
24920
|
+
case 32: return [4 /*yield*/, this.getObjectValue()];
|
|
24788
24921
|
case 33:
|
|
24789
24922
|
customDataValue = _b.sent();
|
|
24790
|
-
return [3 /*break*/,
|
|
24791
|
-
case 34: return [4 /*yield*/, this.
|
|
24923
|
+
return [3 /*break*/, 43];
|
|
24924
|
+
case 34: return [4 /*yield*/, this.getArrayValue()];
|
|
24792
24925
|
case 35:
|
|
24793
24926
|
customDataValue = _b.sent();
|
|
24794
|
-
return [3 /*break*/,
|
|
24795
|
-
case 36: return [4 /*yield*/, this.
|
|
24927
|
+
return [3 /*break*/, 43];
|
|
24928
|
+
case 36: return [4 /*yield*/, this.getComponentListValue()];
|
|
24796
24929
|
case 37:
|
|
24797
24930
|
customDataValue = _b.sent();
|
|
24798
|
-
return [3 /*break*/,
|
|
24799
|
-
case 38: return [
|
|
24800
|
-
case 39:
|
|
24801
|
-
|
|
24931
|
+
return [3 /*break*/, 43];
|
|
24932
|
+
case 38: return [4 /*yield*/, this.getBlogValue()];
|
|
24933
|
+
case 39:
|
|
24934
|
+
customDataValue = _b.sent();
|
|
24935
|
+
return [3 /*break*/, 43];
|
|
24936
|
+
case 40: return [4 /*yield*/, this.getBlogListValue()];
|
|
24937
|
+
case 41:
|
|
24938
|
+
customDataValue = _b.sent();
|
|
24939
|
+
return [3 /*break*/, 43];
|
|
24940
|
+
case 42: return [3 /*break*/, 43];
|
|
24941
|
+
case 43: return [3 /*break*/, 45];
|
|
24942
|
+
case 44:
|
|
24802
24943
|
_b.sent();
|
|
24803
24944
|
return [2 /*return*/];
|
|
24804
|
-
case
|
|
24945
|
+
case 45:
|
|
24805
24946
|
if (this.customData.isRequired &&
|
|
24806
24947
|
((customDataValue === null || customDataValue === void 0 ? void 0 : customDataValue.value) === undefined || (customDataValue === null || customDataValue === void 0 ? void 0 : customDataValue.value) === null))
|
|
24807
24948
|
return [2 /*return*/];
|
|
@@ -25026,6 +25167,42 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
25026
25167
|
});
|
|
25027
25168
|
});
|
|
25028
25169
|
};
|
|
25170
|
+
IkasCustomPropValueProvider.prototype.getProductAttributePropValue = function () {
|
|
25171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
25172
|
+
var provider, value;
|
|
25173
|
+
return __generator(this, function (_a) {
|
|
25174
|
+
switch (_a.label) {
|
|
25175
|
+
case 0:
|
|
25176
|
+
provider = new IkasAttributePropValueProvider(this.value, this.pageSpecificData);
|
|
25177
|
+
return [4 /*yield*/, provider.getValue()];
|
|
25178
|
+
case 1:
|
|
25179
|
+
value = _a.sent();
|
|
25180
|
+
return [2 /*return*/, {
|
|
25181
|
+
value: value,
|
|
25182
|
+
customData: this.customData,
|
|
25183
|
+
}];
|
|
25184
|
+
}
|
|
25185
|
+
});
|
|
25186
|
+
});
|
|
25187
|
+
};
|
|
25188
|
+
IkasCustomPropValueProvider.prototype.getProductAttributeListPropValue = function () {
|
|
25189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
25190
|
+
var provider, value;
|
|
25191
|
+
return __generator(this, function (_a) {
|
|
25192
|
+
switch (_a.label) {
|
|
25193
|
+
case 0:
|
|
25194
|
+
provider = new IkasAttributeListPropValueProvider(this.value, this.pageSpecificData);
|
|
25195
|
+
return [4 /*yield*/, provider.getValue()];
|
|
25196
|
+
case 1:
|
|
25197
|
+
value = _a.sent();
|
|
25198
|
+
return [2 /*return*/, {
|
|
25199
|
+
value: value,
|
|
25200
|
+
customData: this.customData,
|
|
25201
|
+
}];
|
|
25202
|
+
}
|
|
25203
|
+
});
|
|
25204
|
+
});
|
|
25205
|
+
};
|
|
25029
25206
|
IkasCustomPropValueProvider.prototype.getTextValue = function () {
|
|
25030
25207
|
return __awaiter(this, void 0, void 0, function () {
|
|
25031
25208
|
var provider, value;
|
|
@@ -25489,64 +25666,6 @@ var pageStyle = {
|
|
|
25489
25666
|
justifyContent: "space-between",
|
|
25490
25667
|
};
|
|
25491
25668
|
|
|
25492
|
-
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
25493
|
-
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
25494
|
-
this.attributePropValue = prop;
|
|
25495
|
-
this.pageSpecificData = pageSpecificData;
|
|
25496
|
-
}
|
|
25497
|
-
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
25498
|
-
var _a;
|
|
25499
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25500
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
25501
|
-
var _this = this;
|
|
25502
|
-
return __generator(this, function (_b) {
|
|
25503
|
-
switch (_b.label) {
|
|
25504
|
-
case 0:
|
|
25505
|
-
if (!this.attributePropValue.attributeId ||
|
|
25506
|
-
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
25507
|
-
(!this.attributePropValue.usePageData &&
|
|
25508
|
-
!this.attributePropValue.variantId)) {
|
|
25509
|
-
return [2 /*return*/, []];
|
|
25510
|
-
}
|
|
25511
|
-
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
25512
|
-
productDetail = this.pageSpecificData;
|
|
25513
|
-
return [3 /*break*/, 3];
|
|
25514
|
-
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
25515
|
-
productIdList: [this.attributePropValue.productId],
|
|
25516
|
-
priceListId: IkasStorefrontConfig.priceListId,
|
|
25517
|
-
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
25518
|
-
})];
|
|
25519
|
-
case 2:
|
|
25520
|
-
productSearchResponse = _b.sent();
|
|
25521
|
-
if (productSearchResponse) {
|
|
25522
|
-
productList = productSearchResponse.data;
|
|
25523
|
-
if (productList.length) {
|
|
25524
|
-
product = productList[0];
|
|
25525
|
-
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
25526
|
-
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
25527
|
-
if (variant) {
|
|
25528
|
-
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
25529
|
-
}
|
|
25530
|
-
}
|
|
25531
|
-
else {
|
|
25532
|
-
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
25533
|
-
}
|
|
25534
|
-
}
|
|
25535
|
-
}
|
|
25536
|
-
_b.label = 3;
|
|
25537
|
-
case 3:
|
|
25538
|
-
if (!productDetail)
|
|
25539
|
-
return [2 /*return*/, []];
|
|
25540
|
-
return [2 /*return*/, productDetail.product.hasVariant
|
|
25541
|
-
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
25542
|
-
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
25543
|
-
}
|
|
25544
|
-
});
|
|
25545
|
-
});
|
|
25546
|
-
};
|
|
25547
|
-
return IkasAttributePropValueProvider;
|
|
25548
|
-
}());
|
|
25549
|
-
|
|
25550
25669
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
25551
25670
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
25552
25671
|
this.pageType = null;
|
|
@@ -25936,79 +26055,83 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25936
26055
|
case IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
25937
26056
|
case IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
25938
26057
|
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 10];
|
|
25939
|
-
case IkasThemeComponentPropType.
|
|
25940
|
-
case IkasThemeComponentPropType.
|
|
25941
|
-
case IkasThemeComponentPropType.
|
|
25942
|
-
case IkasThemeComponentPropType.
|
|
25943
|
-
case IkasThemeComponentPropType.
|
|
25944
|
-
case IkasThemeComponentPropType.
|
|
25945
|
-
case IkasThemeComponentPropType.
|
|
25946
|
-
case IkasThemeComponentPropType.
|
|
25947
|
-
case IkasThemeComponentPropType.
|
|
25948
|
-
case IkasThemeComponentPropType.
|
|
26058
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE_LIST: return [3 /*break*/, 11];
|
|
26059
|
+
case IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 12];
|
|
26060
|
+
case IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 13];
|
|
26061
|
+
case IkasThemeComponentPropType.LINK: return [3 /*break*/, 14];
|
|
26062
|
+
case IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 14];
|
|
26063
|
+
case IkasThemeComponentPropType.COLOR: return [3 /*break*/, 15];
|
|
26064
|
+
case IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 16];
|
|
26065
|
+
case IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 17];
|
|
26066
|
+
case IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 17];
|
|
26067
|
+
case IkasThemeComponentPropType.BLOG: return [3 /*break*/, 19];
|
|
26068
|
+
case IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 20];
|
|
25949
26069
|
}
|
|
25950
|
-
return [3 /*break*/,
|
|
26070
|
+
return [3 /*break*/, 21];
|
|
25951
26071
|
case 1:
|
|
25952
26072
|
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
25953
|
-
return [3 /*break*/,
|
|
26073
|
+
return [3 /*break*/, 22];
|
|
25954
26074
|
case 2:
|
|
25955
26075
|
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
25956
|
-
return [3 /*break*/,
|
|
26076
|
+
return [3 /*break*/, 22];
|
|
25957
26077
|
case 3:
|
|
25958
26078
|
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
25959
|
-
return [3 /*break*/,
|
|
26079
|
+
return [3 /*break*/, 22];
|
|
25960
26080
|
case 4:
|
|
25961
26081
|
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
25962
|
-
return [3 /*break*/,
|
|
26082
|
+
return [3 /*break*/, 22];
|
|
25963
26083
|
case 5:
|
|
25964
26084
|
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
25965
|
-
return [3 /*break*/,
|
|
26085
|
+
return [3 /*break*/, 22];
|
|
25966
26086
|
case 6:
|
|
25967
26087
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
25968
|
-
return [3 /*break*/,
|
|
26088
|
+
return [3 /*break*/, 22];
|
|
25969
26089
|
case 7:
|
|
25970
26090
|
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
25971
|
-
return [3 /*break*/,
|
|
26091
|
+
return [3 /*break*/, 22];
|
|
25972
26092
|
case 8:
|
|
25973
26093
|
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25974
|
-
return [3 /*break*/,
|
|
26094
|
+
return [3 /*break*/, 22];
|
|
25975
26095
|
case 9:
|
|
25976
26096
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
25977
|
-
return [3 /*break*/,
|
|
26097
|
+
return [3 /*break*/, 22];
|
|
25978
26098
|
case 10:
|
|
25979
26099
|
propValueProvider = new IkasAttributePropValueProvider(propValue, this.pageSpecificData);
|
|
25980
|
-
return [3 /*break*/,
|
|
26100
|
+
return [3 /*break*/, 22];
|
|
25981
26101
|
case 11:
|
|
25982
|
-
propValueProvider = new
|
|
25983
|
-
return [3 /*break*/,
|
|
26102
|
+
propValueProvider = new IkasAttributeListPropValueProvider(propValue, this.pageSpecificData);
|
|
26103
|
+
return [3 /*break*/, 22];
|
|
25984
26104
|
case 12:
|
|
25985
|
-
propValueProvider = new
|
|
25986
|
-
return [3 /*break*/,
|
|
26105
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
26106
|
+
return [3 /*break*/, 22];
|
|
25987
26107
|
case 13:
|
|
25988
|
-
propValueProvider = new
|
|
25989
|
-
return [3 /*break*/,
|
|
26108
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
26109
|
+
return [3 /*break*/, 22];
|
|
25990
26110
|
case 14:
|
|
25991
|
-
propValueProvider = new
|
|
25992
|
-
return [3 /*break*/,
|
|
26111
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
26112
|
+
return [3 /*break*/, 22];
|
|
25993
26113
|
case 15:
|
|
26114
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
26115
|
+
return [3 /*break*/, 22];
|
|
26116
|
+
case 16:
|
|
25994
26117
|
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
25995
26118
|
if (!customData)
|
|
25996
26119
|
return [2 /*return*/];
|
|
25997
26120
|
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
25998
|
-
return [3 /*break*/,
|
|
25999
|
-
case
|
|
26121
|
+
return [3 /*break*/, 22];
|
|
26122
|
+
case 17:
|
|
26000
26123
|
pageComponents = propValue;
|
|
26001
26124
|
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
26002
|
-
case
|
|
26003
|
-
case 18:
|
|
26004
|
-
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
26005
|
-
return [3 /*break*/, 21];
|
|
26125
|
+
case 18: return [2 /*return*/, _b.sent()];
|
|
26006
26126
|
case 19:
|
|
26127
|
+
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
26128
|
+
return [3 /*break*/, 22];
|
|
26129
|
+
case 20:
|
|
26007
26130
|
propValueProvider = new IkasBlogListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
26008
|
-
return [3 /*break*/,
|
|
26009
|
-
case
|
|
26010
|
-
case
|
|
26011
|
-
case
|
|
26131
|
+
return [3 /*break*/, 22];
|
|
26132
|
+
case 21: return [3 /*break*/, 22];
|
|
26133
|
+
case 22: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
26134
|
+
case 23: return [2 /*return*/, _b.sent()];
|
|
26012
26135
|
}
|
|
26013
26136
|
});
|
|
26014
26137
|
});
|
|
@@ -26144,6 +26267,17 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
26144
26267
|
? propValue.map(function (p) { return new IkasProductAttributeValue(p); })
|
|
26145
26268
|
: [];
|
|
26146
26269
|
};
|
|
26270
|
+
IkasPageDataProvider.initAttributeListPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
26271
|
+
pageComponentPropValue.propValues[prop.name] = IkasPageDataProvider._initAttributeListPropValue(propValue);
|
|
26272
|
+
};
|
|
26273
|
+
IkasPageDataProvider._initAttributeListPropValue = function (propValue) {
|
|
26274
|
+
return propValue
|
|
26275
|
+
? propValue.map(function (p) { return ({
|
|
26276
|
+
attribute: new IkasProductAttribute(p.attribute),
|
|
26277
|
+
values: p.values.map(function (v) { return new IkasProductAttributeValue(v); }),
|
|
26278
|
+
}); })
|
|
26279
|
+
: [];
|
|
26280
|
+
};
|
|
26147
26281
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
26148
26282
|
pageComponentPropValue.propValues[prop.name] = this._initLinkPropValue(propValue);
|
|
26149
26283
|
};
|
package/build/index.js
CHANGED
|
@@ -11359,7 +11359,9 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
11359
11359
|
});
|
|
11360
11360
|
Object.defineProperty(IkasOrderLineItem.prototype, "finalPriceWithQuantity", {
|
|
11361
11361
|
get: function () {
|
|
11362
|
-
return this.
|
|
11362
|
+
return ((this.discountPrice !== undefined && this.discountPrice !== null
|
|
11363
|
+
? this.discountPrice
|
|
11364
|
+
: this.price) * this.quantity);
|
|
11363
11365
|
},
|
|
11364
11366
|
enumerable: false,
|
|
11365
11367
|
configurable: true
|
|
@@ -11367,7 +11369,7 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
11367
11369
|
Object.defineProperty(IkasOrderLineItem.prototype, "tax", {
|
|
11368
11370
|
get: function () {
|
|
11369
11371
|
var taxValue = this.taxValue || 0;
|
|
11370
|
-
return (this.
|
|
11372
|
+
return ((this.finalPrice * this.quantity) / (100 + taxValue)) * taxValue;
|
|
11371
11373
|
},
|
|
11372
11374
|
enumerable: false,
|
|
11373
11375
|
configurable: true
|
|
@@ -18888,6 +18890,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
18888
18890
|
this.type = data.type || exports.IkasThemeComponentPropType.TEXT;
|
|
18889
18891
|
this.isRequired = data.isRequired || false;
|
|
18890
18892
|
this.customDataId = data.customDataId || null;
|
|
18893
|
+
this.attributeTypes = data.attributeTypes || null;
|
|
18891
18894
|
mobx.makeAutoObservable(this);
|
|
18892
18895
|
}
|
|
18893
18896
|
return IkasThemeComponentProp;
|
|
@@ -18903,6 +18906,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
18903
18906
|
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18904
18907
|
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18905
18908
|
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE"] = "PRODUCT_ATTRIBUTE";
|
|
18909
|
+
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE_LIST"] = "PRODUCT_ATTRIBUTE_LIST";
|
|
18906
18910
|
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
18907
18911
|
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
18908
18912
|
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
@@ -18944,6 +18948,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18944
18948
|
this.key = data.key || null;
|
|
18945
18949
|
this.parent = data.parent || null;
|
|
18946
18950
|
this.itemCount = data.itemCount || null;
|
|
18951
|
+
this.attributeTypes = data.attributeTypes || null;
|
|
18947
18952
|
this.isRoot = data.isRoot || false;
|
|
18948
18953
|
this.nestedData = data.nestedData
|
|
18949
18954
|
? data.nestedData.map(function (nd) {
|
|
@@ -24658,6 +24663,132 @@ var IkasBlogListPropValueProvider = /** @class */ (function () {
|
|
|
24658
24663
|
return IkasBlogListPropValueProvider;
|
|
24659
24664
|
}());
|
|
24660
24665
|
|
|
24666
|
+
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
24667
|
+
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
24668
|
+
this.attributePropValue = prop;
|
|
24669
|
+
this.pageSpecificData = pageSpecificData;
|
|
24670
|
+
}
|
|
24671
|
+
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
24672
|
+
var _a;
|
|
24673
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24674
|
+
var productDetail, productSearchResponse, productList, product, variant;
|
|
24675
|
+
var _this = this;
|
|
24676
|
+
return __generator(this, function (_b) {
|
|
24677
|
+
switch (_b.label) {
|
|
24678
|
+
case 0:
|
|
24679
|
+
if (!this.attributePropValue.attributeId ||
|
|
24680
|
+
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
24681
|
+
(!this.attributePropValue.usePageData &&
|
|
24682
|
+
!this.attributePropValue.variantId)) {
|
|
24683
|
+
return [2 /*return*/, []];
|
|
24684
|
+
}
|
|
24685
|
+
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
24686
|
+
productDetail = this.pageSpecificData;
|
|
24687
|
+
return [3 /*break*/, 3];
|
|
24688
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24689
|
+
productIdList: [this.attributePropValue.productId],
|
|
24690
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
24691
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
24692
|
+
})];
|
|
24693
|
+
case 2:
|
|
24694
|
+
productSearchResponse = _b.sent();
|
|
24695
|
+
if (productSearchResponse) {
|
|
24696
|
+
productList = productSearchResponse.data;
|
|
24697
|
+
if (productList.length) {
|
|
24698
|
+
product = productList[0];
|
|
24699
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
24700
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
24701
|
+
if (variant) {
|
|
24702
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
24703
|
+
}
|
|
24704
|
+
}
|
|
24705
|
+
else {
|
|
24706
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
24707
|
+
}
|
|
24708
|
+
}
|
|
24709
|
+
}
|
|
24710
|
+
_b.label = 3;
|
|
24711
|
+
case 3:
|
|
24712
|
+
if (!productDetail)
|
|
24713
|
+
return [2 /*return*/, []];
|
|
24714
|
+
return [2 /*return*/, productDetail.product.hasVariant
|
|
24715
|
+
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
24716
|
+
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
24717
|
+
}
|
|
24718
|
+
});
|
|
24719
|
+
});
|
|
24720
|
+
};
|
|
24721
|
+
return IkasAttributePropValueProvider;
|
|
24722
|
+
}());
|
|
24723
|
+
|
|
24724
|
+
var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
24725
|
+
function IkasAttributeListPropValueProvider(prop, pageSpecificData) {
|
|
24726
|
+
this.attributeListPropValue = prop;
|
|
24727
|
+
this.pageSpecificData = pageSpecificData;
|
|
24728
|
+
}
|
|
24729
|
+
IkasAttributeListPropValueProvider.prototype.getValue = function () {
|
|
24730
|
+
var _a, _b;
|
|
24731
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24732
|
+
var productDetail, productSearchResponse, productList, product, variant, groupedValues;
|
|
24733
|
+
var _this = this;
|
|
24734
|
+
return __generator(this, function (_c) {
|
|
24735
|
+
switch (_c.label) {
|
|
24736
|
+
case 0:
|
|
24737
|
+
if (!((_a = this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
24738
|
+
(this.attributeListPropValue.usePageData && !this.pageSpecificData) ||
|
|
24739
|
+
(!this.attributeListPropValue.usePageData &&
|
|
24740
|
+
!this.attributeListPropValue.variantId)) {
|
|
24741
|
+
return [2 /*return*/, []];
|
|
24742
|
+
}
|
|
24743
|
+
if (!((_b = this.attributeListPropValue) === null || _b === void 0 ? void 0 : _b.usePageData)) return [3 /*break*/, 1];
|
|
24744
|
+
productDetail = this.pageSpecificData;
|
|
24745
|
+
return [3 /*break*/, 3];
|
|
24746
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24747
|
+
productIdList: [this.attributeListPropValue.productId],
|
|
24748
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
24749
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
24750
|
+
})];
|
|
24751
|
+
case 2:
|
|
24752
|
+
productSearchResponse = _c.sent();
|
|
24753
|
+
if (productSearchResponse) {
|
|
24754
|
+
productList = productSearchResponse.data;
|
|
24755
|
+
if (productList.length) {
|
|
24756
|
+
product = productList[0];
|
|
24757
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
24758
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributeListPropValue.variantId; });
|
|
24759
|
+
if (variant) {
|
|
24760
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
24761
|
+
}
|
|
24762
|
+
}
|
|
24763
|
+
else {
|
|
24764
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
24765
|
+
}
|
|
24766
|
+
}
|
|
24767
|
+
}
|
|
24768
|
+
_c.label = 3;
|
|
24769
|
+
case 3:
|
|
24770
|
+
if (!productDetail)
|
|
24771
|
+
return [2 /*return*/, []];
|
|
24772
|
+
groupedValues = productDetail.product.hasVariant
|
|
24773
|
+
? groupBy_1(productDetail.selectedVariant.attributes.filter(function (a) { var _a; return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || ""); }), "productAttributeId")
|
|
24774
|
+
: groupBy_1(productDetail.product.attributes.filter(function (a) { var _a; return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || ""); }), "productAttributeId");
|
|
24775
|
+
return [2 /*return*/, this.attributeListPropValue.attributeIds
|
|
24776
|
+
.map(function (attributeId) {
|
|
24777
|
+
var values = groupedValues[attributeId];
|
|
24778
|
+
if ((values === null || values === void 0 ? void 0 : values.length) && values[0].productAttribute)
|
|
24779
|
+
return {
|
|
24780
|
+
attribute: values[0].productAttribute,
|
|
24781
|
+
values: values,
|
|
24782
|
+
};
|
|
24783
|
+
})
|
|
24784
|
+
.filter(function (v) { return !!v; })];
|
|
24785
|
+
}
|
|
24786
|
+
});
|
|
24787
|
+
});
|
|
24788
|
+
};
|
|
24789
|
+
return IkasAttributeListPropValueProvider;
|
|
24790
|
+
}());
|
|
24791
|
+
|
|
24661
24792
|
var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
24662
24793
|
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageDataProvider, pageSpecificData, pageParams) {
|
|
24663
24794
|
this.value = value;
|
|
@@ -24678,7 +24809,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24678
24809
|
return [2 /*return*/];
|
|
24679
24810
|
_b.label = 1;
|
|
24680
24811
|
case 1:
|
|
24681
|
-
_b.trys.push([1,
|
|
24812
|
+
_b.trys.push([1, 44, , 45]);
|
|
24682
24813
|
_a = this.customData.type;
|
|
24683
24814
|
switch (_a) {
|
|
24684
24815
|
case exports.IkasThemeComponentPropType.TEXT: return [3 /*break*/, 2];
|
|
@@ -24695,93 +24826,103 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24695
24826
|
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
24696
24827
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
24697
24828
|
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
24698
|
-
case exports.IkasThemeComponentPropType.
|
|
24699
|
-
case exports.IkasThemeComponentPropType.
|
|
24700
|
-
case exports.IkasThemeComponentPropType.
|
|
24701
|
-
case exports.IkasThemeComponentPropType.
|
|
24702
|
-
case exports.IkasThemeComponentPropType.
|
|
24703
|
-
case exports.IkasThemeComponentPropType.
|
|
24704
|
-
case exports.IkasThemeComponentPropType.
|
|
24829
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 28];
|
|
24830
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE_LIST: return [3 /*break*/, 30];
|
|
24831
|
+
case exports.IkasThemeComponentPropType.OBJECT: return [3 /*break*/, 32];
|
|
24832
|
+
case exports.IkasThemeComponentPropType.DYNAMIC_LIST: return [3 /*break*/, 34];
|
|
24833
|
+
case exports.IkasThemeComponentPropType.STATIC_LIST: return [3 /*break*/, 34];
|
|
24834
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 36];
|
|
24835
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 36];
|
|
24836
|
+
case exports.IkasThemeComponentPropType.BLOG: return [3 /*break*/, 38];
|
|
24837
|
+
case exports.IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 40];
|
|
24705
24838
|
}
|
|
24706
|
-
return [3 /*break*/,
|
|
24839
|
+
return [3 /*break*/, 42];
|
|
24707
24840
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
24708
24841
|
case 3:
|
|
24709
24842
|
customDataValue = _b.sent();
|
|
24710
|
-
return [3 /*break*/,
|
|
24843
|
+
return [3 /*break*/, 43];
|
|
24711
24844
|
case 4: return [4 /*yield*/, this.getRichTextPropValue()];
|
|
24712
24845
|
case 5:
|
|
24713
24846
|
customDataValue = _b.sent();
|
|
24714
|
-
return [3 /*break*/,
|
|
24847
|
+
return [3 /*break*/, 43];
|
|
24715
24848
|
case 6: return [4 /*yield*/, this.getBooleanValue()];
|
|
24716
24849
|
case 7:
|
|
24717
24850
|
customDataValue = _b.sent();
|
|
24718
|
-
return [3 /*break*/,
|
|
24851
|
+
return [3 /*break*/, 43];
|
|
24719
24852
|
case 8: return [4 /*yield*/, this.getBrandListPropValue()];
|
|
24720
24853
|
case 9:
|
|
24721
24854
|
customDataValue = _b.sent();
|
|
24722
|
-
return [3 /*break*/,
|
|
24855
|
+
return [3 /*break*/, 43];
|
|
24723
24856
|
case 10: return [4 /*yield*/, this.getBrandPropValue()];
|
|
24724
24857
|
case 11:
|
|
24725
24858
|
customDataValue = _b.sent();
|
|
24726
|
-
return [3 /*break*/,
|
|
24859
|
+
return [3 /*break*/, 43];
|
|
24727
24860
|
case 12: return [4 /*yield*/, this.getCategoryListPropValue()];
|
|
24728
24861
|
case 13:
|
|
24729
24862
|
customDataValue = _b.sent();
|
|
24730
|
-
return [3 /*break*/,
|
|
24863
|
+
return [3 /*break*/, 43];
|
|
24731
24864
|
case 14: return [4 /*yield*/, this.getCategoryPropValue()];
|
|
24732
24865
|
case 15:
|
|
24733
24866
|
customDataValue = _b.sent();
|
|
24734
|
-
return [3 /*break*/,
|
|
24867
|
+
return [3 /*break*/, 43];
|
|
24735
24868
|
case 16: return [4 /*yield*/, this.getColorPropValue()];
|
|
24736
24869
|
case 17:
|
|
24737
24870
|
customDataValue = _b.sent();
|
|
24738
|
-
return [3 /*break*/,
|
|
24871
|
+
return [3 /*break*/, 43];
|
|
24739
24872
|
case 18: return [4 /*yield*/, this.getImageListPropValue()];
|
|
24740
24873
|
case 19:
|
|
24741
24874
|
customDataValue = _b.sent();
|
|
24742
|
-
return [3 /*break*/,
|
|
24875
|
+
return [3 /*break*/, 43];
|
|
24743
24876
|
case 20: return [4 /*yield*/, this.getImagePropValue()];
|
|
24744
24877
|
case 21:
|
|
24745
24878
|
customDataValue = _b.sent();
|
|
24746
|
-
return [3 /*break*/,
|
|
24879
|
+
return [3 /*break*/, 43];
|
|
24747
24880
|
case 22: return [4 /*yield*/, this.getLinkPropValue()];
|
|
24748
24881
|
case 23:
|
|
24749
24882
|
customDataValue = _b.sent();
|
|
24750
|
-
return [3 /*break*/,
|
|
24883
|
+
return [3 /*break*/, 43];
|
|
24751
24884
|
case 24: return [4 /*yield*/, this.getProductDetailPropValue()];
|
|
24752
24885
|
case 25:
|
|
24753
24886
|
customDataValue = _b.sent();
|
|
24754
|
-
return [3 /*break*/,
|
|
24887
|
+
return [3 /*break*/, 43];
|
|
24755
24888
|
case 26: return [4 /*yield*/, this.getProductListPropValue()];
|
|
24756
24889
|
case 27:
|
|
24757
24890
|
customDataValue = _b.sent();
|
|
24758
|
-
return [3 /*break*/,
|
|
24759
|
-
case 28: return [4 /*yield*/, this.
|
|
24891
|
+
return [3 /*break*/, 43];
|
|
24892
|
+
case 28: return [4 /*yield*/, this.getProductAttributePropValue()];
|
|
24760
24893
|
case 29:
|
|
24761
24894
|
customDataValue = _b.sent();
|
|
24762
|
-
return [3 /*break*/,
|
|
24763
|
-
case 30: return [4 /*yield*/, this.
|
|
24895
|
+
return [3 /*break*/, 43];
|
|
24896
|
+
case 30: return [4 /*yield*/, this.getProductAttributeListPropValue()];
|
|
24764
24897
|
case 31:
|
|
24765
24898
|
customDataValue = _b.sent();
|
|
24766
|
-
return [3 /*break*/,
|
|
24767
|
-
case 32: return [4 /*yield*/, this.
|
|
24899
|
+
return [3 /*break*/, 43];
|
|
24900
|
+
case 32: return [4 /*yield*/, this.getObjectValue()];
|
|
24768
24901
|
case 33:
|
|
24769
24902
|
customDataValue = _b.sent();
|
|
24770
|
-
return [3 /*break*/,
|
|
24771
|
-
case 34: return [4 /*yield*/, this.
|
|
24903
|
+
return [3 /*break*/, 43];
|
|
24904
|
+
case 34: return [4 /*yield*/, this.getArrayValue()];
|
|
24772
24905
|
case 35:
|
|
24773
24906
|
customDataValue = _b.sent();
|
|
24774
|
-
return [3 /*break*/,
|
|
24775
|
-
case 36: return [4 /*yield*/, this.
|
|
24907
|
+
return [3 /*break*/, 43];
|
|
24908
|
+
case 36: return [4 /*yield*/, this.getComponentListValue()];
|
|
24776
24909
|
case 37:
|
|
24777
24910
|
customDataValue = _b.sent();
|
|
24778
|
-
return [3 /*break*/,
|
|
24779
|
-
case 38: return [
|
|
24780
|
-
case 39:
|
|
24781
|
-
|
|
24911
|
+
return [3 /*break*/, 43];
|
|
24912
|
+
case 38: return [4 /*yield*/, this.getBlogValue()];
|
|
24913
|
+
case 39:
|
|
24914
|
+
customDataValue = _b.sent();
|
|
24915
|
+
return [3 /*break*/, 43];
|
|
24916
|
+
case 40: return [4 /*yield*/, this.getBlogListValue()];
|
|
24917
|
+
case 41:
|
|
24918
|
+
customDataValue = _b.sent();
|
|
24919
|
+
return [3 /*break*/, 43];
|
|
24920
|
+
case 42: return [3 /*break*/, 43];
|
|
24921
|
+
case 43: return [3 /*break*/, 45];
|
|
24922
|
+
case 44:
|
|
24782
24923
|
_b.sent();
|
|
24783
24924
|
return [2 /*return*/];
|
|
24784
|
-
case
|
|
24925
|
+
case 45:
|
|
24785
24926
|
if (this.customData.isRequired &&
|
|
24786
24927
|
((customDataValue === null || customDataValue === void 0 ? void 0 : customDataValue.value) === undefined || (customDataValue === null || customDataValue === void 0 ? void 0 : customDataValue.value) === null))
|
|
24787
24928
|
return [2 /*return*/];
|
|
@@ -25006,6 +25147,42 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
25006
25147
|
});
|
|
25007
25148
|
});
|
|
25008
25149
|
};
|
|
25150
|
+
IkasCustomPropValueProvider.prototype.getProductAttributePropValue = function () {
|
|
25151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
25152
|
+
var provider, value;
|
|
25153
|
+
return __generator(this, function (_a) {
|
|
25154
|
+
switch (_a.label) {
|
|
25155
|
+
case 0:
|
|
25156
|
+
provider = new IkasAttributePropValueProvider(this.value, this.pageSpecificData);
|
|
25157
|
+
return [4 /*yield*/, provider.getValue()];
|
|
25158
|
+
case 1:
|
|
25159
|
+
value = _a.sent();
|
|
25160
|
+
return [2 /*return*/, {
|
|
25161
|
+
value: value,
|
|
25162
|
+
customData: this.customData,
|
|
25163
|
+
}];
|
|
25164
|
+
}
|
|
25165
|
+
});
|
|
25166
|
+
});
|
|
25167
|
+
};
|
|
25168
|
+
IkasCustomPropValueProvider.prototype.getProductAttributeListPropValue = function () {
|
|
25169
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
25170
|
+
var provider, value;
|
|
25171
|
+
return __generator(this, function (_a) {
|
|
25172
|
+
switch (_a.label) {
|
|
25173
|
+
case 0:
|
|
25174
|
+
provider = new IkasAttributeListPropValueProvider(this.value, this.pageSpecificData);
|
|
25175
|
+
return [4 /*yield*/, provider.getValue()];
|
|
25176
|
+
case 1:
|
|
25177
|
+
value = _a.sent();
|
|
25178
|
+
return [2 /*return*/, {
|
|
25179
|
+
value: value,
|
|
25180
|
+
customData: this.customData,
|
|
25181
|
+
}];
|
|
25182
|
+
}
|
|
25183
|
+
});
|
|
25184
|
+
});
|
|
25185
|
+
};
|
|
25009
25186
|
IkasCustomPropValueProvider.prototype.getTextValue = function () {
|
|
25010
25187
|
return __awaiter(this, void 0, void 0, function () {
|
|
25011
25188
|
var provider, value;
|
|
@@ -25469,64 +25646,6 @@ var pageStyle = {
|
|
|
25469
25646
|
justifyContent: "space-between",
|
|
25470
25647
|
};
|
|
25471
25648
|
|
|
25472
|
-
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
25473
|
-
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
25474
|
-
this.attributePropValue = prop;
|
|
25475
|
-
this.pageSpecificData = pageSpecificData;
|
|
25476
|
-
}
|
|
25477
|
-
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
25478
|
-
var _a;
|
|
25479
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25480
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
25481
|
-
var _this = this;
|
|
25482
|
-
return __generator(this, function (_b) {
|
|
25483
|
-
switch (_b.label) {
|
|
25484
|
-
case 0:
|
|
25485
|
-
if (!this.attributePropValue.attributeId ||
|
|
25486
|
-
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
25487
|
-
(!this.attributePropValue.usePageData &&
|
|
25488
|
-
!this.attributePropValue.variantId)) {
|
|
25489
|
-
return [2 /*return*/, []];
|
|
25490
|
-
}
|
|
25491
|
-
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
25492
|
-
productDetail = this.pageSpecificData;
|
|
25493
|
-
return [3 /*break*/, 3];
|
|
25494
|
-
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
25495
|
-
productIdList: [this.attributePropValue.productId],
|
|
25496
|
-
priceListId: IkasStorefrontConfig.priceListId,
|
|
25497
|
-
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
25498
|
-
})];
|
|
25499
|
-
case 2:
|
|
25500
|
-
productSearchResponse = _b.sent();
|
|
25501
|
-
if (productSearchResponse) {
|
|
25502
|
-
productList = productSearchResponse.data;
|
|
25503
|
-
if (productList.length) {
|
|
25504
|
-
product = productList[0];
|
|
25505
|
-
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
25506
|
-
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
25507
|
-
if (variant) {
|
|
25508
|
-
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
25509
|
-
}
|
|
25510
|
-
}
|
|
25511
|
-
else {
|
|
25512
|
-
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
25513
|
-
}
|
|
25514
|
-
}
|
|
25515
|
-
}
|
|
25516
|
-
_b.label = 3;
|
|
25517
|
-
case 3:
|
|
25518
|
-
if (!productDetail)
|
|
25519
|
-
return [2 /*return*/, []];
|
|
25520
|
-
return [2 /*return*/, productDetail.product.hasVariant
|
|
25521
|
-
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
25522
|
-
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
25523
|
-
}
|
|
25524
|
-
});
|
|
25525
|
-
});
|
|
25526
|
-
};
|
|
25527
|
-
return IkasAttributePropValueProvider;
|
|
25528
|
-
}());
|
|
25529
|
-
|
|
25530
25649
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
25531
25650
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
25532
25651
|
this.pageType = null;
|
|
@@ -25916,79 +26035,83 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25916
26035
|
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
25917
26036
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
25918
26037
|
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 10];
|
|
25919
|
-
case exports.IkasThemeComponentPropType.
|
|
25920
|
-
case exports.IkasThemeComponentPropType.
|
|
25921
|
-
case exports.IkasThemeComponentPropType.
|
|
25922
|
-
case exports.IkasThemeComponentPropType.
|
|
25923
|
-
case exports.IkasThemeComponentPropType.
|
|
25924
|
-
case exports.IkasThemeComponentPropType.
|
|
25925
|
-
case exports.IkasThemeComponentPropType.
|
|
25926
|
-
case exports.IkasThemeComponentPropType.
|
|
25927
|
-
case exports.IkasThemeComponentPropType.
|
|
25928
|
-
case exports.IkasThemeComponentPropType.
|
|
26038
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE_LIST: return [3 /*break*/, 11];
|
|
26039
|
+
case exports.IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 12];
|
|
26040
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 13];
|
|
26041
|
+
case exports.IkasThemeComponentPropType.LINK: return [3 /*break*/, 14];
|
|
26042
|
+
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 14];
|
|
26043
|
+
case exports.IkasThemeComponentPropType.COLOR: return [3 /*break*/, 15];
|
|
26044
|
+
case exports.IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 16];
|
|
26045
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 17];
|
|
26046
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 17];
|
|
26047
|
+
case exports.IkasThemeComponentPropType.BLOG: return [3 /*break*/, 19];
|
|
26048
|
+
case exports.IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 20];
|
|
25929
26049
|
}
|
|
25930
|
-
return [3 /*break*/,
|
|
26050
|
+
return [3 /*break*/, 21];
|
|
25931
26051
|
case 1:
|
|
25932
26052
|
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
25933
|
-
return [3 /*break*/,
|
|
26053
|
+
return [3 /*break*/, 22];
|
|
25934
26054
|
case 2:
|
|
25935
26055
|
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
25936
|
-
return [3 /*break*/,
|
|
26056
|
+
return [3 /*break*/, 22];
|
|
25937
26057
|
case 3:
|
|
25938
26058
|
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
25939
|
-
return [3 /*break*/,
|
|
26059
|
+
return [3 /*break*/, 22];
|
|
25940
26060
|
case 4:
|
|
25941
26061
|
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
25942
|
-
return [3 /*break*/,
|
|
26062
|
+
return [3 /*break*/, 22];
|
|
25943
26063
|
case 5:
|
|
25944
26064
|
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
25945
|
-
return [3 /*break*/,
|
|
26065
|
+
return [3 /*break*/, 22];
|
|
25946
26066
|
case 6:
|
|
25947
26067
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
25948
|
-
return [3 /*break*/,
|
|
26068
|
+
return [3 /*break*/, 22];
|
|
25949
26069
|
case 7:
|
|
25950
26070
|
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
25951
|
-
return [3 /*break*/,
|
|
26071
|
+
return [3 /*break*/, 22];
|
|
25952
26072
|
case 8:
|
|
25953
26073
|
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25954
|
-
return [3 /*break*/,
|
|
26074
|
+
return [3 /*break*/, 22];
|
|
25955
26075
|
case 9:
|
|
25956
26076
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
25957
|
-
return [3 /*break*/,
|
|
26077
|
+
return [3 /*break*/, 22];
|
|
25958
26078
|
case 10:
|
|
25959
26079
|
propValueProvider = new IkasAttributePropValueProvider(propValue, this.pageSpecificData);
|
|
25960
|
-
return [3 /*break*/,
|
|
26080
|
+
return [3 /*break*/, 22];
|
|
25961
26081
|
case 11:
|
|
25962
|
-
propValueProvider = new
|
|
25963
|
-
return [3 /*break*/,
|
|
26082
|
+
propValueProvider = new IkasAttributeListPropValueProvider(propValue, this.pageSpecificData);
|
|
26083
|
+
return [3 /*break*/, 22];
|
|
25964
26084
|
case 12:
|
|
25965
|
-
propValueProvider = new
|
|
25966
|
-
return [3 /*break*/,
|
|
26085
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
26086
|
+
return [3 /*break*/, 22];
|
|
25967
26087
|
case 13:
|
|
25968
|
-
propValueProvider = new
|
|
25969
|
-
return [3 /*break*/,
|
|
26088
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
26089
|
+
return [3 /*break*/, 22];
|
|
25970
26090
|
case 14:
|
|
25971
|
-
propValueProvider = new
|
|
25972
|
-
return [3 /*break*/,
|
|
26091
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
26092
|
+
return [3 /*break*/, 22];
|
|
25973
26093
|
case 15:
|
|
26094
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
26095
|
+
return [3 /*break*/, 22];
|
|
26096
|
+
case 16:
|
|
25974
26097
|
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
25975
26098
|
if (!customData)
|
|
25976
26099
|
return [2 /*return*/];
|
|
25977
26100
|
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
25978
|
-
return [3 /*break*/,
|
|
25979
|
-
case
|
|
26101
|
+
return [3 /*break*/, 22];
|
|
26102
|
+
case 17:
|
|
25980
26103
|
pageComponents = propValue;
|
|
25981
26104
|
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
25982
|
-
case
|
|
25983
|
-
case 18:
|
|
25984
|
-
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25985
|
-
return [3 /*break*/, 21];
|
|
26105
|
+
case 18: return [2 /*return*/, _b.sent()];
|
|
25986
26106
|
case 19:
|
|
26107
|
+
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
26108
|
+
return [3 /*break*/, 22];
|
|
26109
|
+
case 20:
|
|
25987
26110
|
propValueProvider = new IkasBlogListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25988
|
-
return [3 /*break*/,
|
|
25989
|
-
case
|
|
25990
|
-
case
|
|
25991
|
-
case
|
|
26111
|
+
return [3 /*break*/, 22];
|
|
26112
|
+
case 21: return [3 /*break*/, 22];
|
|
26113
|
+
case 22: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
26114
|
+
case 23: return [2 /*return*/, _b.sent()];
|
|
25992
26115
|
}
|
|
25993
26116
|
});
|
|
25994
26117
|
});
|
|
@@ -26124,6 +26247,17 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
26124
26247
|
? propValue.map(function (p) { return new IkasProductAttributeValue(p); })
|
|
26125
26248
|
: [];
|
|
26126
26249
|
};
|
|
26250
|
+
IkasPageDataProvider.initAttributeListPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
26251
|
+
pageComponentPropValue.propValues[prop.name] = IkasPageDataProvider._initAttributeListPropValue(propValue);
|
|
26252
|
+
};
|
|
26253
|
+
IkasPageDataProvider._initAttributeListPropValue = function (propValue) {
|
|
26254
|
+
return propValue
|
|
26255
|
+
? propValue.map(function (p) { return ({
|
|
26256
|
+
attribute: new IkasProductAttribute(p.attribute),
|
|
26257
|
+
values: p.values.map(function (v) { return new IkasProductAttributeValue(v); }),
|
|
26258
|
+
}); })
|
|
26259
|
+
: [];
|
|
26260
|
+
};
|
|
26127
26261
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
26128
26262
|
pageComponentPropValue.propValues[prop.name] = this._initLinkPropValue(propValue);
|
|
26129
26263
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IkasProductAttributeType } from "../../../data/product-attribute/index";
|
|
1
2
|
export declare class IkasThemeComponentProp {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -5,6 +6,7 @@ export declare class IkasThemeComponentProp {
|
|
|
5
6
|
type: IkasThemeComponentPropType;
|
|
6
7
|
isRequired: boolean;
|
|
7
8
|
customDataId?: string | null;
|
|
9
|
+
attributeTypes?: IkasProductAttributeType[] | null;
|
|
8
10
|
constructor(data: Partial<IkasThemeComponentProp>);
|
|
9
11
|
}
|
|
10
12
|
export declare enum IkasThemeComponentPropType {
|
|
@@ -18,6 +20,7 @@ export declare enum IkasThemeComponentPropType {
|
|
|
18
20
|
PRODUCT_DETAIL = "PRODUCT_DETAIL",
|
|
19
21
|
PRODUCT_LIST = "PRODUCT_LIST",
|
|
20
22
|
PRODUCT_ATTRIBUTE = "PRODUCT_ATTRIBUTE",
|
|
23
|
+
PRODUCT_ATTRIBUTE_LIST = "PRODUCT_ATTRIBUTE_LIST",
|
|
21
24
|
BRAND = "BRAND",
|
|
22
25
|
BRAND_LIST = "BRAND_LIST",
|
|
23
26
|
CATEGORY = "CATEGORY",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IkasProductAttributeType } from "../../data/product-attribute/index";
|
|
1
2
|
import { IkasThemeComponentPropType } from "../component/prop/index";
|
|
2
3
|
export declare class IkasThemeCustomData {
|
|
3
4
|
id: string;
|
|
@@ -7,6 +8,7 @@ export declare class IkasThemeCustomData {
|
|
|
7
8
|
key?: string | null;
|
|
8
9
|
nestedData?: IkasThemeCustomData[] | null;
|
|
9
10
|
itemCount?: number | null;
|
|
11
|
+
attributeTypes?: IkasProductAttributeType[] | null;
|
|
10
12
|
isRoot: boolean;
|
|
11
13
|
parent?: IkasThemeCustomData | null;
|
|
12
14
|
constructor(data?: Partial<IkasThemeCustomData>);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { NextRouter } from "next/router";
|
|
2
|
-
import { IkasTheme, IkasThemePageType, IkasThemePageComponent, IkasProductDetail, IkasThemeComponentProp, IkasThemeComponent, IkasProductList, IkasBrandList, IkasBrandListParams, IkasThemePage, IkasImage, IkasCategoryList, IkasBrand, IkasCategory, IkasThemeCustomData, IkasMerchantSettings, IkasThemeSettings, IkasComponentRenderer, IkasBlogListParams, IkasBlogList, IkasProductAttributeValue } from "../../models/index";
|
|
2
|
+
import { IkasTheme, IkasThemePageType, IkasThemePageComponent, IkasProductDetail, IkasThemeComponentProp, IkasThemeComponent, IkasProductList, IkasBrandList, IkasBrandListParams, IkasThemePage, IkasImage, IkasCategoryList, IkasBrand, IkasCategory, IkasThemeCustomData, IkasMerchantSettings, IkasThemeSettings, IkasComponentRenderer, IkasBlogListParams, IkasBlogList, IkasProductAttributeValue, IkasProductAttribute } from "../../models/index";
|
|
3
3
|
import { IkasProductListParams } from "../../models/ui/product-list/index";
|
|
4
4
|
import { IkasNavigationLink } from "../../models/ui/navigation-link/index";
|
|
5
5
|
import { IkasCategoryListParams } from "../../models/ui/category-list/index";
|
|
6
6
|
import { CustomDataValue } from "./prop-value/custom";
|
|
7
7
|
import { IkasThemePageSpecification } from "../../models/theme/page/index";
|
|
8
8
|
import { IkasBlog } from "../../models/data/blog/index";
|
|
9
|
+
import { IkasProductAttributeMap } from "./prop-value/attribute-list";
|
|
9
10
|
export declare class IkasPageDataProvider {
|
|
10
11
|
theme: IkasTheme;
|
|
11
12
|
pageType?: IkasThemePageType | null;
|
|
@@ -63,6 +64,11 @@ export declare class IkasPageDataProvider {
|
|
|
63
64
|
static _initProductDetailPropValue(propValue: any, router: NextRouter, isBrowser?: boolean): IkasProductDetail;
|
|
64
65
|
static initAttributePropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
65
66
|
static _initAttributePropValue(propValue: IkasProductAttributeValue[]): IkasProductAttributeValue[];
|
|
67
|
+
static initAttributeListPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
68
|
+
static _initAttributeListPropValue(propValue: IkasProductAttributeMap[]): {
|
|
69
|
+
attribute: IkasProductAttribute;
|
|
70
|
+
values: IkasProductAttributeValue[];
|
|
71
|
+
}[];
|
|
66
72
|
static initLinkPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
67
73
|
static _initLinkPropValue(propValue: any): IkasNavigationLink | IkasNavigationLink[] | undefined;
|
|
68
74
|
static initImagePropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IkasProductAttribute, IkasProductAttributeValue } from "../../../models/index";
|
|
2
|
+
import IkasPropValueProvider from "./index";
|
|
3
|
+
import { IkasAttributeListPropValue } from "../../../models/theme/page/component/prop-value/attribute-list";
|
|
4
|
+
export declare class IkasAttributeListPropValueProvider implements IkasPropValueProvider<IkasProductAttributeMap[]> {
|
|
5
|
+
private attributeListPropValue;
|
|
6
|
+
private pageSpecificData?;
|
|
7
|
+
constructor(prop: IkasAttributeListPropValue, pageSpecificData?: any);
|
|
8
|
+
getValue(): Promise<IkasProductAttributeMap[]>;
|
|
9
|
+
}
|
|
10
|
+
export declare type IkasProductAttributeMap = {
|
|
11
|
+
attribute: IkasProductAttribute;
|
|
12
|
+
values: IkasProductAttributeValue[];
|
|
13
|
+
};
|
|
@@ -23,6 +23,8 @@ export declare class IkasCustomPropValueProvider implements IkasPropValueProvide
|
|
|
23
23
|
private getLinkPropValue;
|
|
24
24
|
private getProductDetailPropValue;
|
|
25
25
|
private getProductListPropValue;
|
|
26
|
+
private getProductAttributePropValue;
|
|
27
|
+
private getProductAttributeListPropValue;
|
|
26
28
|
private getTextValue;
|
|
27
29
|
private getObjectValue;
|
|
28
30
|
private getArrayValue;
|