@ikas/storefront 0.0.8 → 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/category/__generated__/listCategory.d.ts +1 -1
- package/build/api/product/__generated__/listProduct.d.ts +4 -5
- package/build/components/hoc/ThemeComponent.d.ts +2 -1
- package/build/components/page-editor/model.d.ts +2 -2
- package/build/index.es.js +527 -74
- package/build/index.js +526 -72
- package/build/models/data/product/attribute-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/ui/category-list/index.d.ts +58 -0
- package/build/models/ui/index.d.ts +1 -0
- package/build/utils/providers/page-data.d.ts +1 -0
- 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
|
@@ -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) {
|
|
@@ -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;
|
|
@@ -13108,57 +13244,6 @@ var IkasTransactionTypeEnum;
|
|
|
13108
13244
|
IkasTransactionTypeEnum["VOID"] = "VOID";
|
|
13109
13245
|
})(IkasTransactionTypeEnum || (IkasTransactionTypeEnum = {}));
|
|
13110
13246
|
|
|
13111
|
-
var IkasThemeComponentProp = /** @class */ (function () {
|
|
13112
|
-
function IkasThemeComponentProp(data) {
|
|
13113
|
-
this.name = data.name || "";
|
|
13114
|
-
this.displayName = data.displayName || "";
|
|
13115
|
-
this.type = data.type || IkasThemeComponentPropType.TEXT;
|
|
13116
|
-
makeAutoObservable(this);
|
|
13117
|
-
}
|
|
13118
|
-
return IkasThemeComponentProp;
|
|
13119
|
-
}());
|
|
13120
|
-
var IkasThemeComponentPropType;
|
|
13121
|
-
(function (IkasThemeComponentPropType) {
|
|
13122
|
-
IkasThemeComponentPropType["IMAGE"] = "IMAGE";
|
|
13123
|
-
IkasThemeComponentPropType["TEXT"] = "TEXT";
|
|
13124
|
-
IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
|
|
13125
|
-
IkasThemeComponentPropType["LINK"] = "LINK";
|
|
13126
|
-
IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
|
|
13127
|
-
IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
|
|
13128
|
-
IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
|
|
13129
|
-
IkasThemeComponentPropType["BRAND"] = "BRAND";
|
|
13130
|
-
IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
|
|
13131
|
-
IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
|
|
13132
|
-
IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
13133
|
-
// TODO number
|
|
13134
|
-
// TODO productAttribute
|
|
13135
|
-
})(IkasThemeComponentPropType || (IkasThemeComponentPropType = {}));
|
|
13136
|
-
|
|
13137
|
-
var IkasThemeComponent = /** @class */ (function () {
|
|
13138
|
-
function IkasThemeComponent(data) {
|
|
13139
|
-
this.id = data.id || "";
|
|
13140
|
-
this.dir = data.dir || "";
|
|
13141
|
-
this.displayName = data.displayName || "";
|
|
13142
|
-
this.props = data.props
|
|
13143
|
-
? data.props.map(function (p) { return new IkasThemeComponentProp(p); })
|
|
13144
|
-
: [];
|
|
13145
|
-
this.isHeader = data.isHeader || false;
|
|
13146
|
-
this.isFooter = data.isFooter || false;
|
|
13147
|
-
makeAutoObservable(this);
|
|
13148
|
-
}
|
|
13149
|
-
return IkasThemeComponent;
|
|
13150
|
-
}());
|
|
13151
|
-
|
|
13152
|
-
var IkasThemePageComponent = /** @class */ (function () {
|
|
13153
|
-
function IkasThemePageComponent(data) {
|
|
13154
|
-
this.id = data.id || "";
|
|
13155
|
-
this.componentId = data.componentId || "";
|
|
13156
|
-
this.propValues = data.propValues || {};
|
|
13157
|
-
makeAutoObservable(this);
|
|
13158
|
-
}
|
|
13159
|
-
return IkasThemePageComponent;
|
|
13160
|
-
}());
|
|
13161
|
-
|
|
13162
13247
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
13163
13248
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
13164
13249
|
// generators (like Math.random()).
|
|
@@ -13233,6 +13318,60 @@ function v4(options, buf, offset) {
|
|
|
13233
13318
|
return stringify(rnds);
|
|
13234
13319
|
}
|
|
13235
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
|
+
|
|
13236
13375
|
var IkasThemePage = /** @class */ (function () {
|
|
13237
13376
|
function IkasThemePage(data) {
|
|
13238
13377
|
this.id = data.id || v4();
|
|
@@ -13625,6 +13764,276 @@ var IkasBrandListPropValue = /** @class */ (function () {
|
|
|
13625
13764
|
return IkasBrandListPropValue;
|
|
13626
13765
|
}());
|
|
13627
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
|
+
|
|
13628
14037
|
var IkasProductDetail = /** @class */ (function () {
|
|
13629
14038
|
function IkasProductDetail(product, selectedVariantValues, usePageData, router) {
|
|
13630
14039
|
this.usePageData = null;
|
|
@@ -14105,6 +14514,35 @@ var IkasProductDetailPropValue = /** @class */ (function () {
|
|
|
14105
14514
|
return IkasProductDetailPropValue;
|
|
14106
14515
|
}());
|
|
14107
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
|
+
|
|
14108
14546
|
var IkasBrandAPI = /** @class */ (function () {
|
|
14109
14547
|
function IkasBrandAPI() {
|
|
14110
14548
|
}
|
|
@@ -14264,7 +14702,7 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
14264
14702
|
return __generator(this, function (_b) {
|
|
14265
14703
|
switch (_b.label) {
|
|
14266
14704
|
case 0:
|
|
14267
|
-
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 "])));
|
|
14268
14706
|
_b.label = 1;
|
|
14269
14707
|
case 1:
|
|
14270
14708
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -14273,9 +14711,11 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
14273
14711
|
.query({
|
|
14274
14712
|
query: LIST_QUERY,
|
|
14275
14713
|
variables: {
|
|
14276
|
-
id:
|
|
14277
|
-
|
|
14278
|
-
|
|
14714
|
+
id: (params === null || params === void 0 ? void 0 : params.idList) && params.idList.length
|
|
14715
|
+
? {
|
|
14716
|
+
in: params.idList,
|
|
14717
|
+
}
|
|
14718
|
+
: undefined,
|
|
14279
14719
|
paginationInput: (params === null || params === void 0 ? void 0 : params.page) ? {
|
|
14280
14720
|
page: params.page,
|
|
14281
14721
|
limit: params.limit || 10,
|
|
@@ -18856,7 +19296,7 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
18856
19296
|
return __generator(this, function (_b) {
|
|
18857
19297
|
switch (_b.label) {
|
|
18858
19298
|
case 0:
|
|
18859
|
-
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 "])));
|
|
18860
19300
|
_b.label = 1;
|
|
18861
19301
|
case 1:
|
|
18862
19302
|
_b.trys.push([1, 8, , 9]);
|
|
@@ -22784,10 +23224,15 @@ var style = {
|
|
|
22784
23224
|
};
|
|
22785
23225
|
|
|
22786
23226
|
var ThemeComponent = observer(function (_a) {
|
|
22787
|
-
var
|
|
23227
|
+
var pageComponentPropValue = _a.pageComponentPropValue, pageComponent = _a.pageComponent, index = _a.index;
|
|
22788
23228
|
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
23229
|
+
var propValues = pageComponentPropValue.propValues;
|
|
22789
23230
|
var hasNullValue = computed(function () {
|
|
22790
|
-
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
|
+
});
|
|
22791
23236
|
});
|
|
22792
23237
|
var Component = components[pageComponent.componentId];
|
|
22793
23238
|
return (createElement("div", { id: index + "" }, hasNullValue.get() ? (createElement(ErrorComponent, null)) : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { store: store })))));
|
|
@@ -22798,7 +23243,7 @@ var IkasPage = observer(function (_a) {
|
|
|
22798
23243
|
var propValues = _a.propValues, page = _a.page;
|
|
22799
23244
|
var renderComponent = function (pageComponent, index) {
|
|
22800
23245
|
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
22801
|
-
return (createElement(ThemeComponent, { key: pageComponent.id, index: index,
|
|
23246
|
+
return (createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent }));
|
|
22802
23247
|
};
|
|
22803
23248
|
var headerComponent = (_b = propValues.find(function (pv) { return pv.component.isHeader; })) === null || _b === void 0 ? void 0 : _b.pageComponent;
|
|
22804
23249
|
var footerComponent = (_c = propValues.find(function (pv) { return pv.component.isFooter; })) === null || _c === void 0 ? void 0 : _c.pageComponent;
|
|
@@ -22854,10 +23299,10 @@ var PageViewModel = /** @class */ (function () {
|
|
|
22854
23299
|
case BridgeMessageType.UPDATE_PROP_VALUE: return [3 /*break*/, 3];
|
|
22855
23300
|
case BridgeMessageType.UPDATE_PAGE_PARAMS: return [3 /*break*/, 5];
|
|
22856
23301
|
case BridgeMessageType.UPDATE_PAGE_COMPONENT_ORDER: return [3 /*break*/, 7];
|
|
22857
|
-
case BridgeMessageType.
|
|
23302
|
+
case BridgeMessageType.ADD_COMPONENT: return [3 /*break*/, 9];
|
|
22858
23303
|
case BridgeMessageType.DELETE_COMPONENT: return [3 /*break*/, 10];
|
|
22859
23304
|
case BridgeMessageType.UPDATE_COMPONENT: return [3 /*break*/, 11];
|
|
22860
|
-
case BridgeMessageType.
|
|
23305
|
+
case BridgeMessageType.ADD_PAGE_COMPONENT: return [3 /*break*/, 12];
|
|
22861
23306
|
case BridgeMessageType.DELETE_PAGE_COMPONENT: return [3 /*break*/, 14];
|
|
22862
23307
|
case BridgeMessageType.SET_SELECTED_COMPONENT: return [3 /*break*/, 15];
|
|
22863
23308
|
case BridgeMessageType.SET_HOVERED_COMPONENT: return [3 /*break*/, 16];
|
|
@@ -23064,13 +23509,16 @@ var PageViewModel = /** @class */ (function () {
|
|
|
23064
23509
|
this.handleAddNewPageComponent = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
23065
23510
|
var pageComponent, pageComponentPropValue;
|
|
23066
23511
|
var _this = this;
|
|
23067
|
-
|
|
23068
|
-
|
|
23512
|
+
var _a;
|
|
23513
|
+
return __generator(this, function (_b) {
|
|
23514
|
+
switch (_b.label) {
|
|
23069
23515
|
case 0:
|
|
23070
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*/];
|
|
23071
23519
|
return [4 /*yield*/, this.pageDataProvider.getPageComponentPropValues(pageComponent)];
|
|
23072
23520
|
case 1:
|
|
23073
|
-
pageComponentPropValue =
|
|
23521
|
+
pageComponentPropValue = _b.sent();
|
|
23074
23522
|
runInAction(function () {
|
|
23075
23523
|
var _a;
|
|
23076
23524
|
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValue);
|
|
@@ -23131,10 +23579,10 @@ var BridgeMessageType;
|
|
|
23131
23579
|
BridgeMessageType["UPDATE_PROP_VALUE"] = "UPDATE_PROP_VALUE";
|
|
23132
23580
|
BridgeMessageType["UPDATE_PAGE_PARAMS"] = "UPDATE_PAGE_PARAMS";
|
|
23133
23581
|
BridgeMessageType["UPDATE_PAGE_COMPONENT_ORDER"] = "UPDATE_PAGE_COMPONENT_ORDER";
|
|
23134
|
-
BridgeMessageType["
|
|
23582
|
+
BridgeMessageType["ADD_COMPONENT"] = "ADD_COMPONENT";
|
|
23135
23583
|
BridgeMessageType["DELETE_COMPONENT"] = "DELETE_COMPONENT";
|
|
23136
23584
|
BridgeMessageType["UPDATE_COMPONENT"] = "UPDATE_COMPONENT";
|
|
23137
|
-
BridgeMessageType["
|
|
23585
|
+
BridgeMessageType["ADD_PAGE_COMPONENT"] = "ADD_PAGE_COMPONENT";
|
|
23138
23586
|
BridgeMessageType["DELETE_PAGE_COMPONENT"] = "DELETE_PAGE_COMPONENT";
|
|
23139
23587
|
BridgeMessageType["COMPONENT_MOUSE_OVER"] = "COMPONENT_MOUSE_OVER";
|
|
23140
23588
|
BridgeMessageType["COMPONENT_MOUSE_LEAVE"] = "COMPONENT_MOUSE_LEAVE";
|
|
@@ -23152,10 +23600,10 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
23152
23600
|
useEffect(function () {
|
|
23153
23601
|
vm.setComponentRef(ref.current, pageComponent);
|
|
23154
23602
|
}, []);
|
|
23155
|
-
var
|
|
23603
|
+
var pageComponentPropValue = computed(function () {
|
|
23156
23604
|
return vm.pageDataProvider.pageComponentPropValues.find(function (pc) { return pc.pageComponent.id === pageComponent.id; });
|
|
23157
23605
|
});
|
|
23158
|
-
var propValues = (_b =
|
|
23606
|
+
var propValues = (_b = pageComponentPropValue.get()) === null || _b === void 0 ? void 0 : _b.propValues;
|
|
23159
23607
|
if (!propValues)
|
|
23160
23608
|
return null;
|
|
23161
23609
|
var Component = components[pageComponent.componentId];
|
|
@@ -23166,7 +23614,12 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
23166
23614
|
return vm.hoveredPageComponentId === pageComponent.id;
|
|
23167
23615
|
});
|
|
23168
23616
|
var hasNullValue = computed(function () {
|
|
23169
|
-
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
|
+
});
|
|
23170
23623
|
});
|
|
23171
23624
|
var onMouseEnter = function () {
|
|
23172
23625
|
vm.onMouseOver(pageComponent.id);
|
|
@@ -23709,4 +24162,4 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
23709
24162
|
return IkasBaseStore;
|
|
23710
24163
|
}());
|
|
23711
24164
|
|
|
23712
|
-
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 };
|