@ikas/storefront-providers 4.0.0-alpha.7 → 4.0.0-alpha.71
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/ext/tslib/tslib.es6.js +1 -0
- package/{src/index.ts → build/index.d.ts} +20 -22
- package/build/index.js +1 -0
- package/build/models/prop-value/attribute-list.d.ts +6 -0
- package/build/models/prop-value/attribute.d.ts +6 -0
- package/build/models/prop-value/blog-category-list.d.ts +6 -0
- package/build/models/prop-value/blog-category.d.ts +4 -0
- package/build/models/prop-value/blog-list.d.ts +8 -0
- package/build/models/prop-value/blog.d.ts +4 -0
- package/build/models/prop-value/brand-list.d.ts +8 -0
- package/build/models/prop-value/brand.d.ts +4 -0
- package/build/models/prop-value/brand.js +1 -0
- package/build/models/prop-value/category-list.d.ts +8 -0
- package/build/models/prop-value/category.d.ts +4 -0
- package/build/models/prop-value/link.d.ts +18 -0
- package/build/models/prop-value/link.js +1 -0
- package/build/models/prop-value/product-list.d.ts +17 -0
- package/build/models/prop-value/product.d.ts +5 -0
- package/build/models/prop-value/raffle-list.d.ts +4 -0
- package/build/models/prop-value/raffle.d.ts +4 -0
- package/build/models/ui/blog-category-list/index.d.ts +17 -0
- package/build/models/ui/blog-category-list/index.js +1 -0
- package/build/models/ui/blog-category-list/init.d.ts +2 -0
- package/build/models/ui/blog-category-list/init.js +1 -0
- package/build/models/ui/blog-list/index.d.ts +19 -0
- package/build/models/ui/blog-list/index.js +1 -0
- package/build/models/ui/blog-list/init.d.ts +2 -0
- package/build/models/ui/blog-list/init.js +1 -0
- package/build/models/ui/brand-list/index.d.ts +22 -0
- package/build/models/ui/brand-list/index.js +1 -0
- package/build/models/ui/brand-list/init.d.ts +2 -0
- package/build/models/ui/brand-list/init.js +1 -0
- package/build/models/ui/category-list/index.d.ts +22 -0
- package/build/models/ui/category-list/index.js +1 -0
- package/build/models/ui/category-list/init.d.ts +2 -0
- package/build/models/ui/category-list/init.js +1 -0
- package/build/models/ui/component-renderer/index.d.ts +6 -0
- package/build/models/ui/customer-review-list/index.d.ts +11 -0
- package/build/models/ui/customer-review-list/init.d.ts +2 -0
- package/build/models/ui/customer-review-summary-list/index.d.ts +11 -0
- package/build/models/ui/customer-review-summary-list/init.d.ts +2 -0
- package/{src/models/ui/index.ts → build/models/ui/index.d.ts} +12 -12
- package/build/models/ui/navigation-link/index.d.ts +7 -0
- package/build/models/ui/product-attribute-detail/index.d.ts +6 -0
- package/build/models/ui/product-attribute-list/index.d.ts +6 -0
- package/build/models/ui/product-list/index.d.ts +64 -0
- package/build/models/ui/product-list/index.js +1 -0
- package/build/models/ui/product-list/init.d.ts +2 -0
- package/build/models/ui/product-list/init.js +1 -0
- package/build/models/ui/raffle-list/index.d.ts +16 -0
- package/build/models/ui/raffle-list/init.d.ts +2 -0
- package/build/models/ui/raffle-list/init.js +1 -0
- package/build/providers/helpers/raffle.d.ts +2 -0
- package/build/providers/helpers/raffle.js +1 -0
- package/build/providers/page-data-get.d.ts +31 -0
- package/build/providers/page-data-get.js +1 -0
- package/build/providers/placeholders.d.ts +7 -0
- package/build/providers/placeholders.js +1 -0
- package/build/providers/prop-value/attribute-list.d.ts +8 -0
- package/build/providers/prop-value/attribute-list.js +1 -0
- package/build/providers/prop-value/attribute.d.ts +8 -0
- package/build/providers/prop-value/attribute.js +1 -0
- package/build/providers/prop-value/blog-category-list.d.ts +8 -0
- package/build/providers/prop-value/blog-category-list.js +1 -0
- package/build/providers/prop-value/blog-category.d.ts +8 -0
- package/build/providers/prop-value/blog-category.js +1 -0
- package/build/providers/prop-value/blog-list.d.ts +11 -0
- package/build/providers/prop-value/blog-list.js +1 -0
- package/build/providers/prop-value/blog.d.ts +8 -0
- package/build/providers/prop-value/blog.js +1 -0
- package/build/providers/prop-value/boolean.d.ts +6 -0
- package/build/providers/prop-value/boolean.js +1 -0
- package/build/providers/prop-value/brand-list.d.ts +8 -0
- package/build/providers/prop-value/brand-list.js +1 -0
- package/build/providers/prop-value/brand.d.ts +8 -0
- package/build/providers/prop-value/brand.js +1 -0
- package/build/providers/prop-value/category-list.d.ts +8 -0
- package/build/providers/prop-value/category-list.js +1 -0
- package/build/providers/prop-value/category.d.ts +8 -0
- package/build/providers/prop-value/category.js +1 -0
- package/build/providers/prop-value/color.d.ts +6 -0
- package/build/providers/prop-value/color.js +1 -0
- package/build/providers/prop-value/custom.d.ts +42 -0
- package/build/providers/prop-value/custom.js +1 -0
- package/build/providers/prop-value/image-list.d.ts +7 -0
- package/build/providers/prop-value/image-list.js +1 -0
- package/build/providers/prop-value/image.d.ts +7 -0
- package/build/providers/prop-value/image.js +1 -0
- package/{src/providers/prop-value/index.ts → build/providers/prop-value/index.d.ts} +3 -3
- package/build/providers/prop-value/link.d.ts +26 -0
- package/build/providers/prop-value/link.js +1 -0
- package/build/providers/prop-value/product-detail.d.ts +8 -0
- package/build/providers/prop-value/product-detail.js +1 -0
- package/build/providers/prop-value/product-list.d.ts +17 -0
- package/build/providers/prop-value/product-list.js +1 -0
- package/build/providers/prop-value/raffle-list.d.ts +5 -0
- package/build/providers/prop-value/raffle-list.js +1 -0
- package/build/providers/prop-value/raffle.d.ts +8 -0
- package/build/providers/prop-value/raffle.js +1 -0
- package/build/providers/prop-value/rich-text.d.ts +6 -0
- package/build/providers/prop-value/rich-text.js +1 -0
- package/build/providers/prop-value/slider.d.ts +7 -0
- package/build/providers/prop-value/slider.js +1 -0
- package/build/providers/prop-value/text.d.ts +6 -0
- package/build/providers/prop-value/text.js +1 -0
- package/build/providers/types.d.ts +66 -0
- package/build/providers/types.js +1 -0
- package/package.json +13 -12
- package/src/models/prop-value/attribute-list.ts +0 -8
- package/src/models/prop-value/attribute.ts +0 -8
- package/src/models/prop-value/blog-category-list.ts +0 -9
- package/src/models/prop-value/blog-category.ts +0 -6
- package/src/models/prop-value/blog-list.ts +0 -13
- package/src/models/prop-value/blog.ts +0 -6
- package/src/models/prop-value/brand-list.ts +0 -11
- package/src/models/prop-value/brand.ts +0 -6
- package/src/models/prop-value/category-list.ts +0 -11
- package/src/models/prop-value/category.ts +0 -6
- package/src/models/prop-value/link.ts +0 -22
- package/src/models/prop-value/product-list.ts +0 -29
- package/src/models/prop-value/product.ts +0 -7
- package/src/models/prop-value/raffle-list.ts +0 -6
- package/src/models/prop-value/raffle.ts +0 -6
- package/src/models/ui/blog-category-list/index.ts +0 -19
- package/src/models/ui/blog-category-list/init.ts +0 -54
- package/src/models/ui/blog-list/index.ts +0 -21
- package/src/models/ui/blog-list/init.ts +0 -49
- package/src/models/ui/brand-list/index.ts +0 -25
- package/src/models/ui/brand-list/init.ts +0 -47
- package/src/models/ui/category-list/index.ts +0 -25
- package/src/models/ui/category-list/init.ts +0 -50
- package/src/models/ui/component-renderer/index.ts +0 -5
- package/src/models/ui/customer-review-list/index.ts +0 -12
- package/src/models/ui/customer-review-list/init.ts +0 -33
- package/src/models/ui/customer-review-summary-list/index.ts +0 -12
- package/src/models/ui/customer-review-summary-list/init.ts +0 -33
- package/src/models/ui/navigation-link/index.ts +0 -7
- package/src/models/ui/product-attribute-detail/index.ts +0 -7
- package/src/models/ui/product-attribute-list/index.ts +0 -7
- package/src/models/ui/product-list/index.ts +0 -80
- package/src/models/ui/product-list/init.ts +0 -407
- package/src/models/ui/raffle-list/index.ts +0 -17
- package/src/models/ui/raffle-list/init.ts +0 -44
- package/src/providers/helpers/raffle.ts +0 -69
- package/src/providers/page-data-get.ts +0 -708
- package/src/providers/placeholders.ts +0 -138
- package/src/providers/prop-value/attribute-list.ts +0 -75
- package/src/providers/prop-value/attribute.ts +0 -77
- package/src/providers/prop-value/blog-category-list.ts +0 -29
- package/src/providers/prop-value/blog-category.ts +0 -49
- package/src/providers/prop-value/blog-list.ts +0 -61
- package/src/providers/prop-value/blog.ts +0 -41
- package/src/providers/prop-value/boolean.ts +0 -14
- package/src/providers/prop-value/brand-list.ts +0 -30
- package/src/providers/prop-value/brand.ts +0 -46
- package/src/providers/prop-value/category-list.ts +0 -31
- package/src/providers/prop-value/category.ts +0 -45
- package/src/providers/prop-value/color.ts +0 -14
- package/src/providers/prop-value/custom.ts +0 -560
- package/src/providers/prop-value/image-list.ts +0 -16
- package/src/providers/prop-value/image.ts +0 -16
- package/src/providers/prop-value/link.ts +0 -259
- package/src/providers/prop-value/product-detail.ts +0 -92
- package/src/providers/prop-value/product-list.ts +0 -124
- package/src/providers/prop-value/raffle-list.ts +0 -20
- package/src/providers/prop-value/raffle.ts +0 -41
- package/src/providers/prop-value/rich-text.ts +0 -14
- package/src/providers/prop-value/slider.ts +0 -19
- package/src/providers/prop-value/text.ts +0 -14
- package/src/providers/types.ts +0 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import a from"lodash/uniq";import{makeAutoObservable as n}from"mobx";import{IkasThemeJsonPageType as i,IkasRaffleMetadataTargetType as s,IkasBlogMetaDataTargetType as o,IkasHTMLMetaDataTargetType as u,IkasThemeJsonComponentPropType as c}from"@ikas/storefront-models";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{IkasProductFunctions as l}from"@ikas/storefront-model-functions";import{IkasProductListPropValueProvider as d}from"./prop-value/product-list.js";import{IkasProductPropValueProvider as g}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as h}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as f}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as v}from"./prop-value/link.js";import{IkasImageListPropValueProvider as m}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as T}from"./prop-value/text.js";import{IkasColorPropValueProvider as S}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as y}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as L}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as O}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as P}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as D}from"./prop-value/custom.js";import{IkasSliderPropValueProvider as b}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as I}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as w}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as C}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as R}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as E}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as A}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as V}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as j}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as G}from"./prop-value/raffle-list.js";import{listMerchantSettings as _,listCustomerReviewSummary as F,listProductOptionSet as B,searchProducts as M,listProductBrand as k,listCategory as U,listBlog as N,listBlogCategory as q,listStorefrontRaffle as Y,listHTMLMetaData as x,listRaffleMetaData as J,listBlogMetaData as K}from"@ikas/storefront-api";import{populateRaffleProducts as X}from"./helpers/raffle.js";var H=function(){function H(e,t,r){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=e,this.pageParams=t||{},this.pageType=r,n(this)}return Object.defineProperty(H.prototype,"page",{get:function(){var e=this;if(this.pageType===i.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===i.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"nextPageData",{get:function(){var e,t,a,n,s,o=[],u=[];return this.pageComponentPropValues.forEach((function(e){if(u.push({pageComponent:{id:e.pageComponent.id,componentId:e.pageComponent.componentId},propValues:e.propValues}),!o.find((function(t){return t.id===e.component.id}))){var t=r({},e.component);t.props.forEach((function(e){delete e.description,delete e.displayName,delete e.translations,delete e.groupId})),delete t.translations,delete t.defaultPropValues,delete t.displayName,delete t.description,delete t.dir,o.push(t)}})),{props:JSON.parse(JSON.stringify({propValues:u,themeJsonComponents:o,pageSpecificData:this.pageSpecificData||null,pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||i.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(a=this.page)||void 0===a?void 0:a.description)||null,canonicals:(null===(n=this.page)||void 0===n?void 0:n.canonicals)||null,disableIndex:(null===(s=this.page)||void 0===s?void 0:s.disableIndex)||null,themeSettings:this.theme.settings||{},productReviewSummary:this.productReviewSummary,configJson:p.toJSON()}))}},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"specification",{get:function(){var e,t,r=this,a=this.page;return(null==a?void 0:a.type)===i.PRODUCT?null===(e=a.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.id)})):null===(t=null==a?void 0:a.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"$pageComponentPropValues",{get:function(){return this.pageComponentPropValues},enumerable:!1,configurable:!0}),H.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,_({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},H.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,r=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return r.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},H.prototype.getProductReviewSummary=function(){var r,a,n;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==i.PRODUCT?[3,2]:[4,F({productId:{eq:null===(r=this.pageSpecificData)||void 0===r?void 0:r.id}})];case 1:(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},H.prototype.getPageSpecificData=function(){var r,a,n,c;return e(this,void 0,void 0,(function(){var d,g,h,f,v,m,T,S,y,L,O=this;return t(this,(function(P){switch(P.label){case 0:return this.pageType&&![i.BRAND,i.PRODUCT,i.CATEGORY,i.BLOG,i.BLOG_CATEGORY,i.RAFFLE_DETAIL].includes(this.pageType)?[2]:(d=this.pageParams.slug)?(g=[],(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(i.BLOG))||(null===(a=this.possiblePageTypes)||void 0===a?void 0:a.includes(i.BLOG_CATEGORY))?[4,K({slug:{eq:d}})]:[3,2]):[2];case 1:return h=P.sent(),(g=(null===(n=h.data)||void 0===n?void 0:n.data)||[]).length?[3,6]:[2];case 2:return(null===(c=this.possiblePageTypes)||void 0===c?void 0:c.includes(i.RAFFLE_DETAIL))?[4,J({slug:{eq:d}})]:[3,4];case 3:return h=P.sent(),(g=h.data||[]).length?[3,6]:[2];case 4:return[4,x({slug:{eq:d}})];case 5:if(h=P.sent(),!(g=h.data||[])||!g.length)return[2];P.label=6;case 6:if(!(f=g[0]).targetId)return[2];switch(v=function(){return e(O,void 0,void 0,(function(){var e,r,a,n,s,o,u,c,d,g,h;return t(this,(function(t){switch(t.label){case 0:return[4,M({input:{productIdList:[f.targetId],priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),locale:p.getCurrentLocale()}})];case 1:return e=t.sent(),(null===(g=null===(d=null==e?void 0:e.data)||void 0===d?void 0:d.data)||void 0===g?void 0:g.length)?(r=e.data.data[0]).productOptionSetId?[4,B({id:{eq:r.productOptionSetId}})]:[3,3]:[2];case 2:(a=t.sent()).isSuccess&&(null===(h=null==a?void 0:a.data)||void 0===h?void 0:h.length)&&(r.productOptionSet=a.data[0]),t.label=3;case 3:return(n=r.variants.find((function(e){return e.isActive})))?(r.selectedVariantValues=n.variantValues,s=l.getDisplayedVariantTypes,this.pageSpecificData=r,(o=s(this.pageSpecificData,r.selectedVariantValues)).length&&(u=o[0]).displayedVariantValues.length&&(c=u.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=c.variant.variantValues),this.pageType=i.PRODUCT,this.setPageMetaData(f),[2]):[2]}}))}))},m=function(){return e(O,void 0,void 0,(function(){var e,r,a,n;return t(this,(function(t){switch(t.label){case 0:return[4,k({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=i.BRAND,this.setPageMetaData(f),[2]):[2]}}))}))},T=function(){return e(O,void 0,void 0,(function(){var e,r,a,n;return t(this,(function(t){switch(t.label){case 0:return[4,U({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=i.CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},S=function(){return e(O,void 0,void 0,(function(){var e,r,a,n;return t(this,(function(t){switch(t.label){case 0:return[4,N({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=i.BLOG,this.setPageMetaData(f),[2]):[2]}}))}))},y=function(){return e(O,void 0,void 0,(function(){var e,r,a,n;return t(this,(function(t){switch(t.label){case 0:return[4,q({id:{eq:f.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=i.BLOG_CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},L=function(){return e(O,void 0,void 0,(function(){var e,r,a,n;return t(this,(function(t){switch(t.label){case 0:return[4,Y({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(a=e.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.length)?(r=e.data.data[0],[4,X([r])]):[2];case 2:return t.sent(),this.pageSpecificData=r,this.pageType=i.RAFFLE_DETAIL,this.setPageMetaData(f),[2]}}))}))},f.targetType){case u.BRAND:return[3,7];case u.CATEGORY:return[3,9];case u.PRODUCT:return[3,11];case o.BLOG:return[3,13];case o.BLOG_CATEGORY:return[3,15];case s.RAFFLE:return[3,17]}return[3,19];case 7:return[4,m()];case 8:return[2,P.sent()];case 9:return[4,T()];case 10:return[2,P.sent()];case 11:return[4,v()];case 12:return[2,P.sent()];case 13:return[4,S()];case 14:return[2,P.sent()];case 15:return[4,y()];case 16:return[2,P.sent()];case 17:return[4,L()];case 18:return[2,P.sent()];case 19:return[3,20];case 20:return[2]}}))}))},H.prototype.getPageComponentPropValues=function(r){return e(this,void 0,void 0,(function(){var a,n,i,s=this;return t(this,(function(o){switch(o.label){case 0:return a=this.theme.components.find((function(e){return e.id===r.componentId})),n={pageComponent:r,component:a,propValues:{}},i=function(a){return e(s,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=n.propValues,i=a.name,[4,this.getPageComponentPropValue(r,a)];case 1:return e[i]=t.sent(),[2]}}))}))},[4,Promise.all(a.props.map(i))];case 1:return o.sent(),[2,n]}}))}))},H.prototype.getPageComponentPropValue=function(r,a){return e(this,void 0,void 0,(function(){var e,n,i,s,o,u=this;return t(this,(function(t){switch(t.label){case 0:if(n=r.propValues[a.name],i=[c.RAFFLE_LIST],null==n&&!i.includes(a.type))return[2,null];switch(a.type){case c.TEXT:return[3,1];case c.RICH_TEXT:return[3,2];case c.BOOLEAN:return[3,3];case c.IMAGE:return[3,4];case c.IMAGE_LIST:return[3,5];case c.BRAND:return[3,6];case c.BRAND_LIST:return[3,7];case c.PRODUCT_LIST:return[3,8];case c.PRODUCT_DETAIL:return[3,9];case c.PRODUCT_ATTRIBUTE:return[3,10];case c.PRODUCT_ATTRIBUTE_LIST:return[3,11];case c.CATEGORY:return[3,12];case c.CATEGORY_LIST:return[3,13];case c.LINK:case c.LIST_OF_LINK:return[3,14];case c.COLOR:return[3,15];case c.CUSTOM:return[3,16];case c.COMPONENT:case c.COMPONENT_LIST:return[3,17];case c.BLOG:return[3,19];case c.BLOG_LIST:return[3,20];case c.BLOG_CATEGORY:return[3,21];case c.BLOG_CATEGORY_LIST:return[3,22];case c.RAFFLE:return[3,23];case c.RAFFLE_LIST:return[3,24];case c.SLIDER:return[3,25]}return[3,26];case 1:return e=new T(n),[3,27];case 2:return e=new I(n),[3,27];case 3:return e=new y(n),[3,27];case 4:return e=new L(n),[3,27];case 5:return e=new m(n),[3,27];case 6:return e=new f(n),[3,27];case 7:return e=new h(n),[3,27];case 8:return e=new d(this.pageType,n,this.pageSpecificData),[3,27];case 9:return e=new g(n),[3,27];case 10:return e=new R(n),[3,27];case 11:return e=new E(n),[3,27];case 12:return e=new O(n),[3,27];case 13:return e=new P(n),[3,27];case 14:return e=new v(n,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new S(n),[3,27];case 16:return(s=this.theme.customData.find((function(e){return e.id===a.customDataId})))?(e=new D(n,s,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return o=n,[4,Promise.all(o.map((function(e){return u.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new w(n),[3,27];case 20:return e=new C(this.pageType,n,this.pageSpecificData),[3,27];case 21:return e=new A(n),[3,27];case 22:return e=new V(n),[3,27];case 23:return e=new j(n),[3,27];case 24:return e=new G,[3,27];case 25:return e=new b(n),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},H.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle||null,this.page.description=e.description||null,this.page.canonicals=e.canonicals||null,this.page.disableIndex=e.disableIndex||null)},H.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,r,a;return t(this,(function(t){switch(t.label){case 0:return e=[],r=[],a=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":r.push(t);break;case"RAFFLE":a.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(r,"BLOG"),this.getLinkSlugs(a,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},H.prototype.getLinkSlugs=function(r,n){return e(this,void 0,void 0,(function(){var i,s,o=this;return t(this,(function(u){switch(u.label){case 0:return i=a(r.map((function(e){return e.id}))),s=[],[4,function(){return e(o,void 0,void 0,(function(){var e,r,a,o,u;return t(this,(function(t){switch(t.label){case 0:switch(e=[],n){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,x({targetId:{in:i}})];case 2:return r=t.sent(),e=r.data||[],[3,8];case 3:return[4,K({targetId:{in:i}})];case 4:return a=t.sent(),e=(null===(u=a.data)||void 0===u?void 0:u.data)||[],[3,8];case 5:return[4,J({targetId:{in:i}})];case 6:return o=t.sent(),e=o.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(s=e),[2]}}))}))}()];case 1:return u.sent(),r.forEach((function(e){var t=s.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},H}();export{H as IkasPageDataProvider};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IkasBlog, IkasBlogCategory, IkasBrand, IkasCategory, IkasProduct, IkasRaffle } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getPlaceholderProduct(): IkasProduct;
|
|
3
|
+
export declare function getPlaceholderCategory(): IkasCategory;
|
|
4
|
+
export declare function getPlaceholderBrand(): IkasBrand;
|
|
5
|
+
export declare function getPlaceholderBlog(): IkasBlog;
|
|
6
|
+
export declare function getPlaceholderBlogCategory(): IkasBlogCategory;
|
|
7
|
+
export declare function getPlaceholderRaffle(): IkasRaffle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{IkasProductType as t,IkasRaffleVerificationType as e}from"@ikas/storefront-models";function a(){return{id:"",name:"",type:t.PHYSICAL,description:"",shortDescription:"",metaData:null,brand:null,categories:[],tags:[],variants:[],attributes:[],variantTypes:[],productOptionSetId:null,baseUnit:null}}function n(){return{categoryPath:[],description:null,imageId:null,name:"",parentId:null,metaData:null,categoryPathItems:[],orderType:null,id:"",createdAt:0,updatedAt:0}}function d(){return{description:null,imageId:null,metaData:null,orderType:null,name:"",id:"",createdAt:0,updatedAt:0}}function r(){return{createdAt:0,id:"",updatedAt:0,blogContent:{content:"",createdAt:0,id:"",updatedAt:0},categoryId:"",imageId:"",isPublished:!1,locale:null,metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},publishedAt:null,shortDescription:"",storefrontId:"",tagIds:[],tags:[],title:"",writer:{firstName:"",lastName:""},category:l()}}function l(){return{createdAt:0,id:"",updatedAt:0,imageId:"",metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},name:""}}function i(){return{createdAt:0,id:"",updatedAt:0,deleted:!1,dateRange:null,metadata:null,name:"",requiredCustomerAccount:!1,status:!1,variants:[],products:[],verificationType:e.EMAIL}}export{r as getPlaceholderBlog,l as getPlaceholderBlogCategory,d as getPlaceholderBrand,n as getPlaceholderCategory,a as getPlaceholderProduct,i as getPlaceholderRaffle};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasAttributeListPropValue } from "../../models/prop-value/attribute-list";
|
|
3
|
+
import { IkasAttributeListPropValueData } from "../types";
|
|
4
|
+
export declare class IkasAttributeListPropValueProvider implements IkasPropValueProvider<IkasAttributeListPropValueData> {
|
|
5
|
+
private attributeListPropValue;
|
|
6
|
+
constructor(prop: IkasAttributeListPropValue);
|
|
7
|
+
getValue(): Promise<IkasAttributeListPropValueData>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{searchProducts as a}from"@ikas/storefront-api";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{IkasProductFunctions as r}from"@ikas/storefront-model-functions";var s=function(){function s(t){this.attributeListPropValue=t}return s.prototype.getValue=function(){var s,u;return t(this,void 0,void 0,(function(){var t,n,o,l,d,c,p,V=this;return i(this,(function(i){switch(i.label){case 0:return!(null===(s=this.attributeListPropValue.attributeIds)||void 0===s?void 0:s.length)||this.attributeListPropValue.usePageData||!this.attributeListPropValue.usePageData&&!this.attributeListPropValue.variantId?[2,{productDetail:null,attributeListPropValue:this.attributeListPropValue}]:[4,a({input:{productIdList:[this.attributeListPropValue.productId],priceListId:e.getPriceListId(),salesChannelId:e.getSalesChannelId(),locale:e.getCurrentLocale()}})];case 1:return(n=i.sent()).isSuccess&&(null===(u=n.data)||void 0===u?void 0:u.data)&&(o=n.data.data,l=r.hasVariant,o.length&&((d=o[0])&&l(d)?(c=d.variants.find((function(t){return t.id===V.attributeListPropValue.variantId})))&&(d.selectedVariantValues=c.variantValues,t=d):(p=d.variants.find((function(t){return t.isActive})),d.selectedVariantValues=(p||d.variants[0]).variantValues,t=d))),[2,{productDetail:t||null,attributeListPropValue:this.attributeListPropValue}]}}))}))},s}();export{s as IkasAttributeListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasAttributePropValue } from "../../models/prop-value/attribute";
|
|
3
|
+
import { IkasAttributePropValueData } from "../types";
|
|
4
|
+
export declare class IkasAttributePropValueProvider implements IkasPropValueProvider<IkasAttributePropValueData> {
|
|
5
|
+
private attributePropValue;
|
|
6
|
+
constructor(prop: IkasAttributePropValue);
|
|
7
|
+
getValue(): Promise<IkasAttributePropValueData>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as a}from'./../../ext/tslib/tslib.es6.js';import{searchProducts as e}from"@ikas/storefront-api";import{IkasStorefrontConfig as r}from"@ikas/storefront-config";import{IkasProductFunctions as i}from"@ikas/storefront-model-functions";var u=function(){function u(t){this.attributePropValue=t}return u.prototype.getValue=function(){var u,n;return t(this,void 0,void 0,(function(){var t,o,s,l,d,c,p,V=this;return a(this,(function(a){switch(a.label){case 0:return!this.attributePropValue.attributeId||(null===(u=this.attributePropValue)||void 0===u?void 0:u.usePageData)||!this.attributePropValue.usePageData&&!this.attributePropValue.variantId?[2,{productDetail:null,attributePropValue:this.attributePropValue}]:[4,e({input:{productIdList:[this.attributePropValue.productId],priceListId:r.getPriceListId(),salesChannelId:r.getSalesChannelId(),locale:r.getCurrentLocale()}})];case 1:return(o=a.sent()).isSuccess&&(null===(n=o.data)||void 0===n?void 0:n.data)&&(s=o.data.data).length&&(l=s[0],d=i.hasVariant,l&&d(l)?(c=l.variants.find((function(t){return t.id===V.attributePropValue.variantId})))&&(l.selectedVariantValues=c.variantValues,t=l):(p=l.variants.find((function(t){return t.isActive})),l.selectedVariantValues=(p||l.variants[0]).variantValues,t=l)),[2,{productDetail:t||null,attributePropValue:this.attributePropValue}]}}))}))},u}();export{u as IkasAttributePropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasBlogCategoryListPropValue } from "../../models/prop-value/blog-category-list";
|
|
3
|
+
import { IkasBlogCategoryList } from "../../models/ui";
|
|
4
|
+
export declare class IkasBlogCategoryListPropValueProvider implements IkasPropValueProvider<IkasBlogCategoryList> {
|
|
5
|
+
private blogCategoryListPropValue;
|
|
6
|
+
constructor(blogCategoryListPropValue: IkasBlogCategoryListPropValue);
|
|
7
|
+
getValue(): Promise<IkasBlogCategoryList>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{getInitial as e}from"../../models/ui/blog-category-list/init.js";var i=function(){function i(t){this.blogCategoryListPropValue=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return o(this,(function(o){switch(o.label){case 0:return t={data:[],count:0,page:1,limit:10,blogCategoryListPropValue:this.blogCategoryListPropValue,type:this.blogCategoryListPropValue.blogCategoryListType},[4,e(t)];case 1:return o.sent(),[2,t]}}))}))},i}();export{i as IkasBlogCategoryListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasBlogCategoryPropValue } from "../../models/prop-value/blog-category";
|
|
3
|
+
import { IkasBlogCategoryPropValueData } from "../types";
|
|
4
|
+
export declare class IkasBlogCategoryPropValueProvider implements IkasPropValueProvider<IkasBlogCategoryPropValueData | null> {
|
|
5
|
+
private blogCategoryPropValue;
|
|
6
|
+
constructor(propValue: IkasBlogCategoryPropValue);
|
|
7
|
+
getValue(): Promise<IkasBlogCategoryPropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as o,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{listBlogCategory as a}from"@ikas/storefront-api";import{getPlaceholderBlogCategory as e}from"../placeholders.js";var r=function(){function r(o){this.blogCategoryPropValue=o}return r.prototype.getValue=function(){var r,l;return o(this,void 0,void 0,(function(){var o;return t(this,(function(t){switch(t.label){case 0:return(null===(r=this.blogCategoryPropValue)||void 0===r?void 0:r.usePageData)?[2,{blogCategory:null,blogCategoryPropValue:this.blogCategoryPropValue}]:this.blogCategoryPropValue.blogCategoryId?[4,a({id:{eq:this.blogCategoryPropValue.blogCategoryId},pagination:{page:1,limit:1}})]:[2,null];case 1:return(o=t.sent()).isSuccess&&(null===(l=o.data)||void 0===l?void 0:l.data)?[2,{blogCategory:o.data.data[0]||e(),blogCategoryPropValue:this.blogCategoryPropValue}]:[2,{blogCategory:e(),blogCategoryPropValue:this.blogCategoryPropValue}]}}))}))},r}();export{r as IkasBlogCategoryPropValueProvider};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
2
|
+
import IkasPropValueProvider from ".";
|
|
3
|
+
import { IkasBlogListPropValue } from "../../models/prop-value/blog-list";
|
|
4
|
+
import { IkasBlogList } from "../../models/ui";
|
|
5
|
+
export declare class IkasBlogListPropValueProvider implements IkasPropValueProvider<IkasBlogList> {
|
|
6
|
+
private pageType;
|
|
7
|
+
private blogListPropValue;
|
|
8
|
+
private pageSpecificData?;
|
|
9
|
+
constructor(pageType: IkasThemeJsonPageType, blogListPropValue: IkasBlogListPropValue, pageSpecificData?: any);
|
|
10
|
+
getValue(): Promise<IkasBlogList>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as i,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import"../../models/ui/blog-category-list/index.js";import{IkasBlogListType as e}from"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as s}from"../../models/ui/blog-list/init.js";var l=function(){function l(i,t,o){this.pageType=i,this.blogListPropValue=t,this.pageSpecificData=o}return l.prototype.getValue=function(){return i(this,void 0,void 0,(function(){var i,l,r;return t(this,(function(t){switch(t.label){case 0:return i=null,this.blogListPropValue.blogListType===e.ALL&&this.blogListPropValue.usePageFilter&&this.pageType===o.BLOG_CATEGORY&&this.pageSpecificData&&(l=this.pageSpecificData,i=l.id),this.blogListPropValue.blogListType===e.CATEGORY&&this.blogListPropValue.categoryId&&(i=this.blogListPropValue.categoryId),r={data:[],count:0,type:this.blogListPropValue.blogListType,page:1,limit:this.blogListPropValue.initialLimit||10,blogListPropValue:this.blogListPropValue,filterCategoryId:i},[4,s(r)];case 1:return t.sent(),[2,r]}}))}))},l}();export{l as IkasBlogListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasBlogPropValue } from "../../models/prop-value/blog";
|
|
3
|
+
import { IkasBlogPropValueData } from "../types";
|
|
4
|
+
export declare class IkasBlogPropValueProvider implements IkasPropValueProvider<IkasBlogPropValueData | null> {
|
|
5
|
+
private blogPropValue;
|
|
6
|
+
constructor(propValue: IkasBlogPropValue);
|
|
7
|
+
getValue(): Promise<IkasBlogPropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as o,__generator as l}from'./../../ext/tslib/tslib.es6.js';import{listBlog as t}from"@ikas/storefront-api";import{getPlaceholderBlog as e}from"../placeholders.js";var r=function(){function r(o){this.blogPropValue=o}return r.prototype.getValue=function(){var r,i,a;return o(this,void 0,void 0,(function(){var o;return l(this,(function(l){switch(l.label){case 0:return(null===(r=this.blogPropValue)||void 0===r?void 0:r.usePageData)?[2,{blog:null,blogPropValue:this.blogPropValue}]:this.blogPropValue.blogId?[4,t({id:{eq:this.blogPropValue.blogId}})]:[2,null];case 1:return(o=l.sent()).isSuccess&&(null===(a=null===(i=o.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?[2,{blog:o.data.data[0]||e(),blogPropValue:this.blogPropValue}]:[2,{blog:e(),blogPropValue:this.blogPropValue}]}}))}))},r}();export{r as IkasBlogPropValueProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.bool=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.bool||!1]}))}))},n}();export{n as IkasBooleanPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasBrandListPropValue } from "../../models/prop-value/brand-list";
|
|
3
|
+
import { IkasBrandList } from "../../models/ui";
|
|
4
|
+
export declare class IkasBrandListPropValueProvider implements IkasPropValueProvider<IkasBrandList> {
|
|
5
|
+
private brandListPropValue;
|
|
6
|
+
constructor(brandListPropValue: IkasBrandListPropValue);
|
|
7
|
+
getValue(): Promise<IkasBrandList>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as i,__generator as t}from'./../../ext/tslib/tslib.es6.js';import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import{IkasBrandListSortType as r}from"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as o}from"../../models/ui/brand-list/init.js";var s=function(){function s(i){this.brandListPropValue=i}return s.prototype.getValue=function(){return i(this,void 0,void 0,(function(){var i;return t(this,(function(t){switch(t.label){case 0:return i={data:[],count:0,type:this.brandListPropValue.brandListType,sort:this.brandListPropValue.initialSort||r.A_Z,page:1,limit:this.brandListPropValue.initialLimit||10,brandListPropValue:this.brandListPropValue},[4,o(i)];case 1:return t.sent(),[2,i]}}))}))},s}();export{s as IkasBrandListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasBrandPropValue } from "../../models/prop-value/brand";
|
|
3
|
+
import { IkasBrandPropValueData } from "../types";
|
|
4
|
+
export declare class IkasBrandPropValueProvider implements IkasPropValueProvider<IkasBrandPropValueData | null> {
|
|
5
|
+
private brandPropValue;
|
|
6
|
+
constructor(prop: IkasBrandPropValue);
|
|
7
|
+
getValue(): Promise<IkasBrandPropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as r,__generator as a}from'./../../ext/tslib/tslib.es6.js';import{listProductBrand as t}from"@ikas/storefront-api";import{getPlaceholderBrand as e}from"../placeholders.js";var n=function(){function n(r){this.brandPropValue=r}return n.prototype.getValue=function(){var n;return r(this,void 0,void 0,(function(){var r,o;return a(this,(function(a){switch(a.label){case 0:if(this.brandPropValue.usePageData)return[2,{brand:null,brandPropValue:this.brandPropValue}];if(!this.brandPropValue.brandId)return[2,null];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,t({id:{eq:this.brandPropValue.brandId}})];case 2:return(r=a.sent()).isSuccess&&(null===(n=r.data)||void 0===n?void 0:n.data)?[2,{brand:r.data.data.length?r.data.data[0]:e(),brandPropValue:this.brandPropValue}]:[3,4];case 3:return o=a.sent(),console.log(o),[3,4];case 4:return[2,null]}}))}))},n}();export{n as IkasBrandPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasCategoryListPropValue } from "../../models/prop-value/category-list";
|
|
3
|
+
import { IkasCategoryList } from "../../models/ui";
|
|
4
|
+
export declare class IkasCategoryListPropValueProvider implements IkasPropValueProvider<IkasCategoryList> {
|
|
5
|
+
private categoryListPropValue;
|
|
6
|
+
constructor(categoryListPropValue: IkasCategoryListPropValue);
|
|
7
|
+
getValue(): Promise<IkasCategoryList>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import{IkasCategoryListSortType as o}from"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as e}from"../../models/ui/category-list/init.js";var r=function(){function r(t){this.categoryListPropValue=t}return r.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){switch(i.label){case 0:return t={data:[],count:0,type:this.categoryListPropValue.categoryListType,sort:this.categoryListPropValue.initialSort||o.A_Z,page:1,limit:this.categoryListPropValue.initialLimit||10,categoryListPropValue:this.categoryListPropValue},[4,e(t)];case 1:return i.sent(),[2,t]}}))}))},r}();export{r as IkasCategoryListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasCategoryPropValue } from "../../models/prop-value/category";
|
|
3
|
+
import { IkasCategoryPropValueData } from "../types";
|
|
4
|
+
export declare class IkasCategoryPropValueProvider implements IkasPropValueProvider<IkasCategoryPropValueData | null> {
|
|
5
|
+
private categoryPropValue;
|
|
6
|
+
constructor(prop: IkasCategoryPropValue);
|
|
7
|
+
getValue(): Promise<IkasCategoryPropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{listCategory as r}from"@ikas/storefront-api";import{getPlaceholderCategory as o}from"../placeholders.js";var a=function(){function a(t){this.categoryPropValue=t}return a.prototype.getValue=function(){var a,l;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:if(this.categoryPropValue.usePageData)return[2,{category:null,categoryPropValue:this.categoryPropValue}];if(!this.categoryPropValue.categoryId)return[2,null];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r({id:{eq:this.categoryPropValue.categoryId}})];case 2:return t=e.sent(),[2,{category:(null===(l=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===l?void 0:l.length)?t.data.data[0]:o(),categoryPropValue:this.categoryPropValue}];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,null]}}))}))},a}();export{a as IkasCategoryPropValueProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.color=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.color]}))}))},n}();export{n as IkasColorPropValueProvider};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasPageDataProvider } from "../page-data-get";
|
|
3
|
+
import { IkasThemeJson, IkasThemeJsonCustomData, IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
4
|
+
import { IkasCustomDataPropValueData } from "../types";
|
|
5
|
+
export declare class IkasCustomPropValueProvider implements IkasPropValueProvider<IkasCustomDataPropValueData | undefined> {
|
|
6
|
+
private value;
|
|
7
|
+
private customData;
|
|
8
|
+
private theme;
|
|
9
|
+
private pageType;
|
|
10
|
+
private pageSpecificData?;
|
|
11
|
+
private pageParams?;
|
|
12
|
+
private pageDataProvider;
|
|
13
|
+
constructor(value: any, customData: IkasThemeJsonCustomData, theme: IkasThemeJson, pageType: IkasThemeJsonPageType, pageDataProvider: IkasPageDataProvider, pageSpecificData?: any, pageParams?: Record<string, any>);
|
|
14
|
+
getValue(): Promise<IkasCustomDataPropValueData | undefined>;
|
|
15
|
+
private getBooleanValue;
|
|
16
|
+
private getBrandListPropValue;
|
|
17
|
+
private getBrandPropValue;
|
|
18
|
+
private getCategoryListPropValue;
|
|
19
|
+
private getCategoryPropValue;
|
|
20
|
+
private getColorPropValue;
|
|
21
|
+
private getRichTextPropValue;
|
|
22
|
+
private getImageListPropValue;
|
|
23
|
+
private getImagePropValue;
|
|
24
|
+
private getLinkPropValue;
|
|
25
|
+
private getProductDetailPropValue;
|
|
26
|
+
private getProductListPropValue;
|
|
27
|
+
private getProductAttributePropValue;
|
|
28
|
+
private getProductAttributeListPropValue;
|
|
29
|
+
private getTextValue;
|
|
30
|
+
private getObjectValue;
|
|
31
|
+
private getArrayValue;
|
|
32
|
+
private getEnumValue;
|
|
33
|
+
private getCustomDataValue;
|
|
34
|
+
private getComponentListValue;
|
|
35
|
+
private getBlogValue;
|
|
36
|
+
private getBlogListValue;
|
|
37
|
+
private getBlogCategoryValue;
|
|
38
|
+
private getBlogCategoryListValue;
|
|
39
|
+
private getRaffleValue;
|
|
40
|
+
private getRaffleListValue;
|
|
41
|
+
private getSliderValue;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import a from"lodash/cloneDeep";import{IkasBrandListPropValueProvider as s}from"./brand-list.js";import{IkasBrandPropValueProvider as u}from"./brand.js";import{IkasCategoryListPropValueProvider as n}from"./category-list.js";import{IkasCategoryPropValueProvider as i}from"./category.js";import{IkasColorPropValueProvider as o}from"./color.js";import{IkasBooleanPropValueProvider as c}from"./boolean.js";import{IkasTextPropValueProvider as l}from"./text.js";import{IkasImageListPropValueProvider as h}from"./image-list.js";import{IkasImagePropValueProvider as p}from"./image.js";import{IkasLinkPropValueProvider as m}from"./link.js";import{IkasProductPropValueProvider as f}from"./product-detail.js";import{IkasProductListPropValueProvider as g}from"./product-list.js";import{IkasRichTextPropValueProvider as v}from"./rich-text.js";import{IkasBlogPropValueProvider as d}from"./blog.js";import{IkasBlogListPropValueProvider as D}from"./blog-list.js";import{IkasAttributePropValueProvider as V}from"./attribute.js";import{IkasAttributeListPropValueProvider as w}from"./attribute-list.js";import{IkasBlogCategoryPropValueProvider as y}from"./blog-category.js";import{IkasBlogCategoryListPropValueProvider as T}from"./blog-category-list.js";import{IkasRaffleListPropValueProvider as L}from"./raffle-list.js";import{IkasRafflePropValueProvider as P}from"./raffle.js";import{IkasSliderPropValueProvider as b}from"./slider.js";import{IkasThemeJsonComponentPropType as R}from"@ikas/storefront-models";var I=function(){function I(t,e,r,a,s,u,n){this.value=t,this.customData=e,this.theme=r,this.pageType=a,this.pageDataProvider=s,this.pageSpecificData=u,this.pageParams=n}return I.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if((void 0===this.value||null===this.value)&&this.customData.type!==R.RAFFLE_LIST)return[2,{value:null,customData:this.customData}];e.label=1;case 1:switch(e.trys.push([1,58,,59]),this.customData.type){case R.TEXT:return[3,2];case R.RICH_TEXT:return[3,4];case R.BOOLEAN:return[3,6];case R.BRAND_LIST:return[3,8];case R.BRAND:return[3,10];case R.CATEGORY_LIST:return[3,12];case R.CATEGORY:return[3,14];case R.COLOR:return[3,16];case R.IMAGE_LIST:return[3,18];case R.IMAGE:return[3,20];case R.LINK:case R.LIST_OF_LINK:return[3,22];case R.PRODUCT_DETAIL:return[3,24];case R.PRODUCT_LIST:return[3,26];case R.PRODUCT_ATTRIBUTE:return[3,28];case R.PRODUCT_ATTRIBUTE_LIST:return[3,30];case R.OBJECT:return[3,32];case R.DYNAMIC_LIST:case R.STATIC_LIST:return[3,34];case R.ENUM:return[3,36];case R.CUSTOM:return[3,38];case R.COMPONENT:case R.COMPONENT_LIST:return[3,40];case R.BLOG:return[3,42];case R.BLOG_LIST:return[3,44];case R.BLOG_CATEGORY:return[3,46];case R.BLOG_CATEGORY_LIST:return[3,48];case R.RAFFLE:return[3,50];case R.RAFFLE_LIST:return[3,52];case R.SLIDER:return[3,54]}return[3,56];case 2:return[4,this.getTextValue()];case 3:return t=e.sent(),[3,57];case 4:return[4,this.getRichTextPropValue()];case 5:return t=e.sent(),[3,57];case 6:return[4,this.getBooleanValue()];case 7:return t=e.sent(),[3,57];case 8:return[4,this.getBrandListPropValue()];case 9:return t=e.sent(),[3,57];case 10:return[4,this.getBrandPropValue()];case 11:return t=e.sent(),[3,57];case 12:return[4,this.getCategoryListPropValue()];case 13:return t=e.sent(),[3,57];case 14:return[4,this.getCategoryPropValue()];case 15:return t=e.sent(),[3,57];case 16:return[4,this.getColorPropValue()];case 17:return t=e.sent(),[3,57];case 18:return[4,this.getImageListPropValue()];case 19:return t=e.sent(),[3,57];case 20:return[4,this.getImagePropValue()];case 21:return t=e.sent(),[3,57];case 22:return[4,this.getLinkPropValue()];case 23:return t=e.sent(),[3,57];case 24:return[4,this.getProductDetailPropValue()];case 25:return t=e.sent(),[3,57];case 26:return[4,this.getProductListPropValue()];case 27:return t=e.sent(),[3,57];case 28:return[4,this.getProductAttributePropValue()];case 29:return t=e.sent(),[3,57];case 30:return[4,this.getProductAttributeListPropValue()];case 31:return t=e.sent(),[3,57];case 32:return[4,this.getObjectValue()];case 33:return t=e.sent(),[3,57];case 34:return[4,this.getArrayValue()];case 35:return t=e.sent(),[3,57];case 36:return[4,this.getEnumValue()];case 37:return t=e.sent(),[3,57];case 38:return[4,this.getCustomDataValue()];case 39:return t=e.sent(),[3,57];case 40:return[4,this.getComponentListValue()];case 41:return t=e.sent(),[3,57];case 42:return[4,this.getBlogValue()];case 43:return t=e.sent(),[3,57];case 44:return[4,this.getBlogListValue()];case 45:return t=e.sent(),[3,57];case 46:return[4,this.getBlogCategoryValue()];case 47:return t=e.sent(),[3,57];case 48:return[4,this.getBlogCategoryListValue()];case 49:return t=e.sent(),[3,57];case 50:return[4,this.getRaffleValue()];case 51:return t=e.sent(),[3,57];case 52:return[4,this.getRaffleListValue()];case 53:return t=e.sent(),[3,57];case 54:return[4,this.getSliderValue()];case 55:return t=e.sent(),[3,57];case 56:return[3,57];case 57:return[3,59];case 58:return e.sent(),[2];case 59:return!this.customData.isRequired||void 0!==(null==t?void 0:t.value)&&null!==(null==t?void 0:t.value)?[2,t]:[2]}}))}))},I.prototype.getBooleanValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new c(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getBrandListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new s(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getBrandPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new u(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getCategoryListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new n(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getCategoryPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new i(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getColorPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new o(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getRichTextPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new v(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getImageListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new h(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getImagePropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new p(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getLinkPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new m(this.value,this.theme,this.pageDataProvider.linkMetaDataTargetIds).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getProductDetailPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new f(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getProductListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new g(this.pageType,this.value,this.pageSpecificData).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getProductAttributePropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new V(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getProductAttributeListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new w(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getTextValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new l(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getObjectValue=function(){return t(this,void 0,void 0,(function(){var t,r,a,s,u,n;return e(this,(function(e){switch(e.label){case 0:t={},r=0,a=this.customData.nestedData||[],e.label=1;case 1:if(!(r<a.length))return[3,4];if(!(s=a[r]).key)return[3,3];if(u=this.value[s.key],s.isRequired&&s.type!==R.RAFFLE_LIST&&null==u)throw new Error("Required data is missing");return[4,new I(u,s,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()];case 2:if(n=e.sent(),s.isRequired&&null==n)throw new Error("Required data is missing");t[s.key]=n,e.label=3;case 3:return r++,[3,1];case 4:return[2,{value:t,customData:this.customData}]}}))}))},I.prototype.getArrayValue=function(){return t(this,void 0,void 0,(function(){var t,r,a,s,u,n;return e(this,(function(e){switch(e.label){case 0:if(!this.value||!Array.isArray(this.value))throw new Error("Incorrect data!");t=[],r=this.customData.nestedData[0],a=0,s=this.value,e.label=1;case 1:if(!(a<s.length))return[3,4];if(u=s[a],r.isRequired&&r.type!==R.RAFFLE_LIST&&null==u)throw new Error("Required data is missing");return[4,new I(u,r,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()];case 2:if(n=e.sent(),r.isRequired&&null==n)throw new Error("Required data is missing");t.push(n),e.label=3;case 3:return a++,[3,1];case 4:return[2,{value:t,customData:this.customData}]}}))}))},I.prototype.getEnumValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,{value:this.value,customData:this.customData}]}))}))},I.prototype.getCustomDataValue=function(){return t(this,void 0,void 0,(function(){var t,r=this;return e(this,(function(e){switch(e.label){case 0:return(t=this.theme.customData.find((function(t){return t.id===r.customData.customDataId})))?((t=a(t)).isRequired=this.customData.isRequired,[4,new I(this.value,t,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()]):[2,{value:null,customData:this.customData}];case 1:return[2,e.sent()]}}))}))},I.prototype.getComponentListValue=function(){return t(this,void 0,void 0,(function(){var t,a,s=this;return e(this,(function(e){switch(e.label){case 0:return t=this.value?this.value.map((function(t){return r({},t)})):[],a={},[4,Promise.all(t.map((function(t){return s.pageDataProvider.getPageComponentPropValues(t)})))];case 1:return[2,(a.value=e.sent(),a.customData=this.customData,a)]}}))}))},I.prototype.getBlogValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new d(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getBlogListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new D(this.pageType,this.value,this.pageSpecificData).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getBlogCategoryValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new y(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getBlogCategoryListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new T(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getRaffleValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new P(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getRaffleListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,(new L).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I.prototype.getSliderValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new b(this.value).getValue()];case 1:return[2,{value:t.sent(),customData:this.customData}]}}))}))},I}();export{I as IkasCustomPropValueProvider};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IkasImage } from "@ikas/storefront-models";
|
|
2
|
+
import IkasPropValueProvider from ".";
|
|
3
|
+
export declare class IkasImageListPropValueProvider implements IkasPropValueProvider<IkasImage[]> {
|
|
4
|
+
private imageListPropValue;
|
|
5
|
+
constructor(imageListPropValue: string[]);
|
|
6
|
+
getValue(): Promise<IkasImage[]>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.imageListPropValue=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.imageListPropValue.map((function(t){return{id:t,isVideo:!1}}))]}))}))},n}();export{n as IkasImageListPropValueProvider};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IkasImage } from "@ikas/storefront-models";
|
|
2
|
+
import IkasPropValueProvider from ".";
|
|
3
|
+
export declare class IkasImagePropValueProvider implements IkasPropValueProvider<IkasImage> {
|
|
4
|
+
private imagePropValue;
|
|
5
|
+
constructor(imagePropValue: string);
|
|
6
|
+
getValue(): Promise<IkasImage>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';var o=function(){function o(t){this.imagePropValue=t}return o.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,{id:this.imagePropValue,isVideo:!1}]}))}))},o}();export{o as IkasImagePropValueProvider};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface IkasPropValueProvider<T> {
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
export default interface IkasPropValueProvider<T> {
|
|
2
|
+
getValue: () => Promise<T>;
|
|
3
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IkasThemeJson } from "@ikas/storefront-models";
|
|
2
|
+
import IkasPropValueProvider from ".";
|
|
3
|
+
import { IkasLinkPropValue } from "../../models/prop-value/link";
|
|
4
|
+
import { IkasNavigationLink } from "../../models/ui";
|
|
5
|
+
export declare type IkasLinkMetaDataType = "DEFAULT" | "BLOG" | "RAFFLE";
|
|
6
|
+
export declare type IkasLinkMetaDataTargetId = {
|
|
7
|
+
type: IkasLinkMetaDataType;
|
|
8
|
+
id: string;
|
|
9
|
+
navigationLink: NavigationLink;
|
|
10
|
+
};
|
|
11
|
+
export declare class IkasLinkPropValueProvider implements IkasPropValueProvider<NavigationLink | NavigationLink[]> {
|
|
12
|
+
private linkPropValue;
|
|
13
|
+
private theme;
|
|
14
|
+
private linkMetaDataTargetIds;
|
|
15
|
+
constructor(linkPropValue: IkasLinkPropValue | IkasLinkPropValue[], theme: IkasThemeJson, linkMetaDataTargetIds: IkasLinkMetaDataTargetId[]);
|
|
16
|
+
private getNavigationLink;
|
|
17
|
+
getValue(): Promise<IkasNavigationLink | IkasNavigationLink[]>;
|
|
18
|
+
}
|
|
19
|
+
export declare class NavigationLink implements IkasNavigationLink {
|
|
20
|
+
href: string;
|
|
21
|
+
label: string;
|
|
22
|
+
subLinks: IkasNavigationLink[];
|
|
23
|
+
isExternal?: boolean | null;
|
|
24
|
+
itemId?: string;
|
|
25
|
+
constructor(data: IkasNavigationLink);
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import{IkasLinkType as t}from"../../models/prop-value/link.js";var a=function(){function a(e,n,i){this.linkPropValue=e,this.theme=n,this.linkMetaDataTargetIds=i}return a.prototype.getNavigationLink=function(a){var l,r;return e(this,void 0,void 0,(function(){var e,o,u,p,b,h,d,c,f=this;return n(this,(function(n){switch(n.label){case 0:return a.linkType===t.PAGE?a.pageType===i.INDEX?e=new s({href:"/",label:a.label||"",subLinks:[]}):a.pageType===i.ACCOUNT?e=new s({href:"/account",label:a.label||"",subLinks:[]}):a.pageType===i.ADDRESSES?e=new s({href:"/account/addresses",label:a.label||"",subLinks:[]}):a.pageType===i.ORDERS?e=new s({href:"/account/orders",label:a.label||"",subLinks:[]}):a.pageType===i.FAVORITE_PRODUCTS?e=new s({href:"/account/favorite-products",label:a.label||"",subLinks:[]}):a.pageType===i.LOGIN?e=new s({href:"/account/login",label:a.label||"",subLinks:[]}):a.pageType===i.REGISTER?e=new s({href:"/account/register",label:a.label||"",subLinks:[]}):a.pageType===i.FORGOT_PASSWORD?e=new s({href:"/account/forgot-password",label:a.label||"",subLinks:[]}):a.pageType===i.RECOVER_PASSWORD?e=new s({href:"/account/recover-password",label:a.label||"",subLinks:[]}):a.pageType===i.BLOG_INDEX?e=new s({href:"/blog",label:a.label||"",subLinks:[]}):a.pageType===i.CART?e=new s({href:"/cart",label:a.label||"",subLinks:[]}):a.pageType===i.SEARCH?e=new s({href:"/search",label:a.label||"",subLinks:[]}):a.pageType===i.CUSTOM?(o=this.theme.pages.find((function(e){return e.id===a.pageId})))&&(e=new s({href:"/pages/"+o.slug,label:a.label||"",subLinks:[]})):[i.PRODUCT,i.BRAND,i.CATEGORY].includes(a.pageType)?a.itemId&&(e=new s({href:"/",label:a.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"DEFAULT",id:a.itemId,navigationLink:e})):[i.BLOG,i.BLOG_CATEGORY].includes(a.pageType)?a.itemId&&(e=new s({href:"/blog/",label:a.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"BLOG",id:a.itemId,navigationLink:e})):a.pageType===i.RAFFLE_DETAIL&&a.itemId&&(e=new s({href:"/raffle/",label:a.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"RAFFLE",id:a.itemId,navigationLink:e})):a.linkType===t.EXTERNAL&&(e=new s({href:a.externalLink||"",label:a.label||"",subLinks:[],isExternal:!0})),e?(u=e,[4,Promise.all(a.subLinks.map((function(e){return f.getNavigationLink(e)})))]):[3,2];case 1:return u.subLinks=n.sent(),a.pageComponentId&&a.pageId&&(p=this.theme.pages.find((function(e){return e.id===a.pageId})),b=null===(l=this.theme.components.find((function(e){return e.isHeader})))||void 0===l?void 0:l.id,h=null===(r=this.theme.components.find((function(e){return e.isFooter})))||void 0===r?void 0:r.id,d=(null==p?void 0:p.components.filter((function(e){return e.componentId!==b&&e.componentId!==h})))||[],-1!==(c=d.findIndex((function(e){return e.id===a.pageComponentId})))&&(e.href+="#"+c)),[2,e];case 2:return[2,new s({href:"",label:"",subLinks:[]})]}}))}))},a.prototype.getValue=function(){return e(this,void 0,void 0,(function(){var e=this;return n(this,(function(n){switch(n.label){case 0:return Array.isArray(this.linkPropValue)?[4,Promise.all(this.linkPropValue.map((function(n){return e.getNavigationLink(n)})))]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return[4,this.getNavigationLink(this.linkPropValue)]}}))}))},a}(),s=function(e){this.href=e.href,this.label=e.label,this.subLinks=e.subLinks,this.isExternal=e.isExternal,this.itemId=e.itemId};export{a as IkasLinkPropValueProvider,s as NavigationLink};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasProductPropValue } from "../../models/prop-value/product";
|
|
3
|
+
import { IkasProductPropValueData } from "../types";
|
|
4
|
+
export declare class IkasProductPropValueProvider implements IkasPropValueProvider<IkasProductPropValueData | null> {
|
|
5
|
+
private productDetailPropValue;
|
|
6
|
+
constructor(prop: IkasProductPropValue);
|
|
7
|
+
getValue(): Promise<IkasProductPropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{listProductOptionSet as a,searchProducts as r}from"@ikas/storefront-api";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{IkasProductFunctions as o}from"@ikas/storefront-model-functions";import{getPlaceholderProduct as u}from"../placeholders.js";var l=function(){function l(t){this.productDetailPropValue=t}return l.prototype.getValue=function(){var l,n,d;return t(this,void 0,void 0,(function(){var t,s,c,p,V,f,v,h=this;return e(this,(function(e){switch(e.label){case 0:return(null===(l=this.productDetailPropValue)||void 0===l?void 0:l.usePageData)?[2,{productDetailPropValue:this.productDetailPropValue,productDetail:null}]:this.productDetailPropValue.productId?[4,r({input:{productIdList:[this.productDetailPropValue.productId],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId(),locale:i.getCurrentLocale()}})]:[2,null];case 1:return(t=e.sent()).isSuccess&&(null===(n=t.data)||void 0===n?void 0:n.data)?(s=t.data.data).length?(c=s[0]).productOptionSetId?[4,a({id:{eq:c.productOptionSetId}})]:[3,3]:[3,4]:[3,5];case 2:(p=e.sent()).isSuccess&&(null===(d=p.data)||void 0===d?void 0:d.length)&&(c.productOptionSet=p.data[0]),e.label=3;case 3:return V=o.hasVariant,c&&V(c)?(f=c.variants.find((function(t){return t.id===h.productDetailPropValue.variantId})))?(c.selectedVariantValues=null==f?void 0:f.variantValues,[2,{productDetailPropValue:this.productDetailPropValue,productDetail:c}]):[2,null]:(v=c.variants.find((function(t){return t.isActive})),c.selectedVariantValues=(v||c.variants[0]).variantValues,[2,{productDetailPropValue:this.productDetailPropValue,productDetail:c}]);case 4:return[2,{productDetailPropValue:this.productDetailPropValue,productDetail:u()}];case 5:return[2,null]}}))}))},l}();export{l as IkasProductPropValueProvider};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
2
|
+
import IkasPropValueProvider from ".";
|
|
3
|
+
import { IkasProductListPropValue } from "../../models/prop-value/product-list";
|
|
4
|
+
import { IkasProductList } from "../../models/ui";
|
|
5
|
+
export declare type IkasRelatedProductProps = {
|
|
6
|
+
brandIds: string[] | null;
|
|
7
|
+
categoryIds: string[] | null;
|
|
8
|
+
productId: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class IkasProductListPropValueProvider implements IkasPropValueProvider<IkasProductList> {
|
|
11
|
+
private pageType;
|
|
12
|
+
private productListPropValue;
|
|
13
|
+
private pageSpecificData?;
|
|
14
|
+
private relatedProductData?;
|
|
15
|
+
constructor(pageType: IkasThemeJsonPageType, productListPropValue: IkasProductListPropValue, pageSpecificData?: any);
|
|
16
|
+
getValue(): Promise<IkasProductList>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductListType as r,IkasRelatedProductsType as a,IkasProductListSortType as o}from"../../models/ui/product-list/index.js";import{getInitial as s}from"../../models/ui/product-list/init.js";var p=function(){function p(t,i,e){this.relatedProductData=null,this.pageType=t,this.productListPropValue=i,this.pageSpecificData=e,this.relatedProductData=null}return p.prototype.getValue=function(){var p,d;return t(this,void 0,void 0,(function(){var t,u,l,c,n;return i(this,(function(i){switch(i.label){case 0:return this.productListPropValue.productListType===r.ALL&&this.productListPropValue.usePageFilter&&(this.pageType===e.CATEGORY?(l=this.pageSpecificData,u=l.id):this.pageType===e.BRAND&&(c=this.pageSpecificData,t=c.id)),this.productListPropValue.productListType===r.CATEGORY&&this.productListPropValue.category&&(u=this.productListPropValue.category),this.pageType===e.PRODUCT&&this.productListPropValue.productListType===r.RELATED_PRODUCTS&&this.productListPropValue.relatedProductsType&&this.pageSpecificData&&(this.relatedProductData={brandIds:null,categoryIds:null,productId:""},this.productListPropValue.relatedProductsType===a.CATEGORY?this.relatedProductData.categoryIds=this.pageSpecificData.categories.map((function(t){return t.id})):this.relatedProductData.brandIds=[null===(d=null===(p=this.pageSpecificData)||void 0===p?void 0:p.brand)||void 0===d?void 0:d.id],this.relatedProductData.productId=this.pageSpecificData.id),n={data:[],count:0,page:1,limit:this.productListPropValue.initialLimit||10,type:this.productListPropValue.productListType||r.ALL,sort:this.productListPropValue.initialSort||o.LAST_ADDED,productListPropValue:this.productListPropValue,filterBrandId:t,filterCategoryId:u,pageType:this.pageType,pageSpecificData:[e.CATEGORY,e.BRAND].includes(this.pageType)?this.pageSpecificData:void 0,relatedProductData:this.relatedProductData,filters:null,infiniteScrollPage:null},[4,s(n)];case 1:return i.sent(),[2,n]}}))}))},p}();export{p as IkasProductListPropValueProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{getInitial as e}from"../../models/ui/raffle-list/init.js";var n=function(){function n(){}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){switch(i.label){case 0:return[4,e(t={data:[],count:0,page:1,limit:20})];case 1:return i.sent(),[2,t]}}))}))},n}();export{n as IkasRaffleListPropValueProvider};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasRafflePropValue } from "../../models/prop-value/raffle";
|
|
3
|
+
import { IkasRafflePropValueData } from "../types";
|
|
4
|
+
export declare class IkasRafflePropValueProvider implements IkasPropValueProvider<IkasRafflePropValueData | null> {
|
|
5
|
+
private rafflePropValue;
|
|
6
|
+
constructor(propValue: IkasRafflePropValue);
|
|
7
|
+
getValue(): Promise<IkasRafflePropValueData | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{listStorefrontRaffle as a}from"@ikas/storefront-api";import{populateRaffleProducts as l}from"../helpers/raffle.js";import{getPlaceholderRaffle as t}from"../placeholders.js";var o=function(){function o(e){this.rafflePropValue=e}return o.prototype.getValue=function(){var o,f,i;return e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return(null===(o=this.rafflePropValue)||void 0===o?void 0:o.usePageData)?[2,{raffle:null,rafflePropValue:this.rafflePropValue}]:this.rafflePropValue.raffleId?[4,a({id:{eq:this.rafflePropValue.raffleId}})]:[2,null];case 1:return(e=r.sent()).isSuccess&&(null===(i=null===(f=e.data)||void 0===f?void 0:f.data)||void 0===i?void 0:i.length)?(s=e.data.data[0],[4,l([s])]):[2,null];case 2:return r.sent(),[2,{raffle:s||t(),rafflePropValue:this.rafflePropValue}]}}))}))},o}();export{o as IkasRafflePropValueProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.text=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.text]}))}))},i}();export{i as IkasRichTextPropValueProvider};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import IkasPropValueProvider from ".";
|
|
2
|
+
import { IkasSliderPropValueData } from "../types";
|
|
3
|
+
export declare class IkasSliderPropValueProvider implements IkasPropValueProvider<IkasSliderPropValueData> {
|
|
4
|
+
private sliderData;
|
|
5
|
+
constructor(sliderData: IkasSliderPropValueData);
|
|
6
|
+
getValue(): Promise<IkasSliderPropValueData>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.sliderData=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,{value:this.sliderData.value,unit:this.sliderData.unit}]}))}))},n}();export{n as IkasSliderPropValueProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.text=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.text]}))}))},i}();export{i as IkasTextPropValueProvider};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { IkasBlog, IkasBlogCategory, IkasBrand, IkasCategory, IkasProduct, IkasProductOptionSet, IkasRaffle, IkasThemeJsonComponent, IkasThemeJsonCustomData, IkasThemeJsonPageComponent, IkasVariantValue } from "@ikas/storefront-models";
|
|
2
|
+
import { IkasAttributeListPropValue } from "../models/prop-value/attribute-list";
|
|
3
|
+
import { IkasAttributePropValue } from "../models/prop-value/attribute";
|
|
4
|
+
import { IkasBlogCategoryPropValue } from "../models/prop-value/blog-category";
|
|
5
|
+
import { IkasBlogPropValue } from "../models/prop-value/blog";
|
|
6
|
+
import { IkasBrandPropValue } from "../models/prop-value/brand";
|
|
7
|
+
import { IkasCategoryPropValue } from "../models/prop-value/category";
|
|
8
|
+
import { IkasProductPropValue } from "../models/prop-value/product";
|
|
9
|
+
import { IkasRafflePropValue } from "../models/prop-value/raffle";
|
|
10
|
+
export declare class IkasPageComponentPropValue {
|
|
11
|
+
pageComponent: IkasThemeJsonPageComponent;
|
|
12
|
+
component: IkasThemeJsonComponent;
|
|
13
|
+
propValues: Record<string, any>;
|
|
14
|
+
constructor(data: IkasPageComponentPropValue);
|
|
15
|
+
}
|
|
16
|
+
export declare type IkasSimplePageComponentPropValue = {
|
|
17
|
+
pageComponent: {
|
|
18
|
+
id: string;
|
|
19
|
+
componentId: string;
|
|
20
|
+
};
|
|
21
|
+
propValues: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
export declare type IkasAttributeListPropValueData = {
|
|
24
|
+
productDetail: IkasProduct | null;
|
|
25
|
+
attributeListPropValue: IkasAttributeListPropValue;
|
|
26
|
+
};
|
|
27
|
+
export declare type IkasAttributePropValueData = {
|
|
28
|
+
productDetail: IkasProductPropValueProduct | null;
|
|
29
|
+
attributePropValue: IkasAttributePropValue;
|
|
30
|
+
};
|
|
31
|
+
export declare type IkasBlogCategoryPropValueData = {
|
|
32
|
+
blogCategory: IkasBlogCategory | null;
|
|
33
|
+
blogCategoryPropValue: IkasBlogCategoryPropValue;
|
|
34
|
+
};
|
|
35
|
+
export declare type IkasBlogPropValueData = {
|
|
36
|
+
blog: IkasBlog | null;
|
|
37
|
+
blogPropValue: IkasBlogPropValue;
|
|
38
|
+
};
|
|
39
|
+
export declare type IkasBrandPropValueData = {
|
|
40
|
+
brand: IkasBrand | null;
|
|
41
|
+
brandPropValue: IkasBrandPropValue;
|
|
42
|
+
};
|
|
43
|
+
export declare type IkasCategoryPropValueData = {
|
|
44
|
+
category: IkasCategory | null;
|
|
45
|
+
categoryPropValue: IkasCategoryPropValue;
|
|
46
|
+
};
|
|
47
|
+
export declare type IkasCustomDataPropValueData = {
|
|
48
|
+
value: any;
|
|
49
|
+
customData: IkasThemeJsonCustomData;
|
|
50
|
+
};
|
|
51
|
+
export declare type IkasProductPropValueProduct = {
|
|
52
|
+
productOptionSet?: IkasProductOptionSet | null;
|
|
53
|
+
selectedVariantValues?: IkasVariantValue[] | null;
|
|
54
|
+
} & IkasProduct;
|
|
55
|
+
export declare type IkasProductPropValueData = {
|
|
56
|
+
productDetailPropValue: IkasProductPropValue;
|
|
57
|
+
productDetail: IkasProductPropValueProduct | null;
|
|
58
|
+
};
|
|
59
|
+
export declare type IkasRafflePropValueData = {
|
|
60
|
+
raffle: IkasRaffle | null;
|
|
61
|
+
rafflePropValue: IkasRafflePropValue;
|
|
62
|
+
};
|
|
63
|
+
export declare type IkasSliderPropValueData = {
|
|
64
|
+
value: number;
|
|
65
|
+
unit: string | null;
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeAutoObservable as o}from"mobx";var p=function(p){this.pageComponent=p.pageComponent,this.component=p.component,this.propValues=p.propValues||{},o(this)};export{p as IkasPageComponentPropValue};
|