@ikas/storefront 4.0.0-alpha.80 → 4.0.0-alpha.82

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.
@@ -15,11 +15,10 @@ export declare class IkasProductFilter implements IProductFilter {
15
15
  customValues?: string[] | null;
16
16
  settings?: IkasProductFilterSettings | null;
17
17
  private productList?;
18
- private _numberRange?;
18
+ numberRange?: IkasFilterRangeValue | null;
19
19
  numberRangeLimit?: IkasFilterRangeValue | null;
20
20
  numberRangeListOptions?: IkasProductFilterNumberRangeListOption[] | null;
21
21
  constructor(data: IProductFilter, productList?: IkasProductList | null);
22
- get numberRange(): IkasFilterRangeValue | null | undefined;
23
22
  get isCustomValueFilter(): boolean;
24
23
  get isStockFilter(): boolean;
25
24
  get valueList(): string[];
@@ -1 +1 @@
1
- import{__assign as t}from'./../../../../ext/tslib/tslib.es6.js';import{IkasImage as e}from"../../image/index.js";import{IkasProductFilterType as i,IkasProductFilterDisplayType as s,IkasProductFilterSortType as n}from"@ikas/storefront-models";export{IkasProductFilterDisplayType,IkasProductFilterSortType,IkasProductFilterType}from"@ikas/storefront-models";import{makeAutoObservable as o}from"mobx";import{IkasProductFilterFunctions as r}from"@ikas/storefront-model-functions";var l=function(){function e(e,n){var l=this;if(this.productList=null,this.onFilterValueClick=function(t){var e;r.onFilterValueClick(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.onNumberRangeClick=function(t){var e;r.onNumberRangeClick(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.onNumberRangeChange=function(t){var e;r.onNumberRangeChange(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.clear=function(){r.clear(l)},this.toInput=function(){return r.toInput(l)},this.applyQueryParam=function(t){r.applyQueryParam(l,t)},this.id=e.id||"",this.key=e.key||"",this.name=e.name||"",this.order=e.order||0,this.type=e.type||i.BRAND,this.displayType=e.displayType||s.BOX,this.isMultiSelect=e.isMultiSelect||!1,this.isFacetFilter=e.isFacetFilter||!1,this.values=e.values?e.values.map((function(t){return new u(t)})):null,this.customValues=e.customValues||null,this.settings=e.settings?new h(e.settings):null,this.displayType===s.NUMBER_RANGE_LIST&&this.customValues&&this.customValues.length&&(this.numberRangeListOptions=this.customValues.map((function(e){return new c(t(t({key:e},d(e)),{isSelected:!1}))}))),this.displayType===s.NUMBER_RANGE&&this.customValues&&this.customValues.length){var a=this.customValues[0];this.numberRangeLimit=d(a)}this.productList=n,o(this)}return Object.defineProperty(e.prototype,"numberRange",{get:function(){return this._numberRange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCustomValueFilter",{get:function(){return r.isCustomValueFilter(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStockFilter",{get:function(){return r.isStockFilter(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"valueList",{get:function(){return r.getValueList(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"keyList",{get:function(){return r.getKeyList(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayedValues",{get:function(){return r.getDisplayedValues(this)},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=t({},this);return delete e.productList,e},e}(),u=function(t){this.id=t.id||"",this.key=t.key||"",this.name=t.name||"",this.colorCode=t.colorCode||null,this.thumbnailImageId=t.thumbnailImageId||null,this.thumbnailImageId&&(this.thumbnailImage=new e({id:this.thumbnailImageId,isVideo:!1})),this.isSelected=t.isSelected||!1,this.resultCount=void 0!==t.resultCount&&null!==t.resultCount?t.resultCount:null,o(this)},a=function(t){this.id=t.id,this.type=t.type,this.displayType=t.displayType,this.valueList=t.valueList,o(this)},h=function(t){this.useAndFilter=t.useAndFilter||!1,this.showCollapsedOnDesktop=t.showCollapsedOnDesktop||!1,this.showCollapsedOnMobile=t.showCollapsedOnMobile||!1,this.sortType=t.sortType||n.ALPHABETICAL_ASC,this.customSortedValues=t.customSortedValues||null,o(this)},p=function(t){this.from=t.from||0,this.to=t.to||null,o(this)},c=function(){function e(t){this.from=t.from||0,this.to=t.to||null,this.key=t.key||"",this._isSelected=t.isSelected||!1,o(this)}return Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return t(t({},this),{isSelected:this._isSelected})},e}();function d(t){return r.parseRangeStr(t)}export{u as IkasApplicableProductFilterValue,p as IkasFilterRangeValue,l as IkasProductFilter,c as IkasProductFilterNumberRangeListOption,h as IkasProductFilterSettings,a as IkasProductFilterValue,d as parseRangeStr};
1
+ import{__assign as t}from'./../../../../ext/tslib/tslib.es6.js';import{IkasImage as e}from"../../image/index.js";import{IkasProductFilterType as i,IkasProductFilterDisplayType as s,IkasProductFilterSortType as o}from"@ikas/storefront-models";export{IkasProductFilterDisplayType,IkasProductFilterSortType,IkasProductFilterType}from"@ikas/storefront-models";import{makeAutoObservable as n}from"mobx";import{IkasProductFilterFunctions as r}from"@ikas/storefront-model-functions";var l=function(){function e(e,o){var l=this;if(this.productList=null,this.onFilterValueClick=function(t){var e;r.onFilterValueClick(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.onNumberRangeClick=function(t){var e;r.onNumberRangeClick(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.onNumberRangeChange=function(t){var e;r.onNumberRangeChange(l,t),null===(e=l.productList)||void 0===e||e.applyFilters()},this.clear=function(){r.clear(l)},this.toInput=function(){return r.toInput(l)},this.applyQueryParam=function(t){r.applyQueryParam(l,t)},this.id=e.id||"",this.key=e.key||"",this.name=e.name||"",this.order=e.order||0,this.type=e.type||i.BRAND,this.displayType=e.displayType||s.BOX,this.isMultiSelect=e.isMultiSelect||!1,this.isFacetFilter=e.isFacetFilter||!1,this.values=e.values?e.values.map((function(t){return new u(t)})):null,this.customValues=e.customValues||null,this.settings=e.settings?new h(e.settings):null,this.displayType===s.NUMBER_RANGE_LIST&&this.customValues&&this.customValues.length&&(this.numberRangeListOptions=this.customValues.map((function(e){return new c(t(t({key:e},d(e)),{isSelected:!1}))}))),this.displayType===s.NUMBER_RANGE&&this.customValues&&this.customValues.length){var a=this.customValues[0];this.numberRangeLimit=d(a)}this.productList=o,n(this)}return Object.defineProperty(e.prototype,"isCustomValueFilter",{get:function(){return r.isCustomValueFilter(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStockFilter",{get:function(){return r.isStockFilter(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"valueList",{get:function(){return r.getValueList(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"keyList",{get:function(){return r.getKeyList(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayedValues",{get:function(){return r.getDisplayedValues(this)},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=t({},this);return delete e.productList,e},e}(),u=function(t){this.id=t.id||"",this.key=t.key||"",this.name=t.name||"",this.colorCode=t.colorCode||null,this.thumbnailImageId=t.thumbnailImageId||null,this.thumbnailImageId&&(this.thumbnailImage=new e({id:this.thumbnailImageId,isVideo:!1})),this.isSelected=t.isSelected||!1,this.resultCount=void 0!==t.resultCount&&null!==t.resultCount?t.resultCount:null,n(this)},a=function(t){this.id=t.id,this.type=t.type,this.displayType=t.displayType,this.valueList=t.valueList,n(this)},h=function(t){this.useAndFilter=t.useAndFilter||!1,this.showCollapsedOnDesktop=t.showCollapsedOnDesktop||!1,this.showCollapsedOnMobile=t.showCollapsedOnMobile||!1,this.sortType=t.sortType||o.ALPHABETICAL_ASC,this.customSortedValues=t.customSortedValues||null,n(this)},p=function(t){this.from=t.from||0,this.to=t.to||null,n(this)},c=function(){function e(t){this.from=t.from||0,this.to=t.to||null,this.key=t.key||"",this._isSelected=t.isSelected||!1,n(this)}return Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return t(t({},this),{isSelected:this._isSelected})},e}();function d(t){return r.parseRangeStr(t)}export{u as IkasApplicableProductFilterValue,p as IkasFilterRangeValue,l as IkasProductFilter,c as IkasProductFilterNumberRangeListOption,h as IkasProductFilterSettings,a as IkasProductFilterValue,d as parseRangeStr};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../../../ext/tslib/tslib.es6.js';import{IkasProductOptionSelectType as e,IkasProductOptionType as n}from"@ikas/storefront-models";export{IkasProductOptionSelectType,IkasProductOptionType}from"@ikas/storefront-models";import{makeAutoObservable as l}from"mobx";import{IkasImage as s}from"../../../image/index.js";import o from"lodash/sortBy";import{IkasProductOptionFunctions as a}from"@ikas/storefront-model-functions";import{uploadFile as r,getProductOptionFileUrl as u}from"@ikas/storefront-api";var h=function(t){this.currencyCode=t.currencyCode,this.price=t.price,l(this)},d=function(t){void 0===t&&(t={}),this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=t.thumbnailImage?new s(t.thumbnailImage):null,l(this)},c=function(t){var i;void 0===t&&(t={}),this.type=t.type||e.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=o((null===(i=t.values)||void 0===i?void 0:i.map((function(t){return new d(t)})))||[],"order"),l(this)},m=function(t){this.min=t.min||null,this.max=t.max||null,this.minRelativeNextDate=void 0!==t.minRelativeNextDate?t.minRelativeNextDate:null,this.maxRelativeNextDate=void 0!==t.maxRelativeNextDate?t.maxRelativeNextDate:null,l(this)},p=function(t){void 0===t&&(t={}),this.min=null!==t.min&&void 0!==t.min?t.min:null,this.max=null!==t.max&&void 0!==t.max?t.max:null,l(this)},f=function(t){this.allowedExtensions=t.allowedExtensions||null,this.minQuantity=null!==t.minQuantity&&void 0!==t.minQuantity?t.minQuantity:null,this.maxQuantity=null!==t.maxQuantity&&void 0!==t.maxQuantity?t.maxQuantity:null,l(this)},v=function(){function e(s){var o=this;this._values=[],this._childOptions=[],this.productOptionFileUpload=function(e){return t(o,void 0,void 0,(function(){var t,n,l,s,o,a=this;return i(this,(function(i){switch(i.label){case 0:return 0===e.length||this.fileSettings&&this.fileSettings.maxQuantity&&this.fileSettings.maxQuantity<e.length?[2,[]]:[4,Promise.all(e.map((function(t){return u({fileName:t.name,productOptionSetId:a.productOptionSetId,productOptionId:a.id},t)})))];case 1:t=i.sent().filter((function(t){return t.data})),n=[],l=0,s=t,i.label=2;case 2:return l<s.length?(o=s[l],[4,r(o.data,o.data.file)]):[3,5];case 3:i.sent()&&n.push(o.data.optionUrl),i.label=4;case 4:return l++,[3,2];case 5:return[2,n]}}))}))},this.initValues=function(){o.isOptional||(o.values=[],o.childOptions&&o.childOptions.forEach((function(t){return t.initValues()})))},this.id=s.id||"",this.productOptionSetId=s.productOptionSetId||"",this.name=s.name||"",this.order=s.order||0,this.type=s.type||n.CHOICE,this.selectSettings=s.selectSettings?new c(s.selectSettings||{}):null,this.textSettings=s.textSettings?new p(s.textSettings||{}):null,this.fileSettings=s.fileSettings?new f(s.fileSettings||{}):null,this.dateSettings=s.dateSettings?new m(s.dateSettings||{}):null,this.price=s.price||null,this.otherPrices=s.otherPrices||null,this.isOptional=s.isOptional||!1,this.optionalText=s.optionalText||null,this.requiredOptionId=s.requiredOptionId||null,this.requiredOptionValueIds=s.requiredOptionValueIds||null,this.values=s.values||[],this.childOptions=s.childOptions?s.childOptions.map((function(t){return new e(t)})):[],l(this)}return Object.defineProperty(e.prototype,"displayedChildOptions",{get:function(){return a.getDisplayedChildOptions(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasValidValues",{get:function(){return a.hasValidValues(this)&&this.displayedChildOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(t){this._values=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childOptions",{get:function(){return this._childOptions},set:function(t){this._childOptions=t},enumerable:!1,configurable:!0}),e}();export{v as IkasProductOption,m as IkasProductOptionDateSettings,f as IkasProductOptionFileSettings,h as IkasProductOptionOtherPrice,c as IkasProductOptionSelectSettings,d as IkasProductOptionSelectValue,p as IkasProductOptionTextSettings};
1
+ import{__awaiter as t,__generator as i}from'./../../../../../ext/tslib/tslib.es6.js';import{IkasProductOptionSelectType as e,IkasProductOptionType as n}from"@ikas/storefront-models";export{IkasProductOptionSelectType,IkasProductOptionType}from"@ikas/storefront-models";import{makeAutoObservable as l}from"mobx";import{IkasImage as s}from"../../../image/index.js";import o from"lodash/sortBy";import{IkasProductOptionFunctions as a}from"@ikas/storefront-model-functions";import{uploadFile as r,getProductOptionFileUrl as u}from"@ikas/storefront-api";var h=function(t){this.currencyCode=t.currencyCode,this.price=t.price,l(this)},d=function(t){void 0===t&&(t={}),this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=t.thumbnailImage?new s(t.thumbnailImage):t.thumbnailImageId?new s({id:t.thumbnailImageId,isVideo:!1}):null,l(this)},c=function(t){var i;void 0===t&&(t={}),this.type=t.type||e.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=o((null===(i=t.values)||void 0===i?void 0:i.map((function(t){return new d(t)})))||[],"order"),l(this)},m=function(t){this.min=t.min||null,this.max=t.max||null,this.minRelativeNextDate=void 0!==t.minRelativeNextDate?t.minRelativeNextDate:null,this.maxRelativeNextDate=void 0!==t.maxRelativeNextDate?t.maxRelativeNextDate:null,l(this)},p=function(t){void 0===t&&(t={}),this.min=null!==t.min&&void 0!==t.min?t.min:null,this.max=null!==t.max&&void 0!==t.max?t.max:null,l(this)},f=function(t){this.allowedExtensions=t.allowedExtensions||null,this.minQuantity=null!==t.minQuantity&&void 0!==t.minQuantity?t.minQuantity:null,this.maxQuantity=null!==t.maxQuantity&&void 0!==t.maxQuantity?t.maxQuantity:null,l(this)},v=function(){function e(s){var o=this;this._values=[],this._childOptions=[],this.productOptionFileUpload=function(e){return t(o,void 0,void 0,(function(){var t,n,l,s,o,a=this;return i(this,(function(i){switch(i.label){case 0:return 0===e.length||this.fileSettings&&this.fileSettings.maxQuantity&&this.fileSettings.maxQuantity<e.length?[2,[]]:[4,Promise.all(e.map((function(t){return u({fileName:t.name,productOptionSetId:a.productOptionSetId,productOptionId:a.id},t)})))];case 1:t=i.sent().filter((function(t){return t.data})),n=[],l=0,s=t,i.label=2;case 2:return l<s.length?(o=s[l],[4,r(o.data,o.data.file)]):[3,5];case 3:i.sent()&&n.push(o.data.optionUrl),i.label=4;case 4:return l++,[3,2];case 5:return[2,n]}}))}))},this.initValues=function(){o.isOptional||(o.values=[],o.childOptions&&o.childOptions.forEach((function(t){return t.initValues()})))},this.id=s.id||"",this.productOptionSetId=s.productOptionSetId||"",this.name=s.name||"",this.order=s.order||0,this.type=s.type||n.CHOICE,this.selectSettings=s.selectSettings?new c(s.selectSettings||{}):null,this.textSettings=s.textSettings?new p(s.textSettings||{}):null,this.fileSettings=s.fileSettings?new f(s.fileSettings||{}):null,this.dateSettings=s.dateSettings?new m(s.dateSettings||{}):null,this.price=s.price||null,this.otherPrices=s.otherPrices||null,this.isOptional=s.isOptional||!1,this.optionalText=s.optionalText||null,this.requiredOptionId=s.requiredOptionId||null,this.requiredOptionValueIds=s.requiredOptionValueIds||null,this.values=s.values||[],this.childOptions=s.childOptions?s.childOptions.map((function(t){return new e(t)})):[],l(this)}return Object.defineProperty(e.prototype,"displayedChildOptions",{get:function(){return a.getDisplayedChildOptions(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasValidValues",{get:function(){return a.hasValidValues(this)&&this.displayedChildOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(t){this._values=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childOptions",{get:function(){return this._childOptions},set:function(t){this._childOptions=t},enumerable:!1,configurable:!0}),e}();export{v as IkasProductOption,m as IkasProductOptionDateSettings,f as IkasProductOptionFileSettings,h as IkasProductOptionOtherPrice,c as IkasProductOptionSelectSettings,d as IkasProductOptionSelectValue,p as IkasProductOptionTextSettings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.0.0-alpha.80",
3
+ "version": "4.0.0-alpha.82",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "Umut Ozan Yıldırım",
6
6
  "license": "ISC",
@@ -23,11 +23,11 @@
23
23
  "libphonenumber-js": "^1.10.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@ikas/storefront-api": "^4.0.0-alpha.80",
27
- "@ikas/storefront-config": "^4.0.0-alpha.80",
28
- "@ikas/storefront-model-functions": "^4.0.0-alpha.80",
29
- "@ikas/storefront-models": "^4.0.0-alpha.80",
30
- "@ikas/storefront-providers": "^4.0.0-alpha.80",
26
+ "@ikas/storefront-api": "^4.0.0-alpha.82",
27
+ "@ikas/storefront-config": "^4.0.0-alpha.82",
28
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.82",
29
+ "@ikas/storefront-models": "^4.0.0-alpha.82",
30
+ "@ikas/storefront-providers": "^4.0.0-alpha.82",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
32
32
  "@rollup/plugin-json": "^4.1.0",
33
33
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -53,11 +53,11 @@
53
53
  "query-string": "^6.13.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@ikas/storefront-api": "^4.0.0-alpha.80",
57
- "@ikas/storefront-config": "^4.0.0-alpha.80",
58
- "@ikas/storefront-model-functions": "^4.0.0-alpha.80",
59
- "@ikas/storefront-models": "^4.0.0-alpha.80",
60
- "@ikas/storefront-providers": "^4.0.0-alpha.80",
56
+ "@ikas/storefront-api": "^4.0.0-alpha.82",
57
+ "@ikas/storefront-config": "^4.0.0-alpha.82",
58
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.82",
59
+ "@ikas/storefront-models": "^4.0.0-alpha.82",
60
+ "@ikas/storefront-providers": "^4.0.0-alpha.82",
61
61
  "mobx": "^6.1.3",
62
62
  "mobx-react-lite": "^3.1.5",
63
63
  "next": "12.2.0",