@ikas/storefront 0.0.135 → 0.0.136
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 +196 -106
- package/build/index.js +195 -104
- 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.es.js
CHANGED
|
@@ -17977,6 +17977,7 @@ var IkasProductAttribute = /** @class */ (function () {
|
|
|
17977
17977
|
this.name = data.name || "";
|
|
17978
17978
|
this.type = data.type || IkasProductAttributeType.TEXT;
|
|
17979
17979
|
this.options = data.options || null;
|
|
17980
|
+
this.tableTemplate = data.tableTemplate || null;
|
|
17980
17981
|
makeAutoObservable(this);
|
|
17981
17982
|
}
|
|
17982
17983
|
return IkasProductAttribute;
|
|
@@ -17990,6 +17991,7 @@ var IkasProductAttributeType;
|
|
|
17990
17991
|
IkasProductAttributeType["NUMERIC"] = "NUMERIC";
|
|
17991
17992
|
IkasProductAttributeType["DATETIME"] = "DATETIME";
|
|
17992
17993
|
IkasProductAttributeType["HTML"] = "HTML";
|
|
17994
|
+
IkasProductAttributeType["TABLE"] = "TABLE";
|
|
17993
17995
|
})(IkasProductAttributeType || (IkasProductAttributeType = {}));
|
|
17994
17996
|
|
|
17995
17997
|
var IkasProductAttributeValue = /** @class */ (function () {
|
|
@@ -18005,6 +18007,14 @@ var IkasProductAttributeValue = /** @class */ (function () {
|
|
|
18005
18007
|
: null;
|
|
18006
18008
|
makeAutoObservable(this);
|
|
18007
18009
|
}
|
|
18010
|
+
Object.defineProperty(IkasProductAttributeValue.prototype, "tableValue", {
|
|
18011
|
+
get: function () {
|
|
18012
|
+
if (this.value)
|
|
18013
|
+
return JSON.parse(this.value);
|
|
18014
|
+
},
|
|
18015
|
+
enumerable: false,
|
|
18016
|
+
configurable: true
|
|
18017
|
+
});
|
|
18008
18018
|
return IkasProductAttributeValue;
|
|
18009
18019
|
}());
|
|
18010
18020
|
|
|
@@ -18601,6 +18611,7 @@ var IkasThemeComponentPropType;
|
|
|
18601
18611
|
IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
18602
18612
|
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18603
18613
|
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18614
|
+
IkasThemeComponentPropType["PRODUCT_ATTRIBUTE"] = "PRODUCT_ATTRIBUTE";
|
|
18604
18615
|
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
18605
18616
|
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
18606
18617
|
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
@@ -18611,6 +18622,9 @@ var IkasThemeComponentPropType;
|
|
|
18611
18622
|
IkasThemeComponentPropType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
18612
18623
|
IkasThemeComponentPropType["BLOG"] = "BLOG";
|
|
18613
18624
|
IkasThemeComponentPropType["BLOG_LIST"] = "BLOG_LIST";
|
|
18625
|
+
IkasThemeComponentPropType["OBJECT"] = "OBJECT";
|
|
18626
|
+
IkasThemeComponentPropType["STATIC_LIST"] = "STATIC_LIST";
|
|
18627
|
+
IkasThemeComponentPropType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
18614
18628
|
})(IkasThemeComponentPropType || (IkasThemeComponentPropType = {}));
|
|
18615
18629
|
|
|
18616
18630
|
var IkasThemeComponent = /** @class */ (function () {
|
|
@@ -18634,7 +18648,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18634
18648
|
if (data === void 0) { data = {}; }
|
|
18635
18649
|
this.id = data.id || "";
|
|
18636
18650
|
this.name = data.name || null;
|
|
18637
|
-
this.type = data.type ||
|
|
18651
|
+
this.type = data.type || IkasThemeComponentPropType.TEXT;
|
|
18638
18652
|
this.isRequired = data.isRequired !== undefined ? data.isRequired : true;
|
|
18639
18653
|
this.key = data.key || null;
|
|
18640
18654
|
this.parent = data.parent || null;
|
|
@@ -18645,7 +18659,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18645
18659
|
return new IkasThemeCustomData(__assign(__assign({}, nd), { parent: _this }));
|
|
18646
18660
|
})
|
|
18647
18661
|
: null;
|
|
18648
|
-
if (this.type ===
|
|
18662
|
+
if (this.type === IkasThemeComponentPropType.STATIC_LIST && !this.itemCount)
|
|
18649
18663
|
this.itemCount = 1;
|
|
18650
18664
|
makeAutoObservable(this);
|
|
18651
18665
|
}
|
|
@@ -18655,32 +18669,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
18655
18669
|
return obj;
|
|
18656
18670
|
};
|
|
18657
18671
|
return IkasThemeCustomData;
|
|
18658
|
-
}());
|
|
18659
|
-
var IkasThemeCustomDataType;
|
|
18660
|
-
(function (IkasThemeCustomDataType) {
|
|
18661
|
-
IkasThemeCustomDataType["TEXT"] = "TEXT";
|
|
18662
|
-
IkasThemeCustomDataType["RICH_TEXT"] = "RICH_TEXT";
|
|
18663
|
-
IkasThemeCustomDataType["NUMBER"] = "NUMBER";
|
|
18664
|
-
IkasThemeCustomDataType["BOOLEAN"] = "BOOLEAN";
|
|
18665
|
-
IkasThemeCustomDataType["IMAGE"] = "IMAGE";
|
|
18666
|
-
IkasThemeCustomDataType["IMAGE_LIST"] = "IMAGE_LIST";
|
|
18667
|
-
IkasThemeCustomDataType["LINK"] = "LINK";
|
|
18668
|
-
IkasThemeCustomDataType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
18669
|
-
IkasThemeCustomDataType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
18670
|
-
IkasThemeCustomDataType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
18671
|
-
IkasThemeCustomDataType["BRAND"] = "BRAND";
|
|
18672
|
-
IkasThemeCustomDataType["BRAND_LIST"] = "BRAND_LIST";
|
|
18673
|
-
IkasThemeCustomDataType["CATEGORY"] = "CATEGORY";
|
|
18674
|
-
IkasThemeCustomDataType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
18675
|
-
IkasThemeCustomDataType["COLOR"] = "COLOR";
|
|
18676
|
-
IkasThemeCustomDataType["COMPONENT"] = "COMPONENT";
|
|
18677
|
-
IkasThemeCustomDataType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
18678
|
-
IkasThemeCustomDataType["BLOG"] = "BLOG";
|
|
18679
|
-
IkasThemeCustomDataType["BLOG_LIST"] = "BLOG_LIST";
|
|
18680
|
-
IkasThemeCustomDataType["OBJECT"] = "OBJECT";
|
|
18681
|
-
IkasThemeCustomDataType["STATIC_LIST"] = "STATIC_LIST";
|
|
18682
|
-
IkasThemeCustomDataType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
18683
|
-
})(IkasThemeCustomDataType || (IkasThemeCustomDataType = {}));
|
|
18672
|
+
}());
|
|
18684
18673
|
|
|
18685
18674
|
var IkasThemePageComponent = /** @class */ (function () {
|
|
18686
18675
|
function IkasThemePageComponent(data) {
|
|
@@ -21225,8 +21214,10 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21225
21214
|
}); };
|
|
21226
21215
|
this.searchDebouncer = debounce_1(function () {
|
|
21227
21216
|
_this.applyFilters();
|
|
21228
|
-
Analytics.search(_this._searchKeyword);
|
|
21229
21217
|
}, 100);
|
|
21218
|
+
this.analyticsDebouncer = debounce_1(function () {
|
|
21219
|
+
Analytics.search(_this._searchKeyword);
|
|
21220
|
+
}, 1000);
|
|
21230
21221
|
this.data = data.data
|
|
21231
21222
|
? data.data.map(function (d) { return new IkasProductDetail(d.product, d.selectedVariantValues); })
|
|
21232
21223
|
: [];
|
|
@@ -21303,6 +21294,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21303
21294
|
return;
|
|
21304
21295
|
this._searchKeyword = value;
|
|
21305
21296
|
this.searchDebouncer();
|
|
21297
|
+
this.analyticsDebouncer();
|
|
21306
21298
|
},
|
|
21307
21299
|
enumerable: false,
|
|
21308
21300
|
configurable: true
|
|
@@ -24220,27 +24212,27 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
24220
24212
|
_b.trys.push([1, 40, , 41]);
|
|
24221
24213
|
_a = this.customData.type;
|
|
24222
24214
|
switch (_a) {
|
|
24223
|
-
case
|
|
24224
|
-
case
|
|
24225
|
-
case
|
|
24226
|
-
case
|
|
24227
|
-
case
|
|
24228
|
-
case
|
|
24229
|
-
case
|
|
24230
|
-
case
|
|
24231
|
-
case
|
|
24232
|
-
case
|
|
24233
|
-
case
|
|
24234
|
-
case
|
|
24235
|
-
case
|
|
24236
|
-
case
|
|
24237
|
-
case
|
|
24238
|
-
case
|
|
24239
|
-
case
|
|
24240
|
-
case
|
|
24241
|
-
case
|
|
24242
|
-
case
|
|
24243
|
-
case
|
|
24215
|
+
case IkasThemeComponentPropType.TEXT: return [3 /*break*/, 2];
|
|
24216
|
+
case IkasThemeComponentPropType.RICH_TEXT: return [3 /*break*/, 4];
|
|
24217
|
+
case IkasThemeComponentPropType.BOOLEAN: return [3 /*break*/, 6];
|
|
24218
|
+
case IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 8];
|
|
24219
|
+
case IkasThemeComponentPropType.BRAND: return [3 /*break*/, 10];
|
|
24220
|
+
case IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
24221
|
+
case IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 14];
|
|
24222
|
+
case IkasThemeComponentPropType.COLOR: return [3 /*break*/, 16];
|
|
24223
|
+
case IkasThemeComponentPropType.IMAGE_LIST: return [3 /*break*/, 18];
|
|
24224
|
+
case IkasThemeComponentPropType.IMAGE: return [3 /*break*/, 20];
|
|
24225
|
+
case IkasThemeComponentPropType.LINK: return [3 /*break*/, 22];
|
|
24226
|
+
case IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
24227
|
+
case IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
24228
|
+
case IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
24229
|
+
case IkasThemeComponentPropType.OBJECT: return [3 /*break*/, 28];
|
|
24230
|
+
case IkasThemeComponentPropType.DYNAMIC_LIST: return [3 /*break*/, 30];
|
|
24231
|
+
case IkasThemeComponentPropType.STATIC_LIST: return [3 /*break*/, 30];
|
|
24232
|
+
case IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 32];
|
|
24233
|
+
case IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 32];
|
|
24234
|
+
case IkasThemeComponentPropType.BLOG: return [3 /*break*/, 34];
|
|
24235
|
+
case IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 36];
|
|
24244
24236
|
}
|
|
24245
24237
|
return [3 /*break*/, 38];
|
|
24246
24238
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
@@ -24996,6 +24988,64 @@ var pageStyle = {
|
|
|
24996
24988
|
justifyContent: "space-between",
|
|
24997
24989
|
};
|
|
24998
24990
|
|
|
24991
|
+
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
24992
|
+
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
24993
|
+
this.attributePropValue = prop;
|
|
24994
|
+
this.pageSpecificData = pageSpecificData;
|
|
24995
|
+
}
|
|
24996
|
+
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
24997
|
+
var _a;
|
|
24998
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24999
|
+
var productDetail, productSearchResponse, productList, product, variant;
|
|
25000
|
+
var _this = this;
|
|
25001
|
+
return __generator(this, function (_b) {
|
|
25002
|
+
switch (_b.label) {
|
|
25003
|
+
case 0:
|
|
25004
|
+
if (!this.attributePropValue.attributeId ||
|
|
25005
|
+
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
25006
|
+
(!this.attributePropValue.usePageData &&
|
|
25007
|
+
!this.attributePropValue.variantId)) {
|
|
25008
|
+
return [2 /*return*/, []];
|
|
25009
|
+
}
|
|
25010
|
+
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
25011
|
+
productDetail = this.pageSpecificData;
|
|
25012
|
+
return [3 /*break*/, 3];
|
|
25013
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
25014
|
+
productIdList: [this.attributePropValue.productId],
|
|
25015
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
25016
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
25017
|
+
})];
|
|
25018
|
+
case 2:
|
|
25019
|
+
productSearchResponse = _b.sent();
|
|
25020
|
+
if (productSearchResponse) {
|
|
25021
|
+
productList = productSearchResponse.data;
|
|
25022
|
+
if (productList.length) {
|
|
25023
|
+
product = productList[0];
|
|
25024
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
25025
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
25026
|
+
if (variant) {
|
|
25027
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
25028
|
+
}
|
|
25029
|
+
}
|
|
25030
|
+
else {
|
|
25031
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
25032
|
+
}
|
|
25033
|
+
}
|
|
25034
|
+
}
|
|
25035
|
+
_b.label = 3;
|
|
25036
|
+
case 3:
|
|
25037
|
+
if (!productDetail)
|
|
25038
|
+
return [2 /*return*/, []];
|
|
25039
|
+
return [2 /*return*/, productDetail.product.hasVariant
|
|
25040
|
+
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
25041
|
+
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
25042
|
+
}
|
|
25043
|
+
});
|
|
25044
|
+
});
|
|
25045
|
+
};
|
|
25046
|
+
return IkasAttributePropValueProvider;
|
|
25047
|
+
}());
|
|
25048
|
+
|
|
24999
25049
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
25000
25050
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
25001
25051
|
this.pageType = null;
|
|
@@ -25398,76 +25448,80 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25398
25448
|
case IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 7];
|
|
25399
25449
|
case IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
25400
25450
|
case IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
25401
|
-
case IkasThemeComponentPropType.
|
|
25402
|
-
case IkasThemeComponentPropType.
|
|
25403
|
-
case IkasThemeComponentPropType.
|
|
25404
|
-
case IkasThemeComponentPropType.
|
|
25405
|
-
case IkasThemeComponentPropType.
|
|
25406
|
-
case IkasThemeComponentPropType.
|
|
25407
|
-
case IkasThemeComponentPropType.
|
|
25408
|
-
case IkasThemeComponentPropType.
|
|
25409
|
-
case IkasThemeComponentPropType.
|
|
25410
|
-
case IkasThemeComponentPropType.
|
|
25451
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 10];
|
|
25452
|
+
case IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 11];
|
|
25453
|
+
case IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
25454
|
+
case IkasThemeComponentPropType.LINK: return [3 /*break*/, 13];
|
|
25455
|
+
case IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 13];
|
|
25456
|
+
case IkasThemeComponentPropType.COLOR: return [3 /*break*/, 14];
|
|
25457
|
+
case IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 15];
|
|
25458
|
+
case IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 16];
|
|
25459
|
+
case IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 16];
|
|
25460
|
+
case IkasThemeComponentPropType.BLOG: return [3 /*break*/, 18];
|
|
25461
|
+
case IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 19];
|
|
25411
25462
|
}
|
|
25412
|
-
return [3 /*break*/,
|
|
25463
|
+
return [3 /*break*/, 20];
|
|
25413
25464
|
case 1:
|
|
25414
25465
|
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
25415
|
-
return [3 /*break*/,
|
|
25466
|
+
return [3 /*break*/, 21];
|
|
25416
25467
|
case 2:
|
|
25417
25468
|
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
25418
|
-
return [3 /*break*/,
|
|
25469
|
+
return [3 /*break*/, 21];
|
|
25419
25470
|
case 3:
|
|
25420
25471
|
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
25421
|
-
return [3 /*break*/,
|
|
25472
|
+
return [3 /*break*/, 21];
|
|
25422
25473
|
case 4:
|
|
25423
25474
|
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
25424
|
-
return [3 /*break*/,
|
|
25475
|
+
return [3 /*break*/, 21];
|
|
25425
25476
|
case 5:
|
|
25426
25477
|
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
25427
|
-
return [3 /*break*/,
|
|
25478
|
+
return [3 /*break*/, 21];
|
|
25428
25479
|
case 6:
|
|
25429
25480
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
25430
|
-
return [3 /*break*/,
|
|
25481
|
+
return [3 /*break*/, 21];
|
|
25431
25482
|
case 7:
|
|
25432
25483
|
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
25433
|
-
return [3 /*break*/,
|
|
25484
|
+
return [3 /*break*/, 21];
|
|
25434
25485
|
case 8:
|
|
25435
25486
|
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25436
|
-
return [3 /*break*/,
|
|
25487
|
+
return [3 /*break*/, 21];
|
|
25437
25488
|
case 9:
|
|
25438
25489
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
25439
|
-
return [3 /*break*/,
|
|
25490
|
+
return [3 /*break*/, 21];
|
|
25440
25491
|
case 10:
|
|
25441
|
-
propValueProvider = new
|
|
25442
|
-
return [3 /*break*/,
|
|
25492
|
+
propValueProvider = new IkasAttributePropValueProvider(propValue, this.pageSpecificData);
|
|
25493
|
+
return [3 /*break*/, 21];
|
|
25443
25494
|
case 11:
|
|
25444
|
-
propValueProvider = new
|
|
25445
|
-
return [3 /*break*/,
|
|
25495
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
25496
|
+
return [3 /*break*/, 21];
|
|
25446
25497
|
case 12:
|
|
25447
|
-
propValueProvider = new
|
|
25448
|
-
return [3 /*break*/,
|
|
25498
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
25499
|
+
return [3 /*break*/, 21];
|
|
25449
25500
|
case 13:
|
|
25450
|
-
propValueProvider = new
|
|
25451
|
-
return [3 /*break*/,
|
|
25501
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
25502
|
+
return [3 /*break*/, 21];
|
|
25452
25503
|
case 14:
|
|
25504
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
25505
|
+
return [3 /*break*/, 21];
|
|
25506
|
+
case 15:
|
|
25453
25507
|
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
25454
25508
|
if (!customData)
|
|
25455
25509
|
return [2 /*return*/];
|
|
25456
25510
|
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
25457
|
-
return [3 /*break*/,
|
|
25458
|
-
case
|
|
25511
|
+
return [3 /*break*/, 21];
|
|
25512
|
+
case 16:
|
|
25459
25513
|
pageComponents = propValue;
|
|
25460
25514
|
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
25461
|
-
case
|
|
25462
|
-
case 17:
|
|
25463
|
-
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25464
|
-
return [3 /*break*/, 20];
|
|
25515
|
+
case 17: return [2 /*return*/, _b.sent()];
|
|
25465
25516
|
case 18:
|
|
25517
|
+
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25518
|
+
return [3 /*break*/, 21];
|
|
25519
|
+
case 19:
|
|
25466
25520
|
propValueProvider = new IkasBlogListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25467
|
-
return [3 /*break*/,
|
|
25468
|
-
case
|
|
25469
|
-
case
|
|
25470
|
-
case
|
|
25521
|
+
return [3 /*break*/, 21];
|
|
25522
|
+
case 20: return [3 /*break*/, 21];
|
|
25523
|
+
case 21: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
25524
|
+
case 22: return [2 /*return*/, _b.sent()];
|
|
25471
25525
|
}
|
|
25472
25526
|
});
|
|
25473
25527
|
});
|
|
@@ -25519,6 +25573,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25519
25573
|
case IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25520
25574
|
IkasPageDataProvider.initProductDetailPropValue(prop, propValue, pageComponentPropValue, router, isBrowser);
|
|
25521
25575
|
break;
|
|
25576
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25577
|
+
IkasPageDataProvider.initAttributePropValue(prop, propValue, pageComponentPropValue);
|
|
25578
|
+
break;
|
|
25522
25579
|
case IkasThemeComponentPropType.LINK:
|
|
25523
25580
|
case IkasThemeComponentPropType.LIST_OF_LINK:
|
|
25524
25581
|
IkasPageDataProvider.initLinkPropValue(prop, propValue, pageComponentPropValue);
|
|
@@ -25592,6 +25649,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25592
25649
|
}
|
|
25593
25650
|
return new IkasProductDetail(productDetail.product, productDetail.selectedVariantValues, router);
|
|
25594
25651
|
};
|
|
25652
|
+
IkasPageDataProvider.initAttributePropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25653
|
+
pageComponentPropValue.propValues[prop.name] = IkasPageDataProvider._initAttributePropValue(propValue);
|
|
25654
|
+
};
|
|
25655
|
+
IkasPageDataProvider._initAttributePropValue = function (propValue) {
|
|
25656
|
+
return propValue
|
|
25657
|
+
? propValue.map(function (p) { return new IkasProductAttributeValue(p); })
|
|
25658
|
+
: [];
|
|
25659
|
+
};
|
|
25595
25660
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25596
25661
|
pageComponentPropValue.propValues[prop.name] = this._initLinkPropValue(propValue);
|
|
25597
25662
|
};
|
|
@@ -25632,25 +25697,27 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25632
25697
|
if (propValue === null || propValue === undefined)
|
|
25633
25698
|
return null;
|
|
25634
25699
|
switch (customData.type) {
|
|
25635
|
-
case
|
|
25700
|
+
case IkasThemeComponentPropType.BRAND:
|
|
25636
25701
|
return this._initBrandPropValue(propValue);
|
|
25637
|
-
case
|
|
25702
|
+
case IkasThemeComponentPropType.BRAND_LIST:
|
|
25638
25703
|
return this._initBrandListPropValue(propValue);
|
|
25639
|
-
case
|
|
25704
|
+
case IkasThemeComponentPropType.CATEGORY_LIST:
|
|
25640
25705
|
return this._initCategoryListPropValue(propValue);
|
|
25641
|
-
case
|
|
25706
|
+
case IkasThemeComponentPropType.CATEGORY:
|
|
25642
25707
|
return this._initCategoryPropValue(propValue);
|
|
25643
|
-
case
|
|
25708
|
+
case IkasThemeComponentPropType.IMAGE_LIST:
|
|
25644
25709
|
return this._initImageListPropValue(propValue);
|
|
25645
|
-
case
|
|
25710
|
+
case IkasThemeComponentPropType.IMAGE:
|
|
25646
25711
|
return this._initImagePropValue(propValue);
|
|
25647
|
-
case
|
|
25712
|
+
case IkasThemeComponentPropType.LINK:
|
|
25648
25713
|
return this._initLinkPropValue(propValue);
|
|
25649
|
-
case
|
|
25714
|
+
case IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25650
25715
|
return this._initProductDetailPropValue(propValue, router, isBrowser);
|
|
25651
|
-
case
|
|
25716
|
+
case IkasThemeComponentPropType.PRODUCT_LIST:
|
|
25652
25717
|
return this._initProductListPropValue(propValue, router);
|
|
25653
|
-
case
|
|
25718
|
+
case IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25719
|
+
return this._initAttributePropValue(propValue);
|
|
25720
|
+
case IkasThemeComponentPropType.OBJECT:
|
|
25654
25721
|
var objectValue = {};
|
|
25655
25722
|
for (var _i = 0, _a = customData.nestedData || []; _i < _a.length; _i++) {
|
|
25656
25723
|
var nestedCustomData = _a[_i];
|
|
@@ -25658,8 +25725,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25658
25725
|
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, settings, isBrowser);
|
|
25659
25726
|
}
|
|
25660
25727
|
return objectValue;
|
|
25661
|
-
case
|
|
25662
|
-
case
|
|
25728
|
+
case IkasThemeComponentPropType.DYNAMIC_LIST:
|
|
25729
|
+
case IkasThemeComponentPropType.STATIC_LIST:
|
|
25663
25730
|
try {
|
|
25664
25731
|
if (!propValue || !propValue.length)
|
|
25665
25732
|
return null;
|
|
@@ -25673,9 +25740,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25673
25740
|
catch (err) {
|
|
25674
25741
|
return [];
|
|
25675
25742
|
}
|
|
25676
|
-
case
|
|
25743
|
+
case IkasThemeComponentPropType.COMPONENT:
|
|
25677
25744
|
return this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
25678
|
-
case
|
|
25745
|
+
case IkasThemeComponentPropType.COMPONENT_LIST:
|
|
25679
25746
|
return this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
25680
25747
|
default:
|
|
25681
25748
|
return propValue;
|
|
@@ -27482,6 +27549,26 @@ var IkasMerchantAPI = /** @class */ (function () {
|
|
|
27482
27549
|
}());
|
|
27483
27550
|
var templateObject_1$a;
|
|
27484
27551
|
|
|
27552
|
+
var IkasProductAttributeTableCell = /** @class */ (function () {
|
|
27553
|
+
function IkasProductAttributeTableCell(data) {
|
|
27554
|
+
this.id = (data === null || data === void 0 ? void 0 : data.id) || "";
|
|
27555
|
+
this.name = (data === null || data === void 0 ? void 0 : data.name) || null;
|
|
27556
|
+
makeAutoObservable(this);
|
|
27557
|
+
}
|
|
27558
|
+
return IkasProductAttributeTableCell;
|
|
27559
|
+
}());
|
|
27560
|
+
|
|
27561
|
+
var IkasProductAttributeTableTemplate = /** @class */ (function () {
|
|
27562
|
+
function IkasProductAttributeTableTemplate(data) {
|
|
27563
|
+
this.columns = (data === null || data === void 0 ? void 0 : data.columns) ? data.columns.map(function (c) { return new IkasProductAttributeTableCell(c); })
|
|
27564
|
+
: [];
|
|
27565
|
+
this.rows = (data === null || data === void 0 ? void 0 : data.rows) ? data.rows.map(function (r) { return new IkasProductAttributeTableCell(r); })
|
|
27566
|
+
: [];
|
|
27567
|
+
makeAutoObservable(this);
|
|
27568
|
+
}
|
|
27569
|
+
return IkasProductAttributeTableTemplate;
|
|
27570
|
+
}());
|
|
27571
|
+
|
|
27485
27572
|
var IkasProductSearchAPI = /** @class */ (function () {
|
|
27486
27573
|
function IkasProductSearchAPI() {
|
|
27487
27574
|
}
|
|
@@ -27576,7 +27663,7 @@ function simpleToProduct(simple) {
|
|
|
27576
27663
|
return new IkasProduct({
|
|
27577
27664
|
id: simple.id,
|
|
27578
27665
|
attributes: (_a = simple.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27579
|
-
var _a, _b, _c, _d, _e;
|
|
27666
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27580
27667
|
return new IkasProductAttributeValue({
|
|
27581
27668
|
value: a.value,
|
|
27582
27669
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27585,6 +27672,8 @@ function simpleToProduct(simple) {
|
|
|
27585
27672
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27586
27673
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27587
27674
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27675
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27676
|
+
: null,
|
|
27588
27677
|
}),
|
|
27589
27678
|
productAttributeOption: a.productAttributeOption,
|
|
27590
27679
|
});
|
|
@@ -27616,7 +27705,6 @@ function simpleToProduct(simple) {
|
|
|
27616
27705
|
metaData: new IkasHTMLMetaData(simple.metaData || undefined),
|
|
27617
27706
|
name: simple.name,
|
|
27618
27707
|
shortDescription: simple.shortDescription || undefined,
|
|
27619
|
-
type: simple.type || undefined,
|
|
27620
27708
|
variantTypes: simple.productVariantTypes.map(function (pvt) {
|
|
27621
27709
|
return new IkasProductVariantType({
|
|
27622
27710
|
variantType: new IkasVariantType({
|
|
@@ -27643,7 +27731,7 @@ function simpleToProduct(simple) {
|
|
|
27643
27731
|
return new IkasProductVariant({
|
|
27644
27732
|
id: v.id,
|
|
27645
27733
|
attributes: (_a = v.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27646
|
-
var _a, _b, _c, _d, _e;
|
|
27734
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27647
27735
|
return new IkasProductAttributeValue({
|
|
27648
27736
|
value: a.value,
|
|
27649
27737
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27652,6 +27740,8 @@ function simpleToProduct(simple) {
|
|
|
27652
27740
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27653
27741
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27654
27742
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27743
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27744
|
+
: null,
|
|
27655
27745
|
}),
|
|
27656
27746
|
productAttributeOption: a.productAttributeOption,
|
|
27657
27747
|
});
|
|
@@ -31176,4 +31266,4 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
31176
31266
|
return IkasBaseStore;
|
|
31177
31267
|
}());
|
|
31178
31268
|
|
|
31179
|
-
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$5 as BlogPage, _slug_$2 as BlogSlugPage, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData,
|
|
31269
|
+
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$5 as BlogPage, _slug_$2 as BlogSlugPage, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, getPlaceholderBlog, getPlaceholderBrand, getPlaceholderCategory, getPlaceholderProduct, parseRangeStr, pascalCase, stringToSlug, validatePhoneNumber };
|
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()];
|
|
@@ -24975,6 +24968,64 @@ var pageStyle = {
|
|
|
24975
24968
|
justifyContent: "space-between",
|
|
24976
24969
|
};
|
|
24977
24970
|
|
|
24971
|
+
var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
24972
|
+
function IkasAttributePropValueProvider(prop, pageSpecificData) {
|
|
24973
|
+
this.attributePropValue = prop;
|
|
24974
|
+
this.pageSpecificData = pageSpecificData;
|
|
24975
|
+
}
|
|
24976
|
+
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
24977
|
+
var _a;
|
|
24978
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24979
|
+
var productDetail, productSearchResponse, productList, product, variant;
|
|
24980
|
+
var _this = this;
|
|
24981
|
+
return __generator(this, function (_b) {
|
|
24982
|
+
switch (_b.label) {
|
|
24983
|
+
case 0:
|
|
24984
|
+
if (!this.attributePropValue.attributeId ||
|
|
24985
|
+
(this.attributePropValue.usePageData && !this.pageSpecificData) ||
|
|
24986
|
+
(!this.attributePropValue.usePageData &&
|
|
24987
|
+
!this.attributePropValue.variantId)) {
|
|
24988
|
+
return [2 /*return*/, []];
|
|
24989
|
+
}
|
|
24990
|
+
if (!((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData)) return [3 /*break*/, 1];
|
|
24991
|
+
productDetail = this.pageSpecificData;
|
|
24992
|
+
return [3 /*break*/, 3];
|
|
24993
|
+
case 1: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
24994
|
+
productIdList: [this.attributePropValue.productId],
|
|
24995
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
24996
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
24997
|
+
})];
|
|
24998
|
+
case 2:
|
|
24999
|
+
productSearchResponse = _b.sent();
|
|
25000
|
+
if (productSearchResponse) {
|
|
25001
|
+
productList = productSearchResponse.data;
|
|
25002
|
+
if (productList.length) {
|
|
25003
|
+
product = productList[0];
|
|
25004
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
25005
|
+
variant = product.variants.find(function (v) { return v.id === _this.attributePropValue.variantId; });
|
|
25006
|
+
if (variant) {
|
|
25007
|
+
productDetail = new IkasProductDetail(product, variant.variantValues);
|
|
25008
|
+
}
|
|
25009
|
+
}
|
|
25010
|
+
else {
|
|
25011
|
+
productDetail = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
25012
|
+
}
|
|
25013
|
+
}
|
|
25014
|
+
}
|
|
25015
|
+
_b.label = 3;
|
|
25016
|
+
case 3:
|
|
25017
|
+
if (!productDetail)
|
|
25018
|
+
return [2 /*return*/, []];
|
|
25019
|
+
return [2 /*return*/, productDetail.product.hasVariant
|
|
25020
|
+
? productDetail.selectedVariant.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })
|
|
25021
|
+
: productDetail.product.attributes.filter(function (a) { return a.productAttributeId === _this.attributePropValue.attributeId; })];
|
|
25022
|
+
}
|
|
25023
|
+
});
|
|
25024
|
+
});
|
|
25025
|
+
};
|
|
25026
|
+
return IkasAttributePropValueProvider;
|
|
25027
|
+
}());
|
|
25028
|
+
|
|
24978
25029
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
24979
25030
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
24980
25031
|
this.pageType = null;
|
|
@@ -25377,76 +25428,80 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25377
25428
|
case exports.IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 7];
|
|
25378
25429
|
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
25379
25430
|
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.
|
|
25431
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE: return [3 /*break*/, 10];
|
|
25432
|
+
case exports.IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 11];
|
|
25433
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
25434
|
+
case exports.IkasThemeComponentPropType.LINK: return [3 /*break*/, 13];
|
|
25435
|
+
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 13];
|
|
25436
|
+
case exports.IkasThemeComponentPropType.COLOR: return [3 /*break*/, 14];
|
|
25437
|
+
case exports.IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 15];
|
|
25438
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 16];
|
|
25439
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 16];
|
|
25440
|
+
case exports.IkasThemeComponentPropType.BLOG: return [3 /*break*/, 18];
|
|
25441
|
+
case exports.IkasThemeComponentPropType.BLOG_LIST: return [3 /*break*/, 19];
|
|
25390
25442
|
}
|
|
25391
|
-
return [3 /*break*/,
|
|
25443
|
+
return [3 /*break*/, 20];
|
|
25392
25444
|
case 1:
|
|
25393
25445
|
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
25394
|
-
return [3 /*break*/,
|
|
25446
|
+
return [3 /*break*/, 21];
|
|
25395
25447
|
case 2:
|
|
25396
25448
|
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
25397
|
-
return [3 /*break*/,
|
|
25449
|
+
return [3 /*break*/, 21];
|
|
25398
25450
|
case 3:
|
|
25399
25451
|
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
25400
|
-
return [3 /*break*/,
|
|
25452
|
+
return [3 /*break*/, 21];
|
|
25401
25453
|
case 4:
|
|
25402
25454
|
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
25403
|
-
return [3 /*break*/,
|
|
25455
|
+
return [3 /*break*/, 21];
|
|
25404
25456
|
case 5:
|
|
25405
25457
|
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
25406
|
-
return [3 /*break*/,
|
|
25458
|
+
return [3 /*break*/, 21];
|
|
25407
25459
|
case 6:
|
|
25408
25460
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
25409
|
-
return [3 /*break*/,
|
|
25461
|
+
return [3 /*break*/, 21];
|
|
25410
25462
|
case 7:
|
|
25411
25463
|
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
25412
|
-
return [3 /*break*/,
|
|
25464
|
+
return [3 /*break*/, 21];
|
|
25413
25465
|
case 8:
|
|
25414
25466
|
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25415
|
-
return [3 /*break*/,
|
|
25467
|
+
return [3 /*break*/, 21];
|
|
25416
25468
|
case 9:
|
|
25417
25469
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
25418
|
-
return [3 /*break*/,
|
|
25470
|
+
return [3 /*break*/, 21];
|
|
25419
25471
|
case 10:
|
|
25420
|
-
propValueProvider = new
|
|
25421
|
-
return [3 /*break*/,
|
|
25472
|
+
propValueProvider = new IkasAttributePropValueProvider(propValue, this.pageSpecificData);
|
|
25473
|
+
return [3 /*break*/, 21];
|
|
25422
25474
|
case 11:
|
|
25423
|
-
propValueProvider = new
|
|
25424
|
-
return [3 /*break*/,
|
|
25475
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
25476
|
+
return [3 /*break*/, 21];
|
|
25425
25477
|
case 12:
|
|
25426
|
-
propValueProvider = new
|
|
25427
|
-
return [3 /*break*/,
|
|
25478
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
25479
|
+
return [3 /*break*/, 21];
|
|
25428
25480
|
case 13:
|
|
25429
|
-
propValueProvider = new
|
|
25430
|
-
return [3 /*break*/,
|
|
25481
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
25482
|
+
return [3 /*break*/, 21];
|
|
25431
25483
|
case 14:
|
|
25484
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
25485
|
+
return [3 /*break*/, 21];
|
|
25486
|
+
case 15:
|
|
25432
25487
|
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
25433
25488
|
if (!customData)
|
|
25434
25489
|
return [2 /*return*/];
|
|
25435
25490
|
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
25436
|
-
return [3 /*break*/,
|
|
25437
|
-
case
|
|
25491
|
+
return [3 /*break*/, 21];
|
|
25492
|
+
case 16:
|
|
25438
25493
|
pageComponents = propValue;
|
|
25439
25494
|
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];
|
|
25495
|
+
case 17: return [2 /*return*/, _b.sent()];
|
|
25444
25496
|
case 18:
|
|
25497
|
+
propValueProvider = new IkasBlogPropValueProvider(propValue, this.pageSpecificData);
|
|
25498
|
+
return [3 /*break*/, 21];
|
|
25499
|
+
case 19:
|
|
25445
25500
|
propValueProvider = new IkasBlogListPropValueProvider(this.pageType, propValue, this.pageSpecificData);
|
|
25446
|
-
return [3 /*break*/,
|
|
25447
|
-
case
|
|
25448
|
-
case
|
|
25449
|
-
case
|
|
25501
|
+
return [3 /*break*/, 21];
|
|
25502
|
+
case 20: return [3 /*break*/, 21];
|
|
25503
|
+
case 21: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
25504
|
+
case 22: return [2 /*return*/, _b.sent()];
|
|
25450
25505
|
}
|
|
25451
25506
|
});
|
|
25452
25507
|
});
|
|
@@ -25498,6 +25553,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25498
25553
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25499
25554
|
IkasPageDataProvider.initProductDetailPropValue(prop, propValue, pageComponentPropValue, router, isBrowser);
|
|
25500
25555
|
break;
|
|
25556
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25557
|
+
IkasPageDataProvider.initAttributePropValue(prop, propValue, pageComponentPropValue);
|
|
25558
|
+
break;
|
|
25501
25559
|
case exports.IkasThemeComponentPropType.LINK:
|
|
25502
25560
|
case exports.IkasThemeComponentPropType.LIST_OF_LINK:
|
|
25503
25561
|
IkasPageDataProvider.initLinkPropValue(prop, propValue, pageComponentPropValue);
|
|
@@ -25571,6 +25629,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25571
25629
|
}
|
|
25572
25630
|
return new IkasProductDetail(productDetail.product, productDetail.selectedVariantValues, router);
|
|
25573
25631
|
};
|
|
25632
|
+
IkasPageDataProvider.initAttributePropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25633
|
+
pageComponentPropValue.propValues[prop.name] = IkasPageDataProvider._initAttributePropValue(propValue);
|
|
25634
|
+
};
|
|
25635
|
+
IkasPageDataProvider._initAttributePropValue = function (propValue) {
|
|
25636
|
+
return propValue
|
|
25637
|
+
? propValue.map(function (p) { return new IkasProductAttributeValue(p); })
|
|
25638
|
+
: [];
|
|
25639
|
+
};
|
|
25574
25640
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
25575
25641
|
pageComponentPropValue.propValues[prop.name] = this._initLinkPropValue(propValue);
|
|
25576
25642
|
};
|
|
@@ -25611,25 +25677,27 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25611
25677
|
if (propValue === null || propValue === undefined)
|
|
25612
25678
|
return null;
|
|
25613
25679
|
switch (customData.type) {
|
|
25614
|
-
case exports.
|
|
25680
|
+
case exports.IkasThemeComponentPropType.BRAND:
|
|
25615
25681
|
return this._initBrandPropValue(propValue);
|
|
25616
|
-
case exports.
|
|
25682
|
+
case exports.IkasThemeComponentPropType.BRAND_LIST:
|
|
25617
25683
|
return this._initBrandListPropValue(propValue);
|
|
25618
|
-
case exports.
|
|
25684
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST:
|
|
25619
25685
|
return this._initCategoryListPropValue(propValue);
|
|
25620
|
-
case exports.
|
|
25686
|
+
case exports.IkasThemeComponentPropType.CATEGORY:
|
|
25621
25687
|
return this._initCategoryPropValue(propValue);
|
|
25622
|
-
case exports.
|
|
25688
|
+
case exports.IkasThemeComponentPropType.IMAGE_LIST:
|
|
25623
25689
|
return this._initImageListPropValue(propValue);
|
|
25624
|
-
case exports.
|
|
25690
|
+
case exports.IkasThemeComponentPropType.IMAGE:
|
|
25625
25691
|
return this._initImagePropValue(propValue);
|
|
25626
|
-
case exports.
|
|
25692
|
+
case exports.IkasThemeComponentPropType.LINK:
|
|
25627
25693
|
return this._initLinkPropValue(propValue);
|
|
25628
|
-
case exports.
|
|
25694
|
+
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
25629
25695
|
return this._initProductDetailPropValue(propValue, router, isBrowser);
|
|
25630
|
-
case exports.
|
|
25696
|
+
case exports.IkasThemeComponentPropType.PRODUCT_LIST:
|
|
25631
25697
|
return this._initProductListPropValue(propValue, router);
|
|
25632
|
-
case exports.
|
|
25698
|
+
case exports.IkasThemeComponentPropType.PRODUCT_ATTRIBUTE:
|
|
25699
|
+
return this._initAttributePropValue(propValue);
|
|
25700
|
+
case exports.IkasThemeComponentPropType.OBJECT:
|
|
25633
25701
|
var objectValue = {};
|
|
25634
25702
|
for (var _i = 0, _a = customData.nestedData || []; _i < _a.length; _i++) {
|
|
25635
25703
|
var nestedCustomData = _a[_i];
|
|
@@ -25637,8 +25705,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25637
25705
|
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, settings, isBrowser);
|
|
25638
25706
|
}
|
|
25639
25707
|
return objectValue;
|
|
25640
|
-
case exports.
|
|
25641
|
-
case exports.
|
|
25708
|
+
case exports.IkasThemeComponentPropType.DYNAMIC_LIST:
|
|
25709
|
+
case exports.IkasThemeComponentPropType.STATIC_LIST:
|
|
25642
25710
|
try {
|
|
25643
25711
|
if (!propValue || !propValue.length)
|
|
25644
25712
|
return null;
|
|
@@ -25652,9 +25720,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
25652
25720
|
catch (err) {
|
|
25653
25721
|
return [];
|
|
25654
25722
|
}
|
|
25655
|
-
case exports.
|
|
25723
|
+
case exports.IkasThemeComponentPropType.COMPONENT:
|
|
25656
25724
|
return this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
25657
|
-
case exports.
|
|
25725
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST:
|
|
25658
25726
|
return this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
25659
25727
|
default:
|
|
25660
25728
|
return propValue;
|
|
@@ -27460,6 +27528,26 @@ var IkasMerchantAPI = /** @class */ (function () {
|
|
|
27460
27528
|
}());
|
|
27461
27529
|
var templateObject_1$a;
|
|
27462
27530
|
|
|
27531
|
+
var IkasProductAttributeTableCell = /** @class */ (function () {
|
|
27532
|
+
function IkasProductAttributeTableCell(data) {
|
|
27533
|
+
this.id = (data === null || data === void 0 ? void 0 : data.id) || "";
|
|
27534
|
+
this.name = (data === null || data === void 0 ? void 0 : data.name) || null;
|
|
27535
|
+
mobx.makeAutoObservable(this);
|
|
27536
|
+
}
|
|
27537
|
+
return IkasProductAttributeTableCell;
|
|
27538
|
+
}());
|
|
27539
|
+
|
|
27540
|
+
var IkasProductAttributeTableTemplate = /** @class */ (function () {
|
|
27541
|
+
function IkasProductAttributeTableTemplate(data) {
|
|
27542
|
+
this.columns = (data === null || data === void 0 ? void 0 : data.columns) ? data.columns.map(function (c) { return new IkasProductAttributeTableCell(c); })
|
|
27543
|
+
: [];
|
|
27544
|
+
this.rows = (data === null || data === void 0 ? void 0 : data.rows) ? data.rows.map(function (r) { return new IkasProductAttributeTableCell(r); })
|
|
27545
|
+
: [];
|
|
27546
|
+
mobx.makeAutoObservable(this);
|
|
27547
|
+
}
|
|
27548
|
+
return IkasProductAttributeTableTemplate;
|
|
27549
|
+
}());
|
|
27550
|
+
|
|
27463
27551
|
var IkasProductSearchAPI = /** @class */ (function () {
|
|
27464
27552
|
function IkasProductSearchAPI() {
|
|
27465
27553
|
}
|
|
@@ -27554,7 +27642,7 @@ function simpleToProduct(simple) {
|
|
|
27554
27642
|
return new IkasProduct({
|
|
27555
27643
|
id: simple.id,
|
|
27556
27644
|
attributes: (_a = simple.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27557
|
-
var _a, _b, _c, _d, _e;
|
|
27645
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27558
27646
|
return new IkasProductAttributeValue({
|
|
27559
27647
|
value: a.value,
|
|
27560
27648
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27563,6 +27651,8 @@ function simpleToProduct(simple) {
|
|
|
27563
27651
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27564
27652
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27565
27653
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27654
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27655
|
+
: null,
|
|
27566
27656
|
}),
|
|
27567
27657
|
productAttributeOption: a.productAttributeOption,
|
|
27568
27658
|
});
|
|
@@ -27594,7 +27684,6 @@ function simpleToProduct(simple) {
|
|
|
27594
27684
|
metaData: new IkasHTMLMetaData(simple.metaData || undefined),
|
|
27595
27685
|
name: simple.name,
|
|
27596
27686
|
shortDescription: simple.shortDescription || undefined,
|
|
27597
|
-
type: simple.type || undefined,
|
|
27598
27687
|
variantTypes: simple.productVariantTypes.map(function (pvt) {
|
|
27599
27688
|
return new IkasProductVariantType({
|
|
27600
27689
|
variantType: new IkasVariantType({
|
|
@@ -27621,7 +27710,7 @@ function simpleToProduct(simple) {
|
|
|
27621
27710
|
return new IkasProductVariant({
|
|
27622
27711
|
id: v.id,
|
|
27623
27712
|
attributes: (_a = v.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
27624
|
-
var _a, _b, _c, _d, _e;
|
|
27713
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27625
27714
|
return new IkasProductAttributeValue({
|
|
27626
27715
|
value: a.value,
|
|
27627
27716
|
productAttributeId: (_a = a.productAttribute) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -27630,6 +27719,8 @@ function simpleToProduct(simple) {
|
|
|
27630
27719
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
27631
27720
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
27632
27721
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
27722
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate) ? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
27723
|
+
: null,
|
|
27633
27724
|
}),
|
|
27634
27725
|
productAttributeOption: a.productAttributeOption,
|
|
27635
27726
|
});
|
|
@@ -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;
|
|
@@ -17,6 +17,7 @@ export declare enum IkasThemeComponentPropType {
|
|
|
17
17
|
LIST_OF_LINK = "LIST_OF_LINK",
|
|
18
18
|
PRODUCT_DETAIL = "PRODUCT_DETAIL",
|
|
19
19
|
PRODUCT_LIST = "PRODUCT_LIST",
|
|
20
|
+
PRODUCT_ATTRIBUTE = "PRODUCT_ATTRIBUTE",
|
|
20
21
|
BRAND = "BRAND",
|
|
21
22
|
BRAND_LIST = "BRAND_LIST",
|
|
22
23
|
CATEGORY = "CATEGORY",
|
|
@@ -26,5 +27,8 @@ export declare enum IkasThemeComponentPropType {
|
|
|
26
27
|
COMPONENT = "COMPONENT",
|
|
27
28
|
COMPONENT_LIST = "COMPONENT_LIST",
|
|
28
29
|
BLOG = "BLOG",
|
|
29
|
-
BLOG_LIST = "BLOG_LIST"
|
|
30
|
+
BLOG_LIST = "BLOG_LIST",
|
|
31
|
+
OBJECT = "OBJECT",
|
|
32
|
+
STATIC_LIST = "STATIC_LIST",
|
|
33
|
+
DYNAMIC_LIST = "DYNAMIC_LIST"
|
|
30
34
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IkasThemeComponentPropType } from "../component/prop/index";
|
|
1
2
|
export declare class IkasThemeCustomData {
|
|
2
3
|
id: string;
|
|
3
4
|
name?: string | null;
|
|
4
|
-
type:
|
|
5
|
+
type: IkasThemeComponentPropType;
|
|
5
6
|
isRequired: boolean;
|
|
6
7
|
key?: string | null;
|
|
7
8
|
nestedData?: IkasThemeCustomData[] | null;
|
|
@@ -11,27 +12,3 @@ export declare class IkasThemeCustomData {
|
|
|
11
12
|
constructor(data?: Partial<IkasThemeCustomData>);
|
|
12
13
|
toJSON(): this;
|
|
13
14
|
}
|
|
14
|
-
export declare enum IkasThemeCustomDataType {
|
|
15
|
-
TEXT = "TEXT",
|
|
16
|
-
RICH_TEXT = "RICH_TEXT",
|
|
17
|
-
NUMBER = "NUMBER",
|
|
18
|
-
BOOLEAN = "BOOLEAN",
|
|
19
|
-
IMAGE = "IMAGE",
|
|
20
|
-
IMAGE_LIST = "IMAGE_LIST",
|
|
21
|
-
LINK = "LINK",
|
|
22
|
-
LIST_OF_LINK = "LIST_OF_LINK",
|
|
23
|
-
PRODUCT_DETAIL = "PRODUCT_DETAIL",
|
|
24
|
-
PRODUCT_LIST = "PRODUCT_LIST",
|
|
25
|
-
BRAND = "BRAND",
|
|
26
|
-
BRAND_LIST = "BRAND_LIST",
|
|
27
|
-
CATEGORY = "CATEGORY",
|
|
28
|
-
CATEGORY_LIST = "CATEGORY_LIST",
|
|
29
|
-
COLOR = "COLOR",
|
|
30
|
-
COMPONENT = "COMPONENT",
|
|
31
|
-
COMPONENT_LIST = "COMPONENT_LIST",
|
|
32
|
-
BLOG = "BLOG",
|
|
33
|
-
BLOG_LIST = "BLOG_LIST",
|
|
34
|
-
OBJECT = "OBJECT",
|
|
35
|
-
STATIC_LIST = "STATIC_LIST",
|
|
36
|
-
DYNAMIC_LIST = "DYNAMIC_LIST"
|
|
37
|
-
}
|
|
@@ -11,6 +11,6 @@ export { IkasProductDetailPropValue } from "./page/component/prop-value/product-
|
|
|
11
11
|
export { IkasCategoryPropValue } from "./page/component/prop-value/category";
|
|
12
12
|
export { IkasCategoryListPropValue } from "./page/component/prop-value/category-list";
|
|
13
13
|
export { IkasThemeSettings } from "./settings/index";
|
|
14
|
-
export { IkasThemeCustomData
|
|
14
|
+
export { IkasThemeCustomData } from "./custom-data/index";
|
|
15
15
|
export { IkasBlogPropValue } from "./page/component/prop-value/blog";
|
|
16
16
|
export { IkasBlogListPropValue } from "./page/component/prop-value/blog-list";
|
|
@@ -1,5 +1,5 @@
|
|
|
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 } 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 } 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";
|
|
@@ -62,6 +62,8 @@ export declare class IkasPageDataProvider {
|
|
|
62
62
|
static _initProductListPropValue(propValue: IkasProductListParams, router: NextRouter): IkasProductList;
|
|
63
63
|
static initProductDetailPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue, router: NextRouter, isBrowser?: boolean): void;
|
|
64
64
|
static _initProductDetailPropValue(propValue: any, router: NextRouter, isBrowser?: boolean): IkasProductDetail;
|
|
65
|
+
static initAttributePropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
66
|
+
static _initAttributePropValue(propValue: IkasProductAttributeValue[]): IkasProductAttributeValue[];
|
|
65
67
|
static initLinkPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
66
68
|
static _initLinkPropValue(propValue: any): IkasNavigationLink | IkasNavigationLink[] | undefined;
|
|
67
69
|
static initImagePropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IkasProductAttributeValue } from "../../../models/index";
|
|
2
|
+
import IkasPropValueProvider from "./index";
|
|
3
|
+
import { IkasAttributePropValue } from "../../../models/theme/page/component/prop-value/attribute";
|
|
4
|
+
export declare class IkasAttributePropValueProvider implements IkasPropValueProvider<IkasProductAttributeValue[]> {
|
|
5
|
+
private attributePropValue;
|
|
6
|
+
private pageSpecificData?;
|
|
7
|
+
constructor(prop: IkasAttributePropValue, pageSpecificData?: any);
|
|
8
|
+
getValue(): Promise<IkasProductAttributeValue[]>;
|
|
9
|
+
}
|