@ikas/storefront 4.1.6 → 4.1.7

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.
@@ -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 d=function(t){this.currencyCode=t.currencyCode,this.price=t.price},h=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},m=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 h(t)})))||[],"order")},c=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},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},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},x=function(){function e(e){var s=this;this.childOptions=[],this.pValues=[],this.productOptionFileUpload=function(e){return t(s,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(){s.isOptional||(s.values=[],s.childOptions&&s.childOptions.forEach((function(t){return t.initValues()})))},this.id=e.id||"",this.productOptionSetId=e.productOptionSetId||"",this.name=e.name||"",this.order=e.order||0,this.type=e.type||n.CHOICE,this.selectSettings=e.selectSettings?new m(e.selectSettings||{}):null,this.textSettings=e.textSettings?new p(e.textSettings||{}):null,this.fileSettings=e.fileSettings?new f(e.fileSettings||{}):null,this.dateSettings=e.dateSettings?new c(e.dateSettings||{}):null,this.price=e.price||null,this.otherPrices=e.otherPrices||null,this.isOptional=e.isOptional||!1,this.optionalText=e.optionalText||null,this.requiredOptionId=e.requiredOptionId||null,this.requiredOptionValueIds=e.requiredOptionValueIds||null,this.values=e.values||[],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.pValues},set:function(t){this.pValues=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),e}();export{x as IkasProductOption,c as IkasProductOptionDateSettings,f as IkasProductOptionFileSettings,d as IkasProductOptionOtherPrice,m as IkasProductOptionSelectSettings,h 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 d=function(t){this.currencyCode=t.currencyCode,this.price=t.price},h=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},m=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 h(t)})))||[],"order")},c=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},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},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},v=function(){function e(e){var s=this;this.childOptions=[],this.pValues=[],this.productOptionFileUpload=function(e){return t(s,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(){s.isOptional||(s.values=[],s.childOptions&&s.childOptions.forEach((function(t){return t.initValues()})))},this.id=e.id||"",this.productOptionSetId=e.productOptionSetId||"",this.name=e.name||"",this.order=e.order||0,this.type=e.type||n.CHOICE,this.selectSettings=e.selectSettings?new m(e.selectSettings||{}):null,this.textSettings=e.textSettings?new p(e.textSettings||{}):null,this.fileSettings=e.fileSettings?new f(e.fileSettings||{}):null,this.dateSettings=e.dateSettings?new c(e.dateSettings||{}):null,this.price=e.price||null,this.otherPrices=e.otherPrices||null,this.isOptional=e.isOptional||!1,this.optionalText=e.optionalText||null,this.requiredOptionId=e.requiredOptionId||null,this.requiredOptionValueIds=e.requiredOptionValueIds||null,this.values=e.values||[],l(this)}return Object.defineProperty(e.prototype,"displayedChildOptions",{get:function(){var t=a.getDisplayedChildOptions(this);return t.map((function(t){return t.displayedChildOptions})),t},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.pValues},set:function(t){this.pValues=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),e}();export{v as IkasProductOption,c as IkasProductOptionDateSettings,f as IkasProductOptionFileSettings,d as IkasProductOptionOtherPrice,m as IkasProductOptionSelectSettings,h as IkasProductOptionSelectValue,p as IkasProductOptionTextSettings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {},
20
20
  "devDependencies": {
21
- "@ikas/storefront-api": "^4.1.6",
22
- "@ikas/storefront-config": "^4.1.6",
23
- "@ikas/storefront-model-functions": "^4.1.6",
24
- "@ikas/storefront-models": "^4.1.6",
25
- "@ikas/storefront-providers": "^4.1.6",
21
+ "@ikas/storefront-api": "^4.1.7",
22
+ "@ikas/storefront-config": "^4.1.7",
23
+ "@ikas/storefront-model-functions": "^4.1.7",
24
+ "@ikas/storefront-models": "^4.1.7",
25
+ "@ikas/storefront-providers": "^4.1.7",
26
26
  "@rollup/plugin-commonjs": "^22.0.0",
27
27
  "@rollup/plugin-json": "^4.1.0",
28
28
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -52,11 +52,11 @@
52
52
  "libphonenumber-js": "^1.10.6"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.1.6",
56
- "@ikas/storefront-config": "^4.1.6",
57
- "@ikas/storefront-model-functions": "^4.1.6",
58
- "@ikas/storefront-models": "^4.1.6",
59
- "@ikas/storefront-providers": "^4.1.6",
55
+ "@ikas/storefront-api": "^4.1.7",
56
+ "@ikas/storefront-config": "^4.1.7",
57
+ "@ikas/storefront-model-functions": "^4.1.7",
58
+ "@ikas/storefront-models": "^4.1.7",
59
+ "@ikas/storefront-providers": "^4.1.7",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",