@ikas/storefront 0.0.7 → 0.0.12
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/__generated__/global-types.d.ts +8 -0
- package/build/api/apollo.d.ts +2 -2
- package/build/api/category/__generated__/listCategory.d.ts +1 -1
- package/build/api/checkout/index.d.ts +4 -4
- package/build/api/customer/index.d.ts +6 -6
- package/build/api/product/__generated__/listProduct.d.ts +4 -5
- package/build/api/product-stock-location/index.d.ts +1 -1
- package/build/api/stock-location/index.d.ts +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +19 -19
- package/build/components/checkout/model.d.ts +4 -4
- package/build/components/gtm/functions.d.ts +12 -12
- package/build/components/hoc/ThemeComponent.d.ts +2 -1
- package/build/components/page-editor/model.d.ts +4 -4
- package/build/index.es.js +539 -82
- package/build/index.js +538 -80
- package/build/models/data/order/line-item/variant/index.d.ts +1 -1
- package/build/models/data/product/attribute-value/index.d.ts +1 -1
- package/build/models/data/product/index.d.ts +1 -1
- package/build/models/data/product/variant/index.d.ts +1 -1
- package/build/models/data/variant-type/variant-value/index.d.ts +1 -1
- package/build/models/theme/component/prop/index.d.ts +4 -1
- package/build/models/theme/index.d.ts +2 -0
- package/build/models/theme/page/component/prop-value/category-list.d.ts +9 -0
- package/build/models/theme/page/component/prop-value/category.d.ts +5 -0
- package/build/models/theme/theme.d.ts +2 -2
- package/build/models/ui/brand-list/index.d.ts +1 -1
- package/build/models/ui/category-list/index.d.ts +58 -0
- package/build/models/ui/index.d.ts +1 -0
- package/build/models/ui/product-detail/index.d.ts +1 -1
- package/build/models/ui/product-list/index.d.ts +3 -3
- package/build/store/cart.d.ts +2 -2
- package/build/store/customer.d.ts +2 -2
- package/build/utils/providers/page-data.d.ts +3 -2
- package/build/utils/providers/prop-value/boolean.d.ts +6 -0
- package/build/utils/providers/prop-value/category-list.d.ts +7 -0
- package/build/utils/providers/prop-value/category.d.ts +8 -0
- package/build/utils/providers/prop-value/image-list.d.ts +7 -0
- package/build/utils/providers/prop-value/image.d.ts +7 -0
- package/build/utils/providers/prop-value/link.d.ts +1 -1
- package/build/utils/providers/prop-value/text.d.ts +6 -0
- package/package.json +1 -1
- package/build/models/theme/component/prop/value/index.d.ts +0 -14
package/build/index.es.js
CHANGED
|
@@ -10870,7 +10870,7 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
10870
10870
|
IkasStorefrontConfig.components = components;
|
|
10871
10871
|
IkasStorefrontConfig.config = config;
|
|
10872
10872
|
IkasStorefrontConfig.localTheme = localTheme;
|
|
10873
|
-
IkasStorefrontConfig.apiUrlOverride = apiUrlOverride;
|
|
10873
|
+
IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
|
|
10874
10874
|
};
|
|
10875
10875
|
IkasStorefrontConfig.components = {};
|
|
10876
10876
|
IkasStorefrontConfig.config = {};
|
|
@@ -11643,8 +11643,8 @@ var IkasBrandPropValueProvider = /** @class */ (function () {
|
|
|
11643
11643
|
}());
|
|
11644
11644
|
|
|
11645
11645
|
var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
11646
|
-
function IkasLinkPropValueProvider(
|
|
11647
|
-
this.linkPropValue =
|
|
11646
|
+
function IkasLinkPropValueProvider(linkPropValue, theme) {
|
|
11647
|
+
this.linkPropValue = linkPropValue;
|
|
11648
11648
|
this.theme = theme;
|
|
11649
11649
|
}
|
|
11650
11650
|
IkasLinkPropValueProvider.prototype.getNavigationLink = function (linkPropValue) {
|
|
@@ -11700,7 +11700,7 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
|
11700
11700
|
IkasThemePageType.BRAND,
|
|
11701
11701
|
IkasThemePageType.CATEGORY,
|
|
11702
11702
|
].includes(linkPropValue.pageType)) return [3 /*break*/, 11];
|
|
11703
|
-
return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, linkPropValue.itemId)];
|
|
11703
|
+
return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, linkPropValue.itemId || undefined)];
|
|
11704
11704
|
case 10:
|
|
11705
11705
|
metaDataList = _d.sent();
|
|
11706
11706
|
if (metaDataList.length) {
|
|
@@ -11769,6 +11769,122 @@ var IkasNavigationLink = /** @class */ (function () {
|
|
|
11769
11769
|
return IkasNavigationLink;
|
|
11770
11770
|
}());
|
|
11771
11771
|
|
|
11772
|
+
var IkasImageListPropValueProvider = /** @class */ (function () {
|
|
11773
|
+
function IkasImageListPropValueProvider(imageListPropValue) {
|
|
11774
|
+
this.imageListPropValue = imageListPropValue;
|
|
11775
|
+
}
|
|
11776
|
+
IkasImageListPropValueProvider.prototype.getValue = function () {
|
|
11777
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11778
|
+
return __generator(this, function (_a) {
|
|
11779
|
+
return [2 /*return*/, this.imageListPropValue.map(function (i) { return new IkasImage(i); })];
|
|
11780
|
+
});
|
|
11781
|
+
});
|
|
11782
|
+
};
|
|
11783
|
+
return IkasImageListPropValueProvider;
|
|
11784
|
+
}());
|
|
11785
|
+
|
|
11786
|
+
var IkasTextPropValueProvider = /** @class */ (function () {
|
|
11787
|
+
function IkasTextPropValueProvider(textPropValue) {
|
|
11788
|
+
this.text = textPropValue;
|
|
11789
|
+
}
|
|
11790
|
+
IkasTextPropValueProvider.prototype.getValue = function () {
|
|
11791
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11792
|
+
return __generator(this, function (_a) {
|
|
11793
|
+
return [2 /*return*/, this.text];
|
|
11794
|
+
});
|
|
11795
|
+
});
|
|
11796
|
+
};
|
|
11797
|
+
return IkasTextPropValueProvider;
|
|
11798
|
+
}());
|
|
11799
|
+
|
|
11800
|
+
var IkasBooleanPropValueProvider = /** @class */ (function () {
|
|
11801
|
+
function IkasBooleanPropValueProvider(textPropValue) {
|
|
11802
|
+
this.bool = textPropValue;
|
|
11803
|
+
}
|
|
11804
|
+
IkasBooleanPropValueProvider.prototype.getValue = function () {
|
|
11805
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11806
|
+
return __generator(this, function (_a) {
|
|
11807
|
+
return [2 /*return*/, this.bool];
|
|
11808
|
+
});
|
|
11809
|
+
});
|
|
11810
|
+
};
|
|
11811
|
+
return IkasBooleanPropValueProvider;
|
|
11812
|
+
}());
|
|
11813
|
+
|
|
11814
|
+
var IkasImagePropValueProvider = /** @class */ (function () {
|
|
11815
|
+
function IkasImagePropValueProvider(imagePropValue) {
|
|
11816
|
+
this.imagePropValue = imagePropValue;
|
|
11817
|
+
}
|
|
11818
|
+
IkasImagePropValueProvider.prototype.getValue = function () {
|
|
11819
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11820
|
+
return __generator(this, function (_a) {
|
|
11821
|
+
return [2 /*return*/, new IkasImage(this.imagePropValue)];
|
|
11822
|
+
});
|
|
11823
|
+
});
|
|
11824
|
+
};
|
|
11825
|
+
return IkasImagePropValueProvider;
|
|
11826
|
+
}());
|
|
11827
|
+
|
|
11828
|
+
var IkasCategoryPropValueProvider = /** @class */ (function () {
|
|
11829
|
+
function IkasCategoryPropValueProvider(prop, pageSpecificData) {
|
|
11830
|
+
this.categoryPropValue = prop;
|
|
11831
|
+
this.pageSpecificData = pageSpecificData;
|
|
11832
|
+
}
|
|
11833
|
+
IkasCategoryPropValueProvider.prototype.getValue = function () {
|
|
11834
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11835
|
+
var response, category, err_1;
|
|
11836
|
+
return __generator(this, function (_a) {
|
|
11837
|
+
switch (_a.label) {
|
|
11838
|
+
case 0:
|
|
11839
|
+
if (this.categoryPropValue.usePageData) {
|
|
11840
|
+
return [2 /*return*/, this.pageSpecificData];
|
|
11841
|
+
}
|
|
11842
|
+
_a.label = 1;
|
|
11843
|
+
case 1:
|
|
11844
|
+
_a.trys.push([1, 3, , 4]);
|
|
11845
|
+
return [4 /*yield*/, IkasCategoryAPI.listCategories({
|
|
11846
|
+
idList: [this.categoryPropValue.categoryId],
|
|
11847
|
+
})];
|
|
11848
|
+
case 2:
|
|
11849
|
+
response = _a.sent();
|
|
11850
|
+
category = response.categories[0];
|
|
11851
|
+
return [2 /*return*/, new IkasCategory(category)];
|
|
11852
|
+
case 3:
|
|
11853
|
+
err_1 = _a.sent();
|
|
11854
|
+
console.log(err_1);
|
|
11855
|
+
return [3 /*break*/, 4];
|
|
11856
|
+
case 4: return [2 /*return*/, new IkasCategory({})];
|
|
11857
|
+
}
|
|
11858
|
+
});
|
|
11859
|
+
});
|
|
11860
|
+
};
|
|
11861
|
+
return IkasCategoryPropValueProvider;
|
|
11862
|
+
}());
|
|
11863
|
+
|
|
11864
|
+
var IkasCategoryListPropValueProvider = /** @class */ (function () {
|
|
11865
|
+
function IkasCategoryListPropValueProvider(categoryListPropValue) {
|
|
11866
|
+
this.categoryListPropValue = categoryListPropValue;
|
|
11867
|
+
}
|
|
11868
|
+
IkasCategoryListPropValueProvider.prototype.getValue = function () {
|
|
11869
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11870
|
+
var categoryList;
|
|
11871
|
+
return __generator(this, function (_a) {
|
|
11872
|
+
switch (_a.label) {
|
|
11873
|
+
case 0:
|
|
11874
|
+
categoryList = new IkasCategoryList({
|
|
11875
|
+
categoryListPropValue: this.categoryListPropValue,
|
|
11876
|
+
});
|
|
11877
|
+
return [4 /*yield*/, categoryList.getInitial()];
|
|
11878
|
+
case 1:
|
|
11879
|
+
_a.sent();
|
|
11880
|
+
return [2 /*return*/, categoryList];
|
|
11881
|
+
}
|
|
11882
|
+
});
|
|
11883
|
+
});
|
|
11884
|
+
};
|
|
11885
|
+
return IkasCategoryListPropValueProvider;
|
|
11886
|
+
}());
|
|
11887
|
+
|
|
11772
11888
|
var IkasPageDataProvider = /** @class */ (function () {
|
|
11773
11889
|
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
11774
11890
|
this.pageType = null;
|
|
@@ -12003,10 +12119,17 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12003
12119
|
return [2 /*return*/, null];
|
|
12004
12120
|
switch (prop.type) {
|
|
12005
12121
|
case IkasThemeComponentPropType.TEXT:
|
|
12122
|
+
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
12123
|
+
break;
|
|
12006
12124
|
case IkasThemeComponentPropType.BOOLEAN:
|
|
12007
|
-
|
|
12125
|
+
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
12126
|
+
break;
|
|
12008
12127
|
case IkasThemeComponentPropType.IMAGE:
|
|
12009
|
-
|
|
12128
|
+
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
12129
|
+
break;
|
|
12130
|
+
case IkasThemeComponentPropType.IMAGE_LIST:
|
|
12131
|
+
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
12132
|
+
break;
|
|
12010
12133
|
case IkasThemeComponentPropType.BRAND:
|
|
12011
12134
|
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
12012
12135
|
break;
|
|
@@ -12019,6 +12142,12 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12019
12142
|
case IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
12020
12143
|
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
12021
12144
|
break;
|
|
12145
|
+
case IkasThemeComponentPropType.CATEGORY:
|
|
12146
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
12147
|
+
break;
|
|
12148
|
+
case IkasThemeComponentPropType.CATEGORY_LIST:
|
|
12149
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
12150
|
+
break;
|
|
12022
12151
|
case IkasThemeComponentPropType.LINK:
|
|
12023
12152
|
case IkasThemeComponentPropType.LIST_OF_LINK:
|
|
12024
12153
|
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
@@ -12055,6 +12184,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12055
12184
|
case IkasThemeComponentPropType.BRAND_LIST:
|
|
12056
12185
|
IkasPageDataProvider.initBrandListPropValue(prop, propValue, pageComponentPropValue);
|
|
12057
12186
|
break;
|
|
12187
|
+
case IkasThemeComponentPropType.CATEGORY_LIST:
|
|
12188
|
+
IkasPageDataProvider.initCategoryListPropValue(prop, propValue, pageComponentPropValue);
|
|
12189
|
+
break;
|
|
12058
12190
|
case IkasThemeComponentPropType.PRODUCT_LIST:
|
|
12059
12191
|
IkasPageDataProvider.initProductListPropValue(prop, propValue, pageComponentPropValue);
|
|
12060
12192
|
break;
|
|
@@ -12074,6 +12206,10 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12074
12206
|
var brandList = new IkasBrandList(propValue);
|
|
12075
12207
|
pageComponentPropValue.propValues[prop.name] = brandList;
|
|
12076
12208
|
};
|
|
12209
|
+
IkasPageDataProvider.initCategoryListPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
12210
|
+
var categoryList = new IkasCategoryList(propValue);
|
|
12211
|
+
pageComponentPropValue.propValues[prop.name] = categoryList;
|
|
12212
|
+
};
|
|
12077
12213
|
IkasPageDataProvider.initProductListPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
12078
12214
|
var productList = new IkasProductList(propValue);
|
|
12079
12215
|
pageComponentPropValue.propValues[prop.name] = productList;
|
|
@@ -12111,7 +12247,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12111
12247
|
};
|
|
12112
12248
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
12113
12249
|
if (Array.isArray(propValue)) {
|
|
12114
|
-
pageComponentPropValue.propValues[prop.name] = propValue.map(function (p) {
|
|
12250
|
+
pageComponentPropValue.propValues[prop.name] = propValue.map(function (p) {
|
|
12251
|
+
return new IkasNavigationLink(p.href, p.label, p.subLinks, p.isExternal || undefined);
|
|
12252
|
+
});
|
|
12115
12253
|
}
|
|
12116
12254
|
else if (propValue) {
|
|
12117
12255
|
pageComponentPropValue.propValues[prop.name] = new IkasNavigationLink(propValue.href, propValue.label, propValue.subLinks, propValue.isExternal);
|
|
@@ -13106,57 +13244,6 @@ var IkasTransactionTypeEnum;
|
|
|
13106
13244
|
IkasTransactionTypeEnum["VOID"] = "VOID";
|
|
13107
13245
|
})(IkasTransactionTypeEnum || (IkasTransactionTypeEnum = {}));
|
|
13108
13246
|
|
|
13109
|
-
var IkasThemeComponentProp = /** @class */ (function () {
|
|
13110
|
-
function IkasThemeComponentProp(data) {
|
|
13111
|
-
this.name = data.name || "";
|
|
13112
|
-
this.displayName = data.displayName || "";
|
|
13113
|
-
this.type = data.type || IkasThemeComponentPropType.TEXT;
|
|
13114
|
-
makeAutoObservable(this);
|
|
13115
|
-
}
|
|
13116
|
-
return IkasThemeComponentProp;
|
|
13117
|
-
}());
|
|
13118
|
-
var IkasThemeComponentPropType;
|
|
13119
|
-
(function (IkasThemeComponentPropType) {
|
|
13120
|
-
IkasThemeComponentPropType["IMAGE"] = "IMAGE";
|
|
13121
|
-
IkasThemeComponentPropType["TEXT"] = "TEXT";
|
|
13122
|
-
IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
|
|
13123
|
-
IkasThemeComponentPropType["LINK"] = "LINK";
|
|
13124
|
-
IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
13125
|
-
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
13126
|
-
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
13127
|
-
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
13128
|
-
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
13129
|
-
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
13130
|
-
IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
13131
|
-
// TODO number
|
|
13132
|
-
// TODO productAttribute
|
|
13133
|
-
})(IkasThemeComponentPropType || (IkasThemeComponentPropType = {}));
|
|
13134
|
-
|
|
13135
|
-
var IkasThemeComponent = /** @class */ (function () {
|
|
13136
|
-
function IkasThemeComponent(data) {
|
|
13137
|
-
this.id = data.id || "";
|
|
13138
|
-
this.dir = data.dir || "";
|
|
13139
|
-
this.displayName = data.displayName || "";
|
|
13140
|
-
this.props = data.props
|
|
13141
|
-
? data.props.map(function (p) { return new IkasThemeComponentProp(p); })
|
|
13142
|
-
: [];
|
|
13143
|
-
this.isHeader = data.isHeader || false;
|
|
13144
|
-
this.isFooter = data.isFooter || false;
|
|
13145
|
-
makeAutoObservable(this);
|
|
13146
|
-
}
|
|
13147
|
-
return IkasThemeComponent;
|
|
13148
|
-
}());
|
|
13149
|
-
|
|
13150
|
-
var IkasThemePageComponent = /** @class */ (function () {
|
|
13151
|
-
function IkasThemePageComponent(data) {
|
|
13152
|
-
this.id = data.id || "";
|
|
13153
|
-
this.componentId = data.componentId || "";
|
|
13154
|
-
this.propValues = data.propValues || {};
|
|
13155
|
-
makeAutoObservable(this);
|
|
13156
|
-
}
|
|
13157
|
-
return IkasThemePageComponent;
|
|
13158
|
-
}());
|
|
13159
|
-
|
|
13160
13247
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
13161
13248
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
13162
13249
|
// generators (like Math.random()).
|
|
@@ -13231,6 +13318,60 @@ function v4(options, buf, offset) {
|
|
|
13231
13318
|
return stringify(rnds);
|
|
13232
13319
|
}
|
|
13233
13320
|
|
|
13321
|
+
var IkasThemeComponentProp = /** @class */ (function () {
|
|
13322
|
+
function IkasThemeComponentProp(data) {
|
|
13323
|
+
this.id = data.id || v4();
|
|
13324
|
+
this.name = data.name || "";
|
|
13325
|
+
this.displayName = data.displayName || "";
|
|
13326
|
+
this.type = data.type || IkasThemeComponentPropType.TEXT;
|
|
13327
|
+
this.isRequired = data.isRequired || false;
|
|
13328
|
+
makeAutoObservable(this);
|
|
13329
|
+
}
|
|
13330
|
+
return IkasThemeComponentProp;
|
|
13331
|
+
}());
|
|
13332
|
+
var IkasThemeComponentPropType;
|
|
13333
|
+
(function (IkasThemeComponentPropType) {
|
|
13334
|
+
IkasThemeComponentPropType["TEXT"] = "TEXT";
|
|
13335
|
+
IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
|
|
13336
|
+
IkasThemeComponentPropType["IMAGE"] = "IMAGE";
|
|
13337
|
+
IkasThemeComponentPropType["IMAGE_LIST"] = "IMAGE_LIST";
|
|
13338
|
+
IkasThemeComponentPropType["LINK"] = "LINK";
|
|
13339
|
+
IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
13340
|
+
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
13341
|
+
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
13342
|
+
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
13343
|
+
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
13344
|
+
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
13345
|
+
IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
13346
|
+
// TODO number
|
|
13347
|
+
// TODO productAttribute
|
|
13348
|
+
})(IkasThemeComponentPropType || (IkasThemeComponentPropType = {}));
|
|
13349
|
+
|
|
13350
|
+
var IkasThemeComponent = /** @class */ (function () {
|
|
13351
|
+
function IkasThemeComponent(data) {
|
|
13352
|
+
this.id = data.id || "";
|
|
13353
|
+
this.dir = data.dir || "";
|
|
13354
|
+
this.displayName = data.displayName || "";
|
|
13355
|
+
this.props = data.props
|
|
13356
|
+
? data.props.map(function (p) { return new IkasThemeComponentProp(p); })
|
|
13357
|
+
: [];
|
|
13358
|
+
this.isHeader = data.isHeader || false;
|
|
13359
|
+
this.isFooter = data.isFooter || false;
|
|
13360
|
+
makeAutoObservable(this);
|
|
13361
|
+
}
|
|
13362
|
+
return IkasThemeComponent;
|
|
13363
|
+
}());
|
|
13364
|
+
|
|
13365
|
+
var IkasThemePageComponent = /** @class */ (function () {
|
|
13366
|
+
function IkasThemePageComponent(data) {
|
|
13367
|
+
this.id = data.id || "";
|
|
13368
|
+
this.componentId = data.componentId || "";
|
|
13369
|
+
this.propValues = data.propValues || {};
|
|
13370
|
+
makeAutoObservable(this);
|
|
13371
|
+
}
|
|
13372
|
+
return IkasThemePageComponent;
|
|
13373
|
+
}());
|
|
13374
|
+
|
|
13234
13375
|
var IkasThemePage = /** @class */ (function () {
|
|
13235
13376
|
function IkasThemePage(data) {
|
|
13236
13377
|
this.id = data.id || v4();
|
|
@@ -13355,7 +13496,9 @@ var IkasBrandList = /** @class */ (function () {
|
|
|
13355
13496
|
case 1:
|
|
13356
13497
|
_a.trys.push([1, 3, 4, 5]);
|
|
13357
13498
|
return [4 /*yield*/, IkasBrandAPI.listBrands({
|
|
13358
|
-
idList: this.isStatic
|
|
13499
|
+
idList: this.isStatic
|
|
13500
|
+
? this._brandListPropValue.brandIds || undefined
|
|
13501
|
+
: undefined,
|
|
13359
13502
|
page: this.isStatic ? undefined : this.page,
|
|
13360
13503
|
limit: this.isStatic ? undefined : this.limit,
|
|
13361
13504
|
})];
|
|
@@ -13621,6 +13764,276 @@ var IkasBrandListPropValue = /** @class */ (function () {
|
|
|
13621
13764
|
return IkasBrandListPropValue;
|
|
13622
13765
|
}());
|
|
13623
13766
|
|
|
13767
|
+
var IkasCategoryList = /** @class */ (function () {
|
|
13768
|
+
function IkasCategoryList(data) {
|
|
13769
|
+
var _this = this;
|
|
13770
|
+
this._initialized = false;
|
|
13771
|
+
this._minPage = null;
|
|
13772
|
+
this._isLoading = false;
|
|
13773
|
+
this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
13774
|
+
var response_1, err_1;
|
|
13775
|
+
var _this = this;
|
|
13776
|
+
return __generator(this, function (_a) {
|
|
13777
|
+
switch (_a.label) {
|
|
13778
|
+
case 0:
|
|
13779
|
+
if (this._isLoading)
|
|
13780
|
+
return [2 /*return*/];
|
|
13781
|
+
this._isLoading = true;
|
|
13782
|
+
_a.label = 1;
|
|
13783
|
+
case 1:
|
|
13784
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
13785
|
+
return [4 /*yield*/, IkasCategoryAPI.listCategories({
|
|
13786
|
+
idList: this.isStatic
|
|
13787
|
+
? this._categoryListPropValue.categoryIds || undefined
|
|
13788
|
+
: undefined,
|
|
13789
|
+
page: this.isStatic ? undefined : this.page,
|
|
13790
|
+
limit: this.isStatic ? undefined : this.limit,
|
|
13791
|
+
})];
|
|
13792
|
+
case 2:
|
|
13793
|
+
response_1 = _a.sent();
|
|
13794
|
+
runInAction(function () {
|
|
13795
|
+
_this.data = response_1.categories;
|
|
13796
|
+
_this._count = response_1.count;
|
|
13797
|
+
_this._initialized = true;
|
|
13798
|
+
_this._minPage = _this.page;
|
|
13799
|
+
});
|
|
13800
|
+
return [3 /*break*/, 5];
|
|
13801
|
+
case 3:
|
|
13802
|
+
err_1 = _a.sent();
|
|
13803
|
+
console.log(err_1);
|
|
13804
|
+
return [3 /*break*/, 5];
|
|
13805
|
+
case 4:
|
|
13806
|
+
runInAction(function () {
|
|
13807
|
+
_this._isLoading = false;
|
|
13808
|
+
});
|
|
13809
|
+
return [7 /*endfinally*/];
|
|
13810
|
+
case 5: return [2 /*return*/];
|
|
13811
|
+
}
|
|
13812
|
+
});
|
|
13813
|
+
}); };
|
|
13814
|
+
this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
13815
|
+
var minPage_1, response_2, err_2;
|
|
13816
|
+
var _this = this;
|
|
13817
|
+
return __generator(this, function (_a) {
|
|
13818
|
+
switch (_a.label) {
|
|
13819
|
+
case 0:
|
|
13820
|
+
if (this.isStatic || this._isLoading || !this.hasPrev)
|
|
13821
|
+
return [2 /*return*/];
|
|
13822
|
+
this._isLoading = true;
|
|
13823
|
+
_a.label = 1;
|
|
13824
|
+
case 1:
|
|
13825
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
13826
|
+
minPage_1 = this._minPage - 1;
|
|
13827
|
+
return [4 /*yield*/, IkasCategoryAPI.listCategories({
|
|
13828
|
+
page: minPage_1,
|
|
13829
|
+
limit: this.limit,
|
|
13830
|
+
})];
|
|
13831
|
+
case 2:
|
|
13832
|
+
response_2 = _a.sent();
|
|
13833
|
+
runInAction(function () {
|
|
13834
|
+
_this.data = response_2.categories.concat(_this.data);
|
|
13835
|
+
_this._count = response_2.count;
|
|
13836
|
+
_this._minPage = minPage_1;
|
|
13837
|
+
});
|
|
13838
|
+
return [3 /*break*/, 5];
|
|
13839
|
+
case 3:
|
|
13840
|
+
err_2 = _a.sent();
|
|
13841
|
+
console.log(err_2);
|
|
13842
|
+
return [3 /*break*/, 5];
|
|
13843
|
+
case 4:
|
|
13844
|
+
runInAction(function () {
|
|
13845
|
+
_this._isLoading = false;
|
|
13846
|
+
});
|
|
13847
|
+
return [7 /*endfinally*/];
|
|
13848
|
+
case 5: return [2 /*return*/];
|
|
13849
|
+
}
|
|
13850
|
+
});
|
|
13851
|
+
}); };
|
|
13852
|
+
this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
13853
|
+
var response_3, err_3;
|
|
13854
|
+
var _this = this;
|
|
13855
|
+
return __generator(this, function (_a) {
|
|
13856
|
+
switch (_a.label) {
|
|
13857
|
+
case 0:
|
|
13858
|
+
if (this.isStatic || this._isLoading || !this.hasNext)
|
|
13859
|
+
return [2 /*return*/];
|
|
13860
|
+
this._isLoading = true;
|
|
13861
|
+
_a.label = 1;
|
|
13862
|
+
case 1:
|
|
13863
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
13864
|
+
return [4 /*yield*/, IkasCategoryAPI.listCategories({
|
|
13865
|
+
page: this.page + 1,
|
|
13866
|
+
limit: this.limit,
|
|
13867
|
+
})];
|
|
13868
|
+
case 2:
|
|
13869
|
+
response_3 = _a.sent();
|
|
13870
|
+
runInAction(function () {
|
|
13871
|
+
_this.data = _this.data.concat(response_3.categories);
|
|
13872
|
+
_this._count = response_3.count;
|
|
13873
|
+
_this._page = _this.page + 1;
|
|
13874
|
+
});
|
|
13875
|
+
return [3 /*break*/, 5];
|
|
13876
|
+
case 3:
|
|
13877
|
+
err_3 = _a.sent();
|
|
13878
|
+
console.log(err_3);
|
|
13879
|
+
return [3 /*break*/, 5];
|
|
13880
|
+
case 4:
|
|
13881
|
+
runInAction(function () {
|
|
13882
|
+
_this._isLoading = false;
|
|
13883
|
+
});
|
|
13884
|
+
return [7 /*endfinally*/];
|
|
13885
|
+
case 5: return [2 /*return*/];
|
|
13886
|
+
}
|
|
13887
|
+
});
|
|
13888
|
+
}); };
|
|
13889
|
+
this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
|
|
13890
|
+
var response_4, err_4;
|
|
13891
|
+
var _this = this;
|
|
13892
|
+
return __generator(this, function (_a) {
|
|
13893
|
+
switch (_a.label) {
|
|
13894
|
+
case 0:
|
|
13895
|
+
if (this._isLoading || this.isStatic)
|
|
13896
|
+
return [2 /*return*/];
|
|
13897
|
+
this._isLoading = true;
|
|
13898
|
+
_a.label = 1;
|
|
13899
|
+
case 1:
|
|
13900
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
13901
|
+
return [4 /*yield*/, IkasCategoryAPI.listCategories({
|
|
13902
|
+
page: page,
|
|
13903
|
+
limit: this.limit,
|
|
13904
|
+
})];
|
|
13905
|
+
case 2:
|
|
13906
|
+
response_4 = _a.sent();
|
|
13907
|
+
runInAction(function () {
|
|
13908
|
+
_this.data = response_4.categories;
|
|
13909
|
+
_this._count = response_4.count;
|
|
13910
|
+
_this._page = page;
|
|
13911
|
+
_this._minPage = page;
|
|
13912
|
+
});
|
|
13913
|
+
return [3 /*break*/, 5];
|
|
13914
|
+
case 3:
|
|
13915
|
+
err_4 = _a.sent();
|
|
13916
|
+
console.log(err_4);
|
|
13917
|
+
return [3 /*break*/, 5];
|
|
13918
|
+
case 4:
|
|
13919
|
+
runInAction(function () {
|
|
13920
|
+
_this._isLoading = false;
|
|
13921
|
+
});
|
|
13922
|
+
return [7 /*endfinally*/];
|
|
13923
|
+
case 5: return [2 /*return*/];
|
|
13924
|
+
}
|
|
13925
|
+
});
|
|
13926
|
+
}); };
|
|
13927
|
+
this.data = data.data ? data.data.map(function (b) { return new IkasCategory(b); }) : [];
|
|
13928
|
+
this._type =
|
|
13929
|
+
data.type ||
|
|
13930
|
+
data.categoryListPropValue.categoryListType ||
|
|
13931
|
+
IkasCategoryListType.ALL;
|
|
13932
|
+
this._sort =
|
|
13933
|
+
data.sort ||
|
|
13934
|
+
data.categoryListPropValue.initialSort ||
|
|
13935
|
+
IkasCategoryListSortType.A_Z;
|
|
13936
|
+
this._limit = data.limit || data.categoryListPropValue.initialLimit || 20;
|
|
13937
|
+
this._page = data.page || 1;
|
|
13938
|
+
this._count = data.count || 0;
|
|
13939
|
+
this._initialized = data.initialized || false;
|
|
13940
|
+
this._minPage = data.minPage;
|
|
13941
|
+
this._categoryListPropValue = data.categoryListPropValue;
|
|
13942
|
+
makeAutoObservable(this);
|
|
13943
|
+
}
|
|
13944
|
+
Object.defineProperty(IkasCategoryList.prototype, "sort", {
|
|
13945
|
+
get: function () {
|
|
13946
|
+
return this._sort;
|
|
13947
|
+
},
|
|
13948
|
+
enumerable: false,
|
|
13949
|
+
configurable: true
|
|
13950
|
+
});
|
|
13951
|
+
Object.defineProperty(IkasCategoryList.prototype, "limit", {
|
|
13952
|
+
get: function () {
|
|
13953
|
+
return this._limit;
|
|
13954
|
+
},
|
|
13955
|
+
enumerable: false,
|
|
13956
|
+
configurable: true
|
|
13957
|
+
});
|
|
13958
|
+
Object.defineProperty(IkasCategoryList.prototype, "page", {
|
|
13959
|
+
get: function () {
|
|
13960
|
+
return this._page;
|
|
13961
|
+
},
|
|
13962
|
+
enumerable: false,
|
|
13963
|
+
configurable: true
|
|
13964
|
+
});
|
|
13965
|
+
Object.defineProperty(IkasCategoryList.prototype, "count", {
|
|
13966
|
+
get: function () {
|
|
13967
|
+
return this._count;
|
|
13968
|
+
},
|
|
13969
|
+
enumerable: false,
|
|
13970
|
+
configurable: true
|
|
13971
|
+
});
|
|
13972
|
+
Object.defineProperty(IkasCategoryList.prototype, "isInitialized", {
|
|
13973
|
+
get: function () {
|
|
13974
|
+
return this._initialized;
|
|
13975
|
+
},
|
|
13976
|
+
enumerable: false,
|
|
13977
|
+
configurable: true
|
|
13978
|
+
});
|
|
13979
|
+
Object.defineProperty(IkasCategoryList.prototype, "isStatic", {
|
|
13980
|
+
get: function () {
|
|
13981
|
+
return this._type === IkasCategoryListType.STATIC;
|
|
13982
|
+
},
|
|
13983
|
+
enumerable: false,
|
|
13984
|
+
configurable: true
|
|
13985
|
+
});
|
|
13986
|
+
Object.defineProperty(IkasCategoryList.prototype, "hasPrev", {
|
|
13987
|
+
get: function () {
|
|
13988
|
+
if (this.isStatic || !this._minPage)
|
|
13989
|
+
return false;
|
|
13990
|
+
return this._minPage > 1;
|
|
13991
|
+
},
|
|
13992
|
+
enumerable: false,
|
|
13993
|
+
configurable: true
|
|
13994
|
+
});
|
|
13995
|
+
Object.defineProperty(IkasCategoryList.prototype, "hasNext", {
|
|
13996
|
+
get: function () {
|
|
13997
|
+
if (this.isStatic)
|
|
13998
|
+
return false;
|
|
13999
|
+
return this.page * this.limit < this.count;
|
|
14000
|
+
},
|
|
14001
|
+
enumerable: false,
|
|
14002
|
+
configurable: true
|
|
14003
|
+
});
|
|
14004
|
+
Object.defineProperty(IkasCategoryList.prototype, "isLoading", {
|
|
14005
|
+
get: function () {
|
|
14006
|
+
return this._isLoading;
|
|
14007
|
+
},
|
|
14008
|
+
enumerable: false,
|
|
14009
|
+
configurable: true
|
|
14010
|
+
});
|
|
14011
|
+
IkasCategoryList.prototype.toJSON = function () {
|
|
14012
|
+
return {
|
|
14013
|
+
data: this.data,
|
|
14014
|
+
type: this._type,
|
|
14015
|
+
sort: this._sort,
|
|
14016
|
+
limit: this._limit,
|
|
14017
|
+
page: this._page,
|
|
14018
|
+
count: this._count,
|
|
14019
|
+
initialized: this._initialized,
|
|
14020
|
+
minPage: this._minPage,
|
|
14021
|
+
categoryListPropValue: this._categoryListPropValue,
|
|
14022
|
+
};
|
|
14023
|
+
};
|
|
14024
|
+
return IkasCategoryList;
|
|
14025
|
+
}());
|
|
14026
|
+
var IkasCategoryListType;
|
|
14027
|
+
(function (IkasCategoryListType) {
|
|
14028
|
+
IkasCategoryListType["ALL"] = "ALL";
|
|
14029
|
+
IkasCategoryListType["STATIC"] = "STATIC";
|
|
14030
|
+
})(IkasCategoryListType || (IkasCategoryListType = {}));
|
|
14031
|
+
var IkasCategoryListSortType;
|
|
14032
|
+
(function (IkasCategoryListSortType) {
|
|
14033
|
+
IkasCategoryListSortType["A_Z"] = "A_Z";
|
|
14034
|
+
IkasCategoryListSortType["Z_A"] = "Z_A";
|
|
14035
|
+
})(IkasCategoryListSortType || (IkasCategoryListSortType = {}));
|
|
14036
|
+
|
|
13624
14037
|
var IkasProductDetail = /** @class */ (function () {
|
|
13625
14038
|
function IkasProductDetail(product, selectedVariantValues, usePageData, router) {
|
|
13626
14039
|
this.usePageData = null;
|
|
@@ -14101,6 +14514,35 @@ var IkasProductDetailPropValue = /** @class */ (function () {
|
|
|
14101
14514
|
return IkasProductDetailPropValue;
|
|
14102
14515
|
}());
|
|
14103
14516
|
|
|
14517
|
+
var IkasCategoryPropValue = /** @class */ (function () {
|
|
14518
|
+
function IkasCategoryPropValue(data) {
|
|
14519
|
+
this.categoryId = null;
|
|
14520
|
+
// Only for category detail page
|
|
14521
|
+
this.usePageData = null;
|
|
14522
|
+
this.categoryId = data.categoryId;
|
|
14523
|
+
this.usePageData = data.usePageData;
|
|
14524
|
+
makeAutoObservable(this);
|
|
14525
|
+
}
|
|
14526
|
+
return IkasCategoryPropValue;
|
|
14527
|
+
}());
|
|
14528
|
+
|
|
14529
|
+
var IkasCategoryListPropValue = /** @class */ (function () {
|
|
14530
|
+
function IkasCategoryListPropValue(data) {
|
|
14531
|
+
this.initialSort = null;
|
|
14532
|
+
this.initialLimit = null;
|
|
14533
|
+
// Only for static lists
|
|
14534
|
+
this.categoryCount = null;
|
|
14535
|
+
this.categoryIds = null;
|
|
14536
|
+
this.categoryListType = data.categoryListType || IkasCategoryListType.ALL;
|
|
14537
|
+
this.initialSort = data.initialSort || IkasCategoryListSortType.A_Z;
|
|
14538
|
+
this.initialLimit = data.initialLimit || 20;
|
|
14539
|
+
this.categoryCount = data.categoryCount;
|
|
14540
|
+
this.categoryIds = data.categoryIds;
|
|
14541
|
+
makeAutoObservable(this);
|
|
14542
|
+
}
|
|
14543
|
+
return IkasCategoryListPropValue;
|
|
14544
|
+
}());
|
|
14545
|
+
|
|
14104
14546
|
var IkasBrandAPI = /** @class */ (function () {
|
|
14105
14547
|
function IkasBrandAPI() {
|
|
14106
14548
|
}
|
|
@@ -14260,7 +14702,7 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
14260
14702
|
return __generator(this, function (_b) {
|
|
14261
14703
|
switch (_b.label) {
|
|
14262
14704
|
case 0:
|
|
14263
|
-
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput
|
|
14705
|
+
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
|
|
14264
14706
|
_b.label = 1;
|
|
14265
14707
|
case 1:
|
|
14266
14708
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -14269,9 +14711,11 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
14269
14711
|
.query({
|
|
14270
14712
|
query: LIST_QUERY,
|
|
14271
14713
|
variables: {
|
|
14272
|
-
id:
|
|
14273
|
-
|
|
14274
|
-
|
|
14714
|
+
id: (params === null || params === void 0 ? void 0 : params.idList) && params.idList.length
|
|
14715
|
+
? {
|
|
14716
|
+
in: params.idList,
|
|
14717
|
+
}
|
|
14718
|
+
: undefined,
|
|
14275
14719
|
paginationInput: (params === null || params === void 0 ? void 0 : params.page) ? {
|
|
14276
14720
|
page: params.page,
|
|
14277
14721
|
limit: params.limit || 10,
|
|
@@ -18852,7 +19296,7 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
18852
19296
|
return __generator(this, function (_b) {
|
|
18853
19297
|
switch (_b.label) {
|
|
18854
19298
|
case 0:
|
|
18855
|
-
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n
|
|
19299
|
+
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
|
|
18856
19300
|
_b.label = 1;
|
|
18857
19301
|
case 1:
|
|
18858
19302
|
_b.trys.push([1, 8, , 9]);
|
|
@@ -20809,7 +21253,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
20809
21253
|
this.changeStep(CheckoutStep.SUCCESS);
|
|
20810
21254
|
}
|
|
20811
21255
|
else if (transactionStatus === IkasTransactionStatusEnum.PENDING &&
|
|
20812
|
-
response.returnSlug) {
|
|
21256
|
+
!!(response === null || response === void 0 ? void 0 : response.returnSlug)) {
|
|
20813
21257
|
window.location.href =
|
|
20814
21258
|
process.env.NEXT_PUBLIC_BASE_URL + response.returnSlug;
|
|
20815
21259
|
}
|
|
@@ -21670,7 +22114,7 @@ var CheckoutStepInfo = observer(function (_a) {
|
|
|
21670
22114
|
createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedShippingAddressId, onChange: vm.onSelectedShippingAddressIdChange, options: vm.customerAddressOptions }))),
|
|
21671
22115
|
createElement(AddressForm, { address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
|
|
21672
22116
|
? undefined
|
|
21673
|
-
: vm.checkout.customer, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds, validationResult: vm.checkout.shippingAddress.validationResult }),
|
|
22117
|
+
: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds, validationResult: vm.checkout.shippingAddress.validationResult }),
|
|
21674
22118
|
!!vm.customerStore.customer && vm.selectedShippingAddressId === "-1" && (createElement("div", { style: { marginTop: "12px" } },
|
|
21675
22119
|
createElement(Checkbox, { value: vm.shouldSaveAddress, label: "Bir sonraki i\u015Flem i\u00E7in bu bilgileri kaydet", onChange: vm.setShouldSaveAddress }),
|
|
21676
22120
|
vm.shouldSaveAddress && (createElement("div", { style: { marginTop: "8px" } },
|
|
@@ -21883,7 +22327,7 @@ var BillingAddress = observer(function (_a) {
|
|
|
21883
22327
|
!!vm.customerStore.customer &&
|
|
21884
22328
|
!!vm.customerStore.customer.addresses.length && (createElement("div", { className: styles$2.RowPB },
|
|
21885
22329
|
createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedBillingAddressId, onChange: vm.onSelectedBillingAddressIdChange, options: vm.customerAddressOptions }))),
|
|
21886
|
-
createElement(AddressForm, { address: vm.checkout.billingAddress, customer: vm.checkout.customer, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
|
|
22330
|
+
createElement(AddressForm, { address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
|
|
21887
22331
|
},
|
|
21888
22332
|
]; });
|
|
21889
22333
|
return (createElement(Fragment, null,
|
|
@@ -22780,10 +23224,15 @@ var style = {
|
|
|
22780
23224
|
};
|
|
22781
23225
|
|
|
22782
23226
|
var ThemeComponent = observer(function (_a) {
|
|
22783
|
-
var
|
|
23227
|
+
var pageComponentPropValue = _a.pageComponentPropValue, pageComponent = _a.pageComponent, index = _a.index;
|
|
22784
23228
|
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
23229
|
+
var propValues = pageComponentPropValue.propValues;
|
|
22785
23230
|
var hasNullValue = computed(function () {
|
|
22786
|
-
return Object.
|
|
23231
|
+
return Object.entries(propValues || {}).some(function (_a) {
|
|
23232
|
+
var _b;
|
|
23233
|
+
var propName = _a[0], propValue = _a[1];
|
|
23234
|
+
return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
|
|
23235
|
+
});
|
|
22787
23236
|
});
|
|
22788
23237
|
var Component = components[pageComponent.componentId];
|
|
22789
23238
|
return (createElement("div", { id: index + "" }, hasNullValue.get() ? (createElement(ErrorComponent, null)) : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { store: store })))));
|
|
@@ -22794,7 +23243,7 @@ var IkasPage = observer(function (_a) {
|
|
|
22794
23243
|
var propValues = _a.propValues, page = _a.page;
|
|
22795
23244
|
var renderComponent = function (pageComponent, index) {
|
|
22796
23245
|
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
22797
|
-
return (createElement(ThemeComponent, { key: pageComponent.id, index: index,
|
|
23246
|
+
return (createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent }));
|
|
22798
23247
|
};
|
|
22799
23248
|
var headerComponent = (_b = propValues.find(function (pv) { return pv.component.isHeader; })) === null || _b === void 0 ? void 0 : _b.pageComponent;
|
|
22800
23249
|
var footerComponent = (_c = propValues.find(function (pv) { return pv.component.isFooter; })) === null || _c === void 0 ? void 0 : _c.pageComponent;
|
|
@@ -22850,10 +23299,10 @@ var PageViewModel = /** @class */ (function () {
|
|
|
22850
23299
|
case BridgeMessageType.UPDATE_PROP_VALUE: return [3 /*break*/, 3];
|
|
22851
23300
|
case BridgeMessageType.UPDATE_PAGE_PARAMS: return [3 /*break*/, 5];
|
|
22852
23301
|
case BridgeMessageType.UPDATE_PAGE_COMPONENT_ORDER: return [3 /*break*/, 7];
|
|
22853
|
-
case BridgeMessageType.
|
|
23302
|
+
case BridgeMessageType.ADD_COMPONENT: return [3 /*break*/, 9];
|
|
22854
23303
|
case BridgeMessageType.DELETE_COMPONENT: return [3 /*break*/, 10];
|
|
22855
23304
|
case BridgeMessageType.UPDATE_COMPONENT: return [3 /*break*/, 11];
|
|
22856
|
-
case BridgeMessageType.
|
|
23305
|
+
case BridgeMessageType.ADD_PAGE_COMPONENT: return [3 /*break*/, 12];
|
|
22857
23306
|
case BridgeMessageType.DELETE_PAGE_COMPONENT: return [3 /*break*/, 14];
|
|
22858
23307
|
case BridgeMessageType.SET_SELECTED_COMPONENT: return [3 /*break*/, 15];
|
|
22859
23308
|
case BridgeMessageType.SET_HOVERED_COMPONENT: return [3 /*break*/, 16];
|
|
@@ -22983,7 +23432,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
22983
23432
|
this.pageParams = data.pageParams;
|
|
22984
23433
|
this.queryParams = data.queryParams;
|
|
22985
23434
|
this.apiKey = data.apiKey;
|
|
22986
|
-
apollo.createApolloClient(this.apiKey);
|
|
23435
|
+
apollo.createApolloClient(this.apiKey || undefined);
|
|
22987
23436
|
window.editorApiKey = data.apiKey;
|
|
22988
23437
|
return [4 /*yield*/, this.getPagePropValues()];
|
|
22989
23438
|
case 1:
|
|
@@ -23060,13 +23509,16 @@ var PageViewModel = /** @class */ (function () {
|
|
|
23060
23509
|
this.handleAddNewPageComponent = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
23061
23510
|
var pageComponent, pageComponentPropValue;
|
|
23062
23511
|
var _this = this;
|
|
23063
|
-
|
|
23064
|
-
|
|
23512
|
+
var _a;
|
|
23513
|
+
return __generator(this, function (_b) {
|
|
23514
|
+
switch (_b.label) {
|
|
23065
23515
|
case 0:
|
|
23066
23516
|
pageComponent = new IkasThemePageComponent(data.pageComponent);
|
|
23517
|
+
if ((_a = this.page) === null || _a === void 0 ? void 0 : _a.components.some(function (pc) { return pc.id === pageComponent.id; }))
|
|
23518
|
+
return [2 /*return*/];
|
|
23067
23519
|
return [4 /*yield*/, this.pageDataProvider.getPageComponentPropValues(pageComponent)];
|
|
23068
23520
|
case 1:
|
|
23069
|
-
pageComponentPropValue =
|
|
23521
|
+
pageComponentPropValue = _b.sent();
|
|
23070
23522
|
runInAction(function () {
|
|
23071
23523
|
var _a;
|
|
23072
23524
|
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValue);
|
|
@@ -23127,10 +23579,10 @@ var BridgeMessageType;
|
|
|
23127
23579
|
BridgeMessageType["UPDATE_PROP_VALUE"] = "UPDATE_PROP_VALUE";
|
|
23128
23580
|
BridgeMessageType["UPDATE_PAGE_PARAMS"] = "UPDATE_PAGE_PARAMS";
|
|
23129
23581
|
BridgeMessageType["UPDATE_PAGE_COMPONENT_ORDER"] = "UPDATE_PAGE_COMPONENT_ORDER";
|
|
23130
|
-
BridgeMessageType["
|
|
23582
|
+
BridgeMessageType["ADD_COMPONENT"] = "ADD_COMPONENT";
|
|
23131
23583
|
BridgeMessageType["DELETE_COMPONENT"] = "DELETE_COMPONENT";
|
|
23132
23584
|
BridgeMessageType["UPDATE_COMPONENT"] = "UPDATE_COMPONENT";
|
|
23133
|
-
BridgeMessageType["
|
|
23585
|
+
BridgeMessageType["ADD_PAGE_COMPONENT"] = "ADD_PAGE_COMPONENT";
|
|
23134
23586
|
BridgeMessageType["DELETE_PAGE_COMPONENT"] = "DELETE_PAGE_COMPONENT";
|
|
23135
23587
|
BridgeMessageType["COMPONENT_MOUSE_OVER"] = "COMPONENT_MOUSE_OVER";
|
|
23136
23588
|
BridgeMessageType["COMPONENT_MOUSE_LEAVE"] = "COMPONENT_MOUSE_LEAVE";
|
|
@@ -23148,10 +23600,10 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
23148
23600
|
useEffect(function () {
|
|
23149
23601
|
vm.setComponentRef(ref.current, pageComponent);
|
|
23150
23602
|
}, []);
|
|
23151
|
-
var
|
|
23603
|
+
var pageComponentPropValue = computed(function () {
|
|
23152
23604
|
return vm.pageDataProvider.pageComponentPropValues.find(function (pc) { return pc.pageComponent.id === pageComponent.id; });
|
|
23153
23605
|
});
|
|
23154
|
-
var propValues = (_b =
|
|
23606
|
+
var propValues = (_b = pageComponentPropValue.get()) === null || _b === void 0 ? void 0 : _b.propValues;
|
|
23155
23607
|
if (!propValues)
|
|
23156
23608
|
return null;
|
|
23157
23609
|
var Component = components[pageComponent.componentId];
|
|
@@ -23162,7 +23614,12 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
23162
23614
|
return vm.hoveredPageComponentId === pageComponent.id;
|
|
23163
23615
|
});
|
|
23164
23616
|
var hasNullValue = computed(function () {
|
|
23165
|
-
return Object.
|
|
23617
|
+
return Object.entries(propValues || {}).some(function (_a) {
|
|
23618
|
+
var _b, _c;
|
|
23619
|
+
var propName = _a[0], propValue = _a[1];
|
|
23620
|
+
return (propValue === null || propValue === undefined) && ((_c = (_b = pageComponentPropValue
|
|
23621
|
+
.get()) === null || _b === void 0 ? void 0 : _b.component.props.find(function (p) { return p.name === propName; })) === null || _c === void 0 ? void 0 : _c.isRequired);
|
|
23622
|
+
});
|
|
23166
23623
|
});
|
|
23167
23624
|
var onMouseEnter = function () {
|
|
23168
23625
|
vm.onMouseOver(pageComponent.id);
|
|
@@ -23705,4 +24162,4 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
23705
24162
|
return IkasBaseStore;
|
|
23706
24163
|
}());
|
|
23707
24164
|
|
|
23708
|
-
export { index$2 as AccountPage, addresses as AddressesPage, _id_$1 as CheckoutPage, _secondSlug_ as CustomPage, editor$1 as EditorPage, forgotPassword as ForgotPasswordPage, GTMAddToCart, GTMBeginCheckout, GTMBody, GTMCheckoutStep, GTMDisableHTML, GTMHead, GTMPageView, GTMProductView, GTMPurchase, GTMRemoveFromCart, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, 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, IkasProductAPI, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductList, IkasProductListFilter, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontAPI, IkasStorefrontConfig, IkasTheme, IkasThemeAPI, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, home as IndexPage, login as LoginPage, _id_$2 as OrderDetailPage, index$3 as OrdersPage, recoverPassword as RecoverPasswordPage, register as RegisterPage, index$1 as SlugPage, apollo, decodeBase64, formatMoney, pascalCase, stringToSlug, validatePhoneNumber };
|
|
24165
|
+
export { index$2 as AccountPage, addresses as AddressesPage, _id_$1 as CheckoutPage, _secondSlug_ as CustomPage, editor$1 as EditorPage, forgotPassword as ForgotPasswordPage, GTMAddToCart, GTMBeginCheckout, GTMBody, GTMCheckoutStep, GTMDisableHTML, GTMHead, GTMPageView, GTMProductView, GTMPurchase, GTMRemoveFromCart, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, 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, IkasProductAPI, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductList, IkasProductListFilter, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontAPI, IkasStorefrontConfig, IkasTheme, IkasThemeAPI, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, home as IndexPage, login as LoginPage, _id_$2 as OrderDetailPage, index$3 as OrdersPage, recoverPassword as RecoverPasswordPage, register as RegisterPage, index$1 as SlugPage, apollo, decodeBase64, formatMoney, pascalCase, stringToSlug, validatePhoneNumber };
|