@ikas/storefront 2.0.63 → 2.0.64-alpha.1

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{IkasCategory as e}from"../category/index.js";import{IkasProductVariant as r}from"./variant/index.js";import{IkasProductAttributeValue as i}from"./attribute-value/index.js";import{IkasProductVariantType as n}from"./variant-type/index.js";import{IkasBrand as o}from"../brand/index.js";import{IkasHTMLMetaData as a}from"../html-meta-data/index.js";import{IkasProductTag as s}from"../product-tag/index.js";import{IkasProductOptionSet as p}from"../product-option-set/index.js";var c,u=function(){function u(u){void 0===u&&(u={}),this.id=u.id||Date.now()+"",this.name=u.name||"",this.type=u.type||c.PHYSICAL,this.description=u.description||"",this.shortDescription=u.shortDescription||"",this.metaData=u.metaData?new a(u.metaData):void 0,this.brand=u.brand?new o(u.brand):null,this.categories=u.categories?u.categories.map((function(t){return new e(t)})):[],this.tags=u.tags?u.tags.map((function(t){return new s(t)})):[],this.variants=u.variants?u.variants.map((function(t){return new r(t)})):[],this.attributes=u.attributes?u.attributes.map((function(t){return new i(t)})):[],this.variantTypes=u.variantTypes?u.variantTypes.map((function(t){return new n(t)})):[],this.productOptionSetId=u.productOptionSetId||null,this.productOptionSet=u.productOptionSet?new p(u.productOptionSet):null,this.setOptionPrices(),t(this)}return Object.defineProperty(u.prototype,"hasVariant",{get:function(){return!!this.variantTypes.length},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"hasStock",{get:function(){return this.variants.some((function(t){return t.stock>0}))},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"mainVariantType",{get:function(){if(this.hasVariant)return this.variantTypes[0].variantType},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"href",{get:function(){var t;return(null===(t=this.metaData)||void 0===t?void 0:t.slug)?"/".concat(this.metaData.slug):""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"canAddToCart",{get:function(){return!this.productOptionSetId||!!this.productOptionSet&&this.productOptionSet.displayedOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),u.prototype.setOptionPrices=function(){var t,e=this.variants[0];if(e){var r=e.price.currency;null===(t=this.productOptionSet)||void 0===t||t.options.forEach((function(t){var e;t.selectSettings&&t.selectSettings.values.forEach((function(t){var e;t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===r})))||void 0===e?void 0:e.price)||t.price)})),t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===r})))||void 0===e?void 0:e.price)||t.price)}))}},u}();!function(t){t.PHYSICAL="PHYSICAL",t.DIGITAL="DIGITAL",t.MEMBERSHIP="MEMBERSHIP"}(c||(c={}));export{u as IkasProduct,c as IkasProductType};
1
+ import{makeAutoObservable as t}from"mobx";import{IkasCategory as e}from"../category/index.js";import{IkasProductVariant as r}from"./variant/index.js";import{IkasProductAttributeValue as i}from"./attribute-value/index.js";import{IkasProductVariantType as n}from"./variant-type/index.js";import{IkasBrand as o}from"../brand/index.js";import{IkasHTMLMetaData as a}from"../html-meta-data/index.js";import{IkasProductTag as s}from"../product-tag/index.js";import{IkasProductOptionSet as p}from"../product-option-set/index.js";import c from'../../../ext/lodash/sortBy.js';var u,d=function(){function d(d){void 0===d&&(d={}),this.id=d.id||Date.now()+"",this.name=d.name||"",this.type=d.type||u.PHYSICAL,this.description=d.description||"",this.shortDescription=d.shortDescription||"",this.metaData=d.metaData?new a(d.metaData):void 0,this.brand=d.brand?new o(d.brand):null,this.categories=d.categories?d.categories.map((function(t){return new e(t)})):[],this.tags=d.tags?d.tags.map((function(t){return new s(t)})):[],this.variants=d.variants?d.variants.map((function(t){return new r(t)})):[],this.attributes=d.attributes?d.attributes.map((function(t){return new i(t)})):[],this.variantTypes=d.variantTypes?d.variantTypes.map((function(t){return new n(t)})):[],this.productOptionSetId=d.productOptionSetId||null,this.productOptionSet=d.productOptionSet?new p(d.productOptionSet):null,this.variantTypes=c(this.variantTypes,"order"),this.setOptionPrices(),t(this)}return Object.defineProperty(d.prototype,"hasVariant",{get:function(){return!!this.variantTypes.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasStock",{get:function(){return this.variants.some((function(t){return t.stock>0}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"mainVariantType",{get:function(){if(this.hasVariant)return this.variantTypes[0].variantType},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"href",{get:function(){var t;return(null===(t=this.metaData)||void 0===t?void 0:t.slug)?"/".concat(this.metaData.slug):""},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"canAddToCart",{get:function(){return!this.productOptionSetId||!!this.productOptionSet&&this.productOptionSet.displayedOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),d.prototype.setOptionPrices=function(){var t,e=this.variants[0];if(e){var r=e.price.currency;null===(t=this.productOptionSet)||void 0===t||t.options.forEach((function(t){var e;t.selectSettings&&t.selectSettings.values.forEach((function(t){var e;t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===r})))||void 0===e?void 0:e.price)||t.price)})),t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===r})))||void 0===e?void 0:e.price)||t.price)}))}},d}();!function(t){t.PHYSICAL="PHYSICAL",t.DIGITAL="DIGITAL",t.MEMBERSHIP="MEMBERSHIP"}(u||(u={}));export{d as IkasProduct,u as IkasProductType};
@@ -1,5 +1,6 @@
1
1
  import { IkasVariantType } from "../../variant-type";
2
2
  export declare class IkasProductVariantType {
3
+ order: number;
3
4
  variantType: IkasVariantType;
4
5
  variantValueIds: string[];
5
6
  constructor(data: Partial<IkasProductVariantType>);
@@ -1 +1 @@
1
- import{makeAutoObservable as a}from"mobx";import{IkasVariantType as i}from"../../variant-type/index.js";var t=function(t){var r=this;this.variantType=t.variantType?new i(t.variantType):new i,this.variantValueIds=t.variantValueIds||[];var n=[];this.variantValueIds.forEach((function(a){var i=r.variantType.values.find((function(i){return i.id===a}));i&&n.push(i)})),this.variantType.values=n,a(this)};export{t as IkasProductVariantType};
1
+ import{makeAutoObservable as a}from"mobx";import{IkasVariantType as r}from"../../variant-type/index.js";var i=function(i){var t=this;this.order=i.order||0,this.variantType=i.variantType?new r(i.variantType):new r,this.variantValueIds=i.variantValueIds||[];var n=[];this.variantValueIds.forEach((function(a){var r=t.variantType.values.find((function(r){return r.id===a}));r&&n.push(r)})),this.variantType.values=n,a(this)};export{i as IkasProductVariantType};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "2.0.63",
3
+ "version": "2.0.64-alpha.1",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.js",
6
6
  "author": "Umut Ozan Yıldırım",