@ikas/storefront 0.0.135 → 0.0.137
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 +207 -112
- package/build/index.js +206 -110
- package/build/models/data/product/attribute-value/index.d.ts +6 -0
- package/build/models/data/product-attribute/index.d.ts +4 -1
- package/build/models/data/product-attribute/product-attribute-table-cell/index.d.ts +5 -0
- package/build/models/data/product-attribute/product-attribute-table-template/index.d.ts +6 -0
- package/build/models/data/simple-product/index.d.ts +3 -2
- package/build/models/theme/component/prop/index.d.ts +5 -1
- package/build/models/theme/custom-data/index.d.ts +2 -25
- package/build/models/theme/index.d.ts +1 -1
- package/build/models/theme/page/component/prop-value/attribute.d.ts +7 -0
- package/build/models/ui/product-list/index.d.ts +1 -0
- package/build/utils/providers/page-data.d.ts +3 -1
- package/build/utils/providers/prop-value/attribute.d.ts +9 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -17975,6 +17975,7 @@ var IkasProductAttribute = /** @class */ (function () {
|
|
|
17975
17975
|
this.name = data.name || "";
|
|
17976
17976
|
this.type = data.type || IkasProductAttributeType.TEXT;
|
|
17977
17977
|
this.options = data.options || null;
|
|
17978
|
+
this.tableTemplate = data.tableTemplate || null;
|
|
17978
17979
|
mobx.makeAutoObservable(this);
|
|
17979
17980
|
}
|
|
17980
17981
|
return IkasProductAttribute;
|
|
@@ -17988,6 +17989,7 @@ var IkasProductAttributeType;
|
|
|
17988
17989
|
IkasProductAttributeType["NUMERIC"] = "NUMERIC";
|
|
17989
17990
|
IkasProductAttributeType["DATETIME"] = "DATETIME";
|
|
17990
17991
|
IkasProductAttributeType["HTML"] = "HTML";
|
|
17992
|
+
IkasProductAttributeType["TABLE"] = "TABLE";
|
|
17991
17993
|
})(IkasProductAttributeType || (IkasProductAttributeType = {}));
|
|
17992
17994
|
|
|
17993
17995
|
var IkasProductAttributeValue = /** @class */ (function () {
|
|
@@ -18003,6 +18005,14 @@ var IkasProductAttributeValue = /** @class */ (function () {
|
|
|
18003
18005
|
: null;
|
|
18004
18006
|
mobx.makeAutoObservable(this);
|
|
18005
18007
|
}
|
|
18008
|
+
Object.defineProperty(IkasProductAttributeValue.prototype, "tableValue", {
|
|
18009
|
+
get: function () {
|
|
18010
|
+
if (this.value)
|
|
18011
|
+
return JSON.parse(this.value);
|
|
18012
|
+
},
|
|
18013
|
+
enumerable: false,
|
|
18014
|
+
configurable: true
|
|
18015
|
+
});
|
|
18006
18016
|
return IkasProductAttributeValue;
|
|
18007
18017
|
}());
|
|
18008
18018
|
|
|
@@ -18591,6 +18601,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
18591
18601
|
IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
18592
18602
|
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18593
18603
|
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18604
|
+
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE"] = "PRODUCT_ATTRIBUTE";
|
|
18594
18605
|
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
18595
18606
|
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
18596
18607
|
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
@@ -18601,6 +18612,9 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
18601
18612
|
IkasThemeComponentPropType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
18602
18613
|
IkasThemeComponentPropType["BLOG"] = "BLOG";
|
|
18603
18614
|
IkasThemeComponentPropType["BLOG_LIST"] = "BLOG_LIST";
|
|
18615
|
+
IkasThemeComponentPropType["OBJECT"] = "OBJECT";
|
|
18616
|
+
IkasThemeComponentPropType["STATIC_LIST"] = "STATIC_LIST";
|
|
18617
|
+
IkasThemeComponentPropType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
18604
18618
|
})(exports.IkasThemeComponentPropType || (exports.IkasThemeComponentPropType = {}));
|
|
18605
18619
|
|
|
18606
18620
|
var IkasThemeComponent = /** @class */ (function () {
|
|
@@ -18624,7 +18638,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18624
18638
|
if (data === void 0) { data = {}; }
|
|
18625
18639
|
this.id = data.id || "";
|
|
18626
18640
|
this.name = data.name || null;
|
|
18627
|
-
this.type = data.type || exports.
|
|
18641
|
+
this.type = data.type || exports.IkasThemeComponentPropType.TEXT;
|
|
18628
18642
|
this.isRequired = data.isRequired !== undefined ? data.isRequired : true;
|
|
18629
18643
|
this.key = data.key || null;
|
|
18630
18644
|
this.parent = data.parent || null;
|
|
@@ -18635,7 +18649,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18635
18649
|
return new IkasThemeCustomData(__assign(__assign({}, nd), { parent: _this }));
|
|
18636
18650
|
})
|
|
18637
18651
|
: null;
|
|
18638
|
-
if (this.type === exports.
|
|
18652
|
+
if (this.type === exports.IkasThemeComponentPropType.STATIC_LIST && !this.itemCount)
|
|
18639
18653
|
this.itemCount = 1;
|
|
18640
18654
|
mobx.makeAutoObservable(this);
|
|
18641
18655
|
}
|
|
@@ -18645,31 +18659,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18645
18659
|
return obj;
|
|
18646
18660
|
};
|
|
18647
18661
|
return IkasThemeCustomData;
|
|
18648
|
-
}());
|
|
18649
|
-
(function (IkasThemeCustomDataType) {
|
|
18650
|
-
IkasThemeCustomDataType["TEXT"] = "TEXT";
|
|
18651
|
-
IkasThemeCustomDataType["RICH_TEXT"] = "RICH_TEXT";
|
|
18652
|
-
IkasThemeCustomDataType["NUMBER"] = "NUMBER";
|
|
18653
|
-
IkasThemeCustomDataType["BOOLEAN"] = "BOOLEAN";
|
|
18654
|
-
IkasThemeCustomDataType["IMAGE"] = "IMAGE";
|
|
18655
|
-
IkasThemeCustomDataType["IMAGE_LIST"] = "IMAGE_LIST";
|
|
18656
|
-
IkasThemeCustomDataType["LINK"] = "LINK";
|
|
18657
|
-
IkasThemeCustomDataType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
18658
|
-
IkasThemeCustomDataType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18659
|
-
IkasThemeCustomDataType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18660
|
-
IkasThemeCustomDataType["BRAND"] = "BRAND";
|
|
18661
|
-
IkasThemeCustomDataType["BRAND_LIST"] = "BRAND_LIST";
|
|
18662
|
-
IkasThemeCustomDataType["CATEGORY"] = "CATEGORY";
|
|
18663
|
-
IkasThemeCustomDataType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
18664
|
-
IkasThemeCustomDataType["COLOR"] = "COLOR";
|
|
18665
|
-
IkasThemeCustomDataType["COMPONENT"] = "COMPONENT";
|
|
18666
|
-
IkasThemeCustomDataType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
18667
|
-
IkasThemeCustomDataType["BLOG"] = "BLOG";
|
|
18668
|
-
IkasThemeCustomDataType["BLOG_LIST"] = "BLOG_LIST";
|
|
18669
|
-
IkasThemeCustomDataType["OBJECT"] = "OBJECT";
|
|
18670
|
-
IkasThemeCustomDataType["STATIC_LIST"] = "STATIC_LIST";
|
|
18671
|
-
IkasThemeCustomDataType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
18672
|
-
})(exports.IkasThemeCustomDataType || (exports.IkasThemeCustomDataType = {}));
|
|
18662
|
+
}());
|
|
18673
18663
|
|
|
18674
18664
|
var IkasThemePageComponent = /** @class */ (function () {
|
|
18675
18665
|
function IkasThemePageComponent(data) {
|
|
@@ -21207,8 +21197,10 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21207
21197
|
}); };
|
|
21208
21198
|
this.searchDebouncer = debounce_1(function () {
|
|
21209
21199
|
_this.applyFilters();
|
|
21210
|
-
Analytics.search(_this._searchKeyword);
|
|
21211
21200
|
}, 100);
|
|
21201
|
+
this.analyticsDebouncer = debounce_1(function () {
|
|
21202
|
+
Analytics.search(_this._searchKeyword);
|
|
21203
|
+
}, 1000);
|
|
21212
21204
|
this.data = data.data
|
|
21213
21205
|
? data.data.map(function (d) { return new IkasProductDetail(d.product, d.selectedVariantValues); })
|
|
21214
21206
|
: [];
|
|
@@ -21285,6 +21277,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21285
21277
|
return;
|
|
21286
21278
|
this._searchKeyword = value;
|
|
21287
21279
|
this.searchDebouncer();
|
|
21280
|
+
this.analyticsDebouncer();
|
|
21288
21281
|
},
|
|
21289
21282
|
enumerable: false,
|
|
21290
21283
|
configurable: true
|
|
@@ -24199,27 +24192,27 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24199
24192
|
_b.trys.push([1, 40, , 41]);
|
|
24200
24193
|
_a = this.customData.type;
|
|
24201
24194
|
switch (_a) {
|
|
24202
|
-
case exports.
|
|
24203
|
-
case exports.
|
|
24204
|
-
case exports.
|
|
24205
|
-
case exports.
|
|
24206
|
-
case exports.
|
|
24207
|
-
case exports.
|
|
24208
|
-
case exports.
|
|
24209
|
-
case exports.
|
|
24210
|
-
case exports.
|
|
24211
|
-
case exports.
|
|
24212
|
-
case exports.
|
|
24213
|
-
case exports.
|
|
24214
|
-
case exports.
|
|
24215
|
-
case exports.
|
|
24216
|
-
case exports.
|
|
24217
|
-
case exports.
|
|
24218
|
-
case exports.
|
|
24219
|
-
case exports.
|
|
24220
|
-
case exports.
|
|
24221
|
-
case exports.
|
|
24222
|
-
case exports.
|
|
24195
|
+
case exports.IkasThemeComponentPropType.TEXT: return [3 /*break*/, 2];
|
|
24196
|
+
case exports.IkasThemeComponentPropType.RICH_TEXT: return [3 /*break*/, 4];
|
|
24197
|
+
case exports.IkasThemeComponentPropType.BOOLEAN: return [3 /*break*/, 6];
|
|
24198
|
+
case exports.IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 8];
|
|
24199
|
+
case exports.IkasThemeComponentPropType.BRAND: return [3 /*break*/, 10];
|
|
24200
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
24201
|
+
case exports.IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 14];
|
|
24202
|
+
case exports.IkasThemeComponentPropType.COLOR: return [3 /*break*/, 16];
|
|
24203
|
+
case exports.IkasThemeComponentPropType.IMAGE_LIST: return [3 /*break*/, 18];
|
|
24204
|
+
case exports.IkasThemeComponentPropType.IMAGE: return [3 /*break*/, 20];
|
|
24205
|
+
case exports.IkasThemeComponentPropType.LINK: return [3 /*break*/, 22];
|
|
24206
|
+
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
24207
|
+
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
24208
|
+
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
24209
|
+
case exports.IkasThemeComponentPropType.OBJECT: return [3 /*break*/, 28];
|
|
24210
|
+
case exports.IkasThemeComponentPropType.DYNAMIC_LIST: return [3 /*break*/, 30];
|
|
24211
|
+
case exports.IkasThemeComponentPropType.STATIC_LIST: return [3 /*break*/, 30];
|
|
24212
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 32];
|
|
24213
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 32];
|
|
24214
|
+
case exports.IkasThemeComponentPropType.BLOG: return [3 /*break*/, 34];
|
|
24215
|
+
case exports.IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 36];
|
|
24223
24216
|
}
|
|
24224
24217
|
return [3 /*break*/, 38];
|
|
24225
24218
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
@@ -24725,12 +24718,16 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
|
24725
24718
|
});
|
|
24726
24719
|
|
|
24727
24720
|
var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
24728
|
-
var _b;
|
|
24721
|
+
var _b, _c;
|
|
24729
24722
|
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
24730
24723
|
var ogpMetas = [];
|
|
24731
24724
|
var schemas = [];
|
|
24732
24725
|
var isCanonicalLinkAdd = false;
|
|
24733
24726
|
var canonicalHref = "";
|
|
24727
|
+
if (typeof window !== "undefined") {
|
|
24728
|
+
document.documentElement.lang =
|
|
24729
|
+
((_b = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _b === void 0 ? void 0 : _b.locale) || "tr";
|
|
24730
|
+
}
|
|
24734
24731
|
if (props.addOgpMetas) {
|
|
24735
24732
|
ogpMetas.push({
|
|
24736
24733
|
property: "og:type",
|
|
@@ -24767,7 +24764,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
|
24767
24764
|
if (productDetail.selectedVariant.mainImage) {
|
|
24768
24765
|
ogpMetas.push({
|
|
24769
24766
|
property: "og:image",
|
|
24770
|
-
content: (
|
|
24767
|
+
content: (_c = productDetail.selectedVariant.mainImage) === null || _c === void 0 ? void 0 : _c.src,
|
|
24771
24768
|
});
|
|
24772
24769
|
}
|
|
24773
24770
|
}
|
|
@@ -24975,6 +24972,64 @@ var pageStyle = {
|
|
|
24975
24972
|
justifyContent: "space-between",
|
|
24976
24973
|
};
|
|
24977
24974
|
|
|
24975
|
+
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
24976
|
+
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
24977
|
+
this.attributePropValue = prop;
|
|
24978
|
+
this.pageSpecificData = pageSpecificData;
|
|
24979
|
+
}
|
|
24980
|
+
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
24981
|
+
var _a;
|
|
24982
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24983
|
+
var productDetail, productSearchResponse, productList, product, variant;
|
|
24984
|
+
var _this = this;
|
|
24985
|
+
return __generator(this, function (_b) {
|
|
24986
|
+
switch (_b.label) {
|
|
24987
|
+
case 0:
|
|
24988
|
+
if (!this.attributePropValue.attributeId ||
|
|
24989
|
+
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
24990
|
+
(!this.attributePropValue.usePageData &&
|
|
24991
|
+
!this.attributePropValue.variantId)) {
|
|
24992
|
+
return [2 /*return*/, []];
|
|
24993
|
+
}
|
|
24994
|
+
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
24995
|
+
productDetail = this.pageSpecificData;
|
|
24996
|
+
return [3 /*break*/, 3];
|
|
24997
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24998
|
+
productIdList: [this.attributePropValue.productId],
|
|
24999
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
25000
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
25001
|
+
})];
|
|
25002
|
+
case 2:
|
|
25003
|
+
productSearchResponse = _b.sent();
|
|
25004
|
+
if (productSearchResponse) {
|
|
25005
|
+
productList = productSearchResponse.data;
|
|
25006
|
+
if (productList.length) {
|
|
25007
|
+
product = productList[0];
|
|
25008
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
25009
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
25010
|
+
if (variant) {
|
|
25011
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
25012
|
+
}
|
|
25013
|
+
}
|
|
25014
|
+
else {
|
|
25015
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
25016
|
+
}
|
|
25017
|
+
}
|
|
25018
|
+
}
|
|
25019
|
+
_b.label = 3;
|
|
25020
|
+
case 3:
|
|
25021
|
+
if (!productDetail)
|
|
25022
|
+
return [2 /*return*/, []];
|
|
25023
|
+
return [2 /*return*/, productDetail.product.hasVariant
|
|
25024
|
+
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
25025
|
+
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
25026
|
+
}
|
|
25027
|
+
});
|
|
25028
|
+
});
|
|
25029
|
+
};
|
|
25030
|
+
return IkasAttributePropValueProvider;
|
|
25031
|
+
}());
|
|
25032
|
+
|
|
24978
25033
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
24979
25034
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
24980
25035
|
this.pageType = null;
|
|
@@ -25377,76 +25432,80 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25377
25432
|
case exports.IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 7];
|
|
25378
25433
|
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
25379
25434
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
25380
|
-
case exports.IkasThemeComponentPropType.
|
|
25381
|
-
case exports.IkasThemeComponentPropType.
|
|
25382
|
-
case exports.IkasThemeComponentPropType.
|
|
25383
|
-
case exports.IkasThemeComponentPropType.
|
|
25384
|
-
case exports.IkasThemeComponentPropType.
|
|
25385
|
-
case exports.IkasThemeComponentPropType.
|
|
25386
|
-
case exports.IkasThemeComponentPropType.
|
|
25387
|
-
case exports.IkasThemeComponentPropType.
|
|
25388
|
-
case exports.IkasThemeComponentPropType.
|
|
25389
|
-
case exports.IkasThemeComponentPropType.
|
|
25435
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 10];
|
|
25436
|
+
case exports.IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 11];
|
|
25437
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
25438
|
+
case exports.IkasThemeComponentPropType.LINK: return [3 /*break*/, 13];
|
|
25439
|
+
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 13];
|
|
25440
|
+
case exports.IkasThemeComponentPropType.COLOR: return [3 /*break*/, 14];
|
|
25441
|
+
case exports.IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 15];
|
|
25442
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 16];
|
|
25443
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 16];
|
|
25444
|
+
case exports.IkasThemeComponentPropType.BLOG: return [3 /*break*/, 18];
|
|
25445
|
+
case exports.IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 19];
|
|
25390
25446
|
}
|
|
25391
|
-
return [3 /*break*/,
|
|
25447
|
+
return [3 /*break*/, 20];
|
|
25392
25448
|
case 1:
|
|
25393
25449
|
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
25394
|
-
return [3 /*break*/,
|
|
25450
|
+
return [3 /*break*/, 21];
|
|
25395
25451
|
case 2:
|
|
25396
25452
|
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
25397
|
-
return [3 /*break*/,
|
|
25453
|
+
return [3 /*break*/, 21];
|
|
25398
25454
|
case 3:
|
|
25399
25455
|
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
25400
|
-
return [3 /*break*/,
|
|
25456
|
+
return [3 /*break*/, 21];
|
|
25401
25457
|
case 4:
|
|
25402
25458
|
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
25403
|
-
return [3 /*break*/,
|
|
25459
|
+
return [3 /*break*/, 21];
|
|
25404
25460
|
case 5:
|
|
25405
25461
|
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
25406
|
-
return [3 /*break*/,
|
|
25462
|
+
return [3 /*break*/, 21];
|
|
25407
25463
|
case 6:
|
|
25408
25464
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
25409
|
-
return [3 /*break*/,
|
|
25465
|
+
return [3 /*break*/, 21];
|
|
25410
25466
|
case 7:
|
|
25411
25467
|
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
25412
|
-
return [3 /*break*/,
|
|
25468
|
+
return [3 /*break*/, 21];
|
|
25413
25469
|
case 8:
|
|
25414
25470
|
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25415
|
-
return [3 /*break*/,
|
|
25471
|
+
return [3 /*break*/, 21];
|
|
25416
25472
|
case 9:
|
|
25417
25473
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
25418
|
-
return [3 /*break*/,
|
|
25474
|
+
return [3 /*break*/, 21];
|
|
25419
25475
|
case 10:
|
|
25420
|
-
propValueProvider = new
|
|
25421
|
-
return [3 /*break*/,
|
|
25476
|
+
propValueProvider = new IkasAttributePropValueProvider(propValue, this.pageSpecificData);
|
|
25477
|
+
return [3 /*break*/, 21];
|
|
25422
25478
|
case 11:
|
|
25423
|
-
propValueProvider = new
|
|
25424
|
-
return [3 /*break*/,
|
|
25479
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
25480
|
+
return [3 /*break*/, 21];
|
|
25425
25481
|
case 12:
|
|
25426
|
-
propValueProvider = new
|
|
25427
|
-
return [3 /*break*/,
|
|
25482
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
25483
|
+
return [3 /*break*/, 21];
|
|
25428
25484
|
case 13:
|
|
25429
|
-
propValueProvider = new
|
|
25430
|
-
return [3 /*break*/,
|
|
25485
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
25486
|
+
return [3 /*break*/, 21];
|
|
25431
25487
|
case 14:
|
|
25488
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
25489
|
+
return [3 /*break*/, 21];
|
|
25490
|
+
case 15:
|
|
25432
25491
|
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
25433
25492
|
if (!customData)
|
|
25434
25493
|
return [2 /*return*/];
|
|
25435
25494
|
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
25436
|
-
return [3 /*break*/,
|
|
25437
|
-
case
|
|
25495
|
+
return [3 /*break*/, 21];
|
|
25496
|
+
case 16:
|
|
25438
25497
|
pageComponents = propValue;
|
|
25439
25498
|
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
25440
|
-
case
|
|
25441
|
-
case 17:
|
|
25442
|
-
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25443
|
-
return [3 /*break*/, 20];
|
|
25499
|
+
case 17: return [2 /*return*/, _b.sent()];
|
|
25444
25500
|
case 18:
|
|
25501
|
+
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25502
|
+
return [3 /*break*/, 21];
|
|
25503
|
+
case 19:
|
|
25445
25504
|
propValueProvider = new IkasBlogListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25446
|
-
return [3 /*break*/,
|
|
25447
|
-
case
|
|
25448
|
-
case
|
|
25449
|
-
case
|
|
25505
|
+
return [3 /*break*/, 21];
|
|
25506
|
+
case 20: return [3 /*break*/, 21];
|
|
25507
|
+
case 21: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
25508
|
+
case 22: return [2 /*return*/, _b.sent()];
|
|
25450
25509
|
}
|
|
25451
25510
|
});
|
|
25452
25511
|
});
|
|
@@ -25498,6 +25557,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25498
25557
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25499
25558
|
IkasPageDataProvider.initProductDetailPropValue(prop, propValue, pageComponentPropValue, router, isBrowser);
|
|
25500
25559
|
break;
|
|
25560
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25561
|
+
IkasPageDataProvider.initAttributePropValue(prop, propValue, pageComponentPropValue);
|
|
25562
|
+
break;
|
|
25501
25563
|
case exports.IkasThemeComponentPropType.LINK:
|
|
25502
25564
|
case exports.IkasThemeComponentPropType.LIST_OF_LINK:
|
|
25503
25565
|
IkasPageDataProvider.initLinkPropValue(prop, propValue, pageComponentPropValue);
|
|
@@ -25571,6 +25633,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25571
25633
|
}
|
|
25572
25634
|
return new IkasProductDetail(productDetail.product, productDetail.selectedVariantValues, router);
|
|
25573
25635
|
};
|
|
25636
|
+
IkasPageDataProvider.initAttributePropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25637
|
+
pageComponentPropValue.propValues[prop.name] = IkasPageDataProvider._initAttributePropValue(propValue);
|
|
25638
|
+
};
|
|
25639
|
+
IkasPageDataProvider._initAttributePropValue = function (propValue) {
|
|
25640
|
+
return propValue
|
|
25641
|
+
? propValue.map(function (p) { return new IkasProductAttributeValue(p); })
|
|
25642
|
+
: [];
|
|
25643
|
+
};
|
|
25574
25644
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25575
25645
|
pageComponentPropValue.propValues[prop.name] = this._initLinkPropValue(propValue);
|
|
25576
25646
|
};
|
|
@@ -25611,25 +25681,27 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25611
25681
|
if (propValue === null || propValue === undefined)
|
|
25612
25682
|
return null;
|
|
25613
25683
|
switch (customData.type) {
|
|
25614
|
-
case exports.
|
|
25684
|
+
case exports.IkasThemeComponentPropType.BRAND:
|
|
25615
25685
|
return this._initBrandPropValue(propValue);
|
|
25616
|
-
case exports.
|
|
25686
|
+
case exports.IkasThemeComponentPropType.BRAND_LIST:
|
|
25617
25687
|
return this._initBrandListPropValue(propValue);
|
|
25618
|
-
case exports.
|
|
25688
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST:
|
|
25619
25689
|
return this._initCategoryListPropValue(propValue);
|
|
25620
|
-
case exports.
|
|
25690
|
+
case exports.IkasThemeComponentPropType.CATEGORY:
|
|
25621
25691
|
return this._initCategoryPropValue(propValue);
|
|
25622
|
-
case exports.
|
|
25692
|
+
case exports.IkasThemeComponentPropType.IMAGE_LIST:
|
|
25623
25693
|
return this._initImageListPropValue(propValue);
|
|
25624
|
-
case exports.
|
|
25694
|
+
case exports.IkasThemeComponentPropType.IMAGE:
|
|
25625
25695
|
return this._initImagePropValue(propValue);
|
|
25626
|
-
case exports.
|
|
25696
|
+
case exports.IkasThemeComponentPropType.LINK:
|
|
25627
25697
|
return this._initLinkPropValue(propValue);
|
|
25628
|
-
case exports.
|
|
25698
|
+
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25629
25699
|
return this._initProductDetailPropValue(propValue, router, isBrowser);
|
|
25630
|
-
case exports.
|
|
25700
|
+
case exports.IkasThemeComponentPropType.PRODUCT_LIST:
|
|
25631
25701
|
return this._initProductListPropValue(propValue, router);
|
|
25632
|
-
case exports.
|
|
25702
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25703
|
+
return this._initAttributePropValue(propValue);
|
|
25704
|
+
case exports.IkasThemeComponentPropType.OBJECT:
|
|
25633
25705
|
var objectValue = {};
|
|
25634
25706
|
for (var _i = 0, _a = customData.nestedData || []; _i < _a.length; _i++) {
|
|
25635
25707
|
var nestedCustomData = _a[_i];
|
|
@@ -25637,8 +25709,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25637
25709
|
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, settings, isBrowser);
|
|
25638
25710
|
}
|
|
25639
25711
|
return objectValue;
|
|
25640
|
-
case exports.
|
|
25641
|
-
case exports.
|
|
25712
|
+
case exports.IkasThemeComponentPropType.DYNAMIC_LIST:
|
|
25713
|
+
case exports.IkasThemeComponentPropType.STATIC_LIST:
|
|
25642
25714
|
try {
|
|
25643
25715
|
if (!propValue || !propValue.length)
|
|
25644
25716
|
return null;
|
|
@@ -25652,9 +25724,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25652
25724
|
catch (err) {
|
|
25653
25725
|
return [];
|
|
25654
25726
|
}
|
|
25655
|
-
case exports.
|
|
25727
|
+
case exports.IkasThemeComponentPropType.COMPONENT:
|
|
25656
25728
|
return this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
25657
|
-
case exports.
|
|
25729
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST:
|
|
25658
25730
|
return this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
25659
25731
|
default:
|
|
25660
25732
|
return propValue;
|
|
@@ -27460,6 +27532,26 @@ var IkasMerchantAPI = /** @class */ (function () {
|
|
|
27460
27532
|
}());
|
|
27461
27533
|
var templateObject_1$a;
|
|
27462
27534
|
|
|
27535
|
+
var IkasProductAttributeTableCell = /** @class */ (function () {
|
|
27536
|
+
function IkasProductAttributeTableCell(data) {
|
|
27537
|
+
this.id = (data === null || data === void 0 ? void 0 : data.id) || "";
|
|
27538
|
+
this.name = (data === null || data === void 0 ? void 0 : data.name) || null;
|
|
27539
|
+
mobx.makeAutoObservable(this);
|
|
27540
|
+
}
|
|
27541
|
+
return IkasProductAttributeTableCell;
|
|
27542
|
+
}());
|
|
27543
|
+
|
|
27544
|
+
var IkasProductAttributeTableTemplate = /** @class */ (function () {
|
|
27545
|
+
function IkasProductAttributeTableTemplate(data) {
|
|
27546
|
+
this.columns = (data === null || data === void 0 ? void 0 : data.columns) ? data.columns.map(function (c) { return new IkasProductAttributeTableCell(c); })
|
|
27547
|
+
: [];
|
|
27548
|
+
this.rows = (data === null || data === void 0 ? void 0 : data.rows) ? data.rows.map(function (r) { return new IkasProductAttributeTableCell(r); })
|
|
27549
|
+
: [];
|
|
27550
|
+
mobx.makeAutoObservable(this);
|
|
27551
|
+
}
|
|
27552
|
+
return IkasProductAttributeTableTemplate;
|
|
27553
|
+
}());
|
|
27554
|
+
|
|
27463
27555
|
var IkasProductSearchAPI = /** @class */ (function () {
|
|
27464
27556
|
function IkasProductSearchAPI() {
|
|
27465
27557
|
}
|
|
@@ -27554,7 +27646,7 @@ function simpleToProduct(simple) {
|
|
|
27554
27646
|
return new IkasProduct({
|
|
27555
27647
|
id: simple.id,
|
|
27556
27648
|
attributes: (_a = simple.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27557
|
-
var _a, _b, _c, _d, _e;
|
|
27649
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27558
27650
|
return new IkasProductAttributeValue({
|
|
27559
27651
|
value: a.value,
|
|
27560
27652
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27563,6 +27655,8 @@ function simpleToProduct(simple) {
|
|
|
27563
27655
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27564
27656
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27565
27657
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27658
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27659
|
+
: null,
|
|
27566
27660
|
}),
|
|
27567
27661
|
productAttributeOption: a.productAttributeOption,
|
|
27568
27662
|
});
|
|
@@ -27594,7 +27688,6 @@ function simpleToProduct(simple) {
|
|
|
27594
27688
|
metaData: new IkasHTMLMetaData(simple.metaData || undefined),
|
|
27595
27689
|
name: simple.name,
|
|
27596
27690
|
shortDescription: simple.shortDescription || undefined,
|
|
27597
|
-
type: simple.type || undefined,
|
|
27598
27691
|
variantTypes: simple.productVariantTypes.map(function (pvt) {
|
|
27599
27692
|
return new IkasProductVariantType({
|
|
27600
27693
|
variantType: new IkasVariantType({
|
|
@@ -27621,7 +27714,7 @@ function simpleToProduct(simple) {
|
|
|
27621
27714
|
return new IkasProductVariant({
|
|
27622
27715
|
id: v.id,
|
|
27623
27716
|
attributes: (_a = v.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27624
|
-
var _a, _b, _c, _d, _e;
|
|
27717
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27625
27718
|
return new IkasProductAttributeValue({
|
|
27626
27719
|
value: a.value,
|
|
27627
27720
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27630,6 +27723,8 @@ function simpleToProduct(simple) {
|
|
|
27630
27723
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27631
27724
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27632
27725
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27726
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27727
|
+
: null,
|
|
27633
27728
|
}),
|
|
27634
27729
|
productAttributeOption: a.productAttributeOption,
|
|
27635
27730
|
});
|
|
@@ -30213,7 +30308,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
30213
30308
|
SettingsHelper.getSettings = function (locale) {
|
|
30214
30309
|
var _this = this;
|
|
30215
30310
|
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
30216
|
-
var isLocal, storefrontResponse, storefront, localTheme, settings, storefront_1, salesChannel_1, localizationMap,
|
|
30311
|
+
var isLocal, storefrontResponse, storefront, localTheme, settings, storefront_1, salesChannel_1, localizationMap, themeLocalizationPath, routing_1;
|
|
30217
30312
|
return __generator(this, function (_a) {
|
|
30218
30313
|
switch (_a.label) {
|
|
30219
30314
|
case 0:
|
|
@@ -30255,7 +30350,6 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
30255
30350
|
storefront_1 = new IkasStorefront(settings.storefront);
|
|
30256
30351
|
salesChannel_1 = new IkasSalesChannel(settings.salesChannel);
|
|
30257
30352
|
localizationMap = settings.localizationMap;
|
|
30258
|
-
favicon_1 = settings.favicon;
|
|
30259
30353
|
themeLocalizationPath = localizationMap[locale];
|
|
30260
30354
|
routing_1 = storefront_1.routings.find(function (r) { return r.id === locale || r.path === locale; });
|
|
30261
30355
|
if (!themeLocalizationPath || !routing_1) {
|
|
@@ -30271,12 +30365,14 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
30271
30365
|
return resolve(null);
|
|
30272
30366
|
}
|
|
30273
30367
|
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
30368
|
+
var themeLocalization = new IkasStorefrontThemeLocalization(result);
|
|
30369
|
+
var favicon = themeLocalization.themeJson.settings.favicon;
|
|
30274
30370
|
resolve({
|
|
30275
30371
|
storefront: storefront_1,
|
|
30276
|
-
themeLocalization:
|
|
30372
|
+
themeLocalization: themeLocalization,
|
|
30277
30373
|
salesChannel: salesChannel_1,
|
|
30278
30374
|
routing: routing_1,
|
|
30279
|
-
favicon:
|
|
30375
|
+
favicon: favicon,
|
|
30280
30376
|
});
|
|
30281
30377
|
});
|
|
30282
30378
|
_a.label = 5;
|
|
@@ -7,4 +7,10 @@ export declare class IkasProductAttributeValue {
|
|
|
7
7
|
productAttribute?: IkasProductAttribute | null;
|
|
8
8
|
productAttributeOption?: IkasProductAttributeOption | null;
|
|
9
9
|
constructor(data: Partial<IkasProductAttributeValue>);
|
|
10
|
+
get tableValue(): IkasAttributeTableCellValue[] | undefined;
|
|
10
11
|
}
|
|
12
|
+
export declare type IkasAttributeTableCellValue = {
|
|
13
|
+
colId: string;
|
|
14
|
+
rowId: string;
|
|
15
|
+
value: string | null;
|
|
16
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import IkasProductAttributeOption from "./product-attribute-option/index";
|
|
2
|
+
import { IkasProductAttributeTableTemplate } from "./product-attribute-table-template/index";
|
|
2
3
|
export declare class IkasProductAttribute {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
type: IkasProductAttributeType;
|
|
6
7
|
options?: IkasProductAttributeOption[] | null;
|
|
8
|
+
tableTemplate?: IkasProductAttributeTableTemplate | null;
|
|
7
9
|
constructor(data: Partial<IkasProductAttribute>);
|
|
8
10
|
}
|
|
9
11
|
export declare enum IkasProductAttributeType {
|
|
@@ -13,5 +15,6 @@ export declare enum IkasProductAttributeType {
|
|
|
13
15
|
BOOLEAN = "BOOLEAN",
|
|
14
16
|
NUMERIC = "NUMERIC",
|
|
15
17
|
DATETIME = "DATETIME",
|
|
16
|
-
HTML = "HTML"
|
|
18
|
+
HTML = "HTML",
|
|
19
|
+
TABLE = "TABLE"
|
|
17
20
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IkasProductAttributeTableCell } from "../product-attribute-table-cell/index";
|
|
2
|
+
export declare class IkasProductAttributeTableTemplate {
|
|
3
|
+
columns: IkasProductAttributeTableCell[] | null;
|
|
4
|
+
rows: IkasProductAttributeTableCell[] | null;
|
|
5
|
+
constructor(data?: Partial<IkasProductAttributeTableTemplate>);
|
|
6
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ProductAttributeTypeEnum,
|
|
1
|
+
import { ProductAttributeTypeEnum, VariantSelectionTypeEnum } from "../../../__generated__/global-types";
|
|
2
|
+
import { IkasProductAttributeTableTemplate } from "../product-attribute/product-attribute-table-template/index";
|
|
2
3
|
export interface ISimpleProduct {
|
|
3
4
|
id: string;
|
|
4
5
|
createdAt?: Date;
|
|
@@ -9,7 +10,6 @@ export interface ISimpleProduct {
|
|
|
9
10
|
description?: string | null;
|
|
10
11
|
taxValue?: number | null;
|
|
11
12
|
weight?: number | null;
|
|
12
|
-
type: ProductTypeEnum;
|
|
13
13
|
productVariantTypes: ISimpleProductVariantType[];
|
|
14
14
|
categories?: ISimpleCategory[] | null;
|
|
15
15
|
variants: ISimpleVariant[];
|
|
@@ -72,6 +72,7 @@ export interface ISimpleProductAttribute {
|
|
|
72
72
|
id: string;
|
|
73
73
|
name: string;
|
|
74
74
|
type: ProductAttributeTypeEnum;
|
|
75
|
+
tableTemplate: IkasProductAttributeTableTemplate | null;
|
|
75
76
|
}
|
|
76
77
|
export interface ISimpleProductAttributeValue {
|
|
77
78
|
value?: string | number | Date | boolean | null;
|