@ikas/storefront 0.0.71 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -20028,7 +20028,7 @@ var IkasProductList = /** @class */ (function () {
20028
20028
  Object.defineProperty(IkasProductList.prototype, "isFiltered", {
20029
20029
  get: function () {
20030
20030
  var _a;
20031
- return (_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; });
20031
+ return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) || !!this._searchKeyword);
20032
20032
  },
20033
20033
  enumerable: false,
20034
20034
  configurable: true
@@ -20089,6 +20089,8 @@ var IkasProductList = /** @class */ (function () {
20089
20089
  (_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
20090
20090
  queryParams[f.key] = f.keyList;
20091
20091
  });
20092
+ if (this._searchKeyword)
20093
+ queryParams.s = this._searchKeyword;
20092
20094
  return queryString.stringify(queryParams, { arrayFormat: "comma" });
20093
20095
  },
20094
20096
  enumerable: false,
@@ -28270,7 +28272,15 @@ var favoriteProducts = /*#__PURE__*/Object.freeze({
28270
28272
  var Page$e = function (_a) {
28271
28273
  var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
28272
28274
  var router = useRouter();
28273
- var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router);
28275
+ var _b = useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
28276
+ var initialPropValues = useMemo(function () { return IkasPageDataProvider.initPropValues(propValuesStr, router); }, [propValuesStr]);
28277
+ var _c = useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
28278
+ useEffect(function () {
28279
+ setIsBrowser(typeof window !== "undefined");
28280
+ }, []);
28281
+ useEffect(function () {
28282
+ setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, isBrowser));
28283
+ }, [isBrowser, propValuesStr]);
28274
28284
  return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
28275
28285
  };
28276
28286
  var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
package/build/index.js CHANGED
@@ -20011,7 +20011,7 @@ var IkasProductList = /** @class */ (function () {
20011
20011
  Object.defineProperty(IkasProductList.prototype, "isFiltered", {
20012
20012
  get: function () {
20013
20013
  var _a;
20014
- return (_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; });
20014
+ return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) || !!this._searchKeyword);
20015
20015
  },
20016
20016
  enumerable: false,
20017
20017
  configurable: true
@@ -20072,6 +20072,8 @@ var IkasProductList = /** @class */ (function () {
20072
20072
  (_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
20073
20073
  queryParams[f.key] = f.keyList;
20074
20074
  });
20075
+ if (this._searchKeyword)
20076
+ queryParams.s = this._searchKeyword;
20075
20077
  return queryString.stringify(queryParams, { arrayFormat: "comma" });
20076
20078
  },
20077
20079
  enumerable: false,
@@ -28250,7 +28252,15 @@ var favoriteProducts = /*#__PURE__*/Object.freeze({
28250
28252
  var Page$e = function (_a) {
28251
28253
  var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
28252
28254
  var router$1 = router.useRouter();
28253
- var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
28255
+ var _b = React.useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
28256
+ var initialPropValues = React.useMemo(function () { return IkasPageDataProvider.initPropValues(propValuesStr, router$1); }, [propValuesStr]);
28257
+ var _c = React.useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
28258
+ React.useEffect(function () {
28259
+ setIsBrowser(typeof window !== "undefined");
28260
+ }, []);
28261
+ React.useEffect(function () {
28262
+ setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, isBrowser));
28263
+ }, [isBrowser, propValuesStr]);
28254
28264
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
28255
28265
  };
28256
28266
  var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -31,7 +31,7 @@ export declare class IkasProductList {
31
31
  set searchKeyword(value: string);
32
32
  get isInitialized(): boolean;
33
33
  get isFilterable(): boolean;
34
- get isFiltered(): boolean | undefined;
34
+ get isFiltered(): boolean;
35
35
  get isStatic(): boolean;
36
36
  get isDiscounted(): boolean;
37
37
  get isRecommended(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",