@ikas/storefront 6.1.0-beta.101 → 6.1.0-beta.102

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{makeAutoObservable as t}from"mobx";import{formatCurrency as i}from"../../../../../../utils/currency.js";var e=function(){function e(i){void 0===i&&(i={});var e,r,n=this;this.product=null,this._initialQuantity=null,this.setProduct=function(t){t.variants=t.variants.filter((function(t){return n.filteredVariantIds.includes(t.id)})),n.product=t,n.product.selectedVariantValues=n.product.variants[0].variantValues,n.quantity=n._initialQuantity||0},this.setQuantity=function(t){var i;if(!(t<0)){var e=null===(i=n.product)||void 0===i?void 0:i.selectedVariant.stock;null!==n.minQuantity&&t<n.minQuantity?n.quantity=n.minQuantity:null!==n.maxQuantity&&t>n.maxQuantity?n.quantity=n.maxQuantity:n.quantity=e&&t>e?e:t}},this.id=i.id||"",this.addToBundleBasePrice=i.addToBundleBasePrice||null,this.discountRatio=i.discountRatio||null,this.filteredVariantIds=i.filteredVariantIds||[],this.maxQuantity=null!==(e=i.maxQuantity)&&void 0!==e?e:null,this.minQuantity=null!==(r=i.minQuantity)&&void 0!==r?r:null,this.order=i.order||0,this.productId=i.productId||"",this.quantity=i.quantity||0,this._initialQuantity=this.quantity,t(this)}return Object.defineProperty(e.prototype,"isQuantityEditable",{get:function(){return null!==this.maxQuantity||null!==this.minQuantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldDisplayPrice",{get:function(){return!0===this.addToBundleBasePrice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPrice",{get:function(){var t,i=(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.finalPrice)||0;return this.addToBundleBasePrice&&this.discountRatio&&(i-=i*(this.discountRatio/100)),i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPriceWithQuantity",{get:function(){return this.finalPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPrice",{get:function(){var t,e;return i(this.finalPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPriceWithQuantity",{get:function(){var t,e;return i(this.finalPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPrice",{get:function(){var t;return(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.sellPrice)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPriceWithQuantity",{get:function(){return this.sellPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPrice",{get:function(){var t,e;return i(this.sellPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPriceWithQuantity",{get:function(){var t,e;return i(this.sellPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),e}();export{e as IkasBundleProduct};
1
+ import{makeAutoObservable as t}from"mobx";import{formatCurrency as i}from"../../../../../../utils/currency.js";var e=function(){function e(i){void 0===i&&(i={});var e,r,n=this;this.product=null,this._initialQuantity=null,this.setProduct=function(t){t.variants=t.variants.filter((function(t){return n.filteredVariantIds.includes(t.id)})),n.product=t,n.product.selectedVariantValues=n.product.variants[0].variantValues,n.quantity=n._initialQuantity||0},this.setQuantity=function(t){var i;if(!(t<0)){var e=null===(i=n.product)||void 0===i?void 0:i.selectedVariant.stock;null!==n.minQuantity&&t<n.minQuantity?n.quantity=n.minQuantity:null!==n.maxQuantity&&t>n.maxQuantity?n.quantity=n.maxQuantity:e&&t>e&&null===n.maxQuantity?n.quantity=e:n.quantity=t}},this.id=i.id||"",this.addToBundleBasePrice=i.addToBundleBasePrice||null,this.discountRatio=i.discountRatio||null,this.filteredVariantIds=i.filteredVariantIds||[],this.maxQuantity=null!==(e=i.maxQuantity)&&void 0!==e?e:null,this.minQuantity=null!==(r=i.minQuantity)&&void 0!==r?r:null,this.order=i.order||0,this.productId=i.productId||"",this.quantity=i.quantity||0,this._initialQuantity=this.quantity,t(this)}return Object.defineProperty(e.prototype,"isQuantityEditable",{get:function(){return null!==this.maxQuantity||null!==this.minQuantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldDisplayPrice",{get:function(){return!0===this.addToBundleBasePrice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPrice",{get:function(){var t,i=(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.finalPrice)||0;return this.addToBundleBasePrice&&this.discountRatio&&(i-=i*(this.discountRatio/100)),i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPriceWithQuantity",{get:function(){return this.finalPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPrice",{get:function(){var t,e;return i(this.finalPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPriceWithQuantity",{get:function(){var t,e;return i(this.finalPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPrice",{get:function(){var t;return(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.sellPrice)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPriceWithQuantity",{get:function(){return this.sellPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPrice",{get:function(){var t,e;return i(this.sellPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPriceWithQuantity",{get:function(){var t,e;return i(this.sellPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),e}();export{e as IkasBundleProduct};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.101",
3
+ "version": "6.1.0-beta.102",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -21,11 +21,11 @@
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^6.1.0-beta.101",
25
- "@ikas/storefront-config": "^6.1.0-beta.101",
26
- "@ikas/storefront-model-functions": "^6.1.0-beta.101",
27
- "@ikas/storefront-models": "^6.1.0-beta.101",
28
- "@ikas/storefront-providers": "^6.1.0-beta.101",
24
+ "@ikas/storefront-api": "^6.1.0-beta.102",
25
+ "@ikas/storefront-config": "^6.1.0-beta.102",
26
+ "@ikas/storefront-model-functions": "^6.1.0-beta.102",
27
+ "@ikas/storefront-models": "^6.1.0-beta.102",
28
+ "@ikas/storefront-providers": "^6.1.0-beta.102",
29
29
  "@ikas/localized-address": "1.0.0-beta.6",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.6",
63
- "@ikas/storefront-api": "^6.1.0-beta.101",
64
- "@ikas/storefront-config": "^6.1.0-beta.101",
65
- "@ikas/storefront-model-functions": "^6.1.0-beta.101",
66
- "@ikas/storefront-models": "^6.1.0-beta.101",
67
- "@ikas/storefront-providers": "^6.1.0-beta.101",
63
+ "@ikas/storefront-api": "^6.1.0-beta.102",
64
+ "@ikas/storefront-config": "^6.1.0-beta.102",
65
+ "@ikas/storefront-model-functions": "^6.1.0-beta.102",
66
+ "@ikas/storefront-models": "^6.1.0-beta.102",
67
+ "@ikas/storefront-providers": "^6.1.0-beta.102",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",