@ikas/storefront 4.15.0-beta.121 → 4.15.0-beta.122
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{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as d}from"../../helpers/index.js";import{ProductListTypeEnum as a,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from"../../../../../../swiper/modules/navigation.mjs.js";import m from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as v,SwiperSlide as g}from"../../../../../../swiper/swiper-react.mjs.js";import p from"../../assets/left-arrow.js";import f from"../../assets/right-arrow.js";import{ProductActionTypeEnum as b}from"../../models/modal/step/elements/product/detail-settings/index.js";var h=l((function(l){var h,x=l.element,y=l.products,E=l.popup,C=l.editModeChildren,w=l.isPreviewMode,P=l.sfProps,S=l.onClose,j=i.useState(null),R=j[0],z=j[1],W=i.useState(!1),A=W[0],I=W[1],_=i.useState(!1),D=_[0],F=_[1],k=x,T=[];if(y&&(T=k.listType===a.SPECIFIC?(null===(h=k.variantPairs)||void 0===h?void 0:h.length)?y.slice().sort((function(t,e){return k.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-k.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],y,!0)),T.length>k.maxProductsToShow&&(T.length=k.maxProductsToShow),!(T&&T.length||!E.isPreviewMode)&&C)return C;if(!T||!T.length)return null;k.gapBetweenProductElements;var L=k.productDetailSettings.image,N=k.productDetailSettings.button,B=k.buttonSettings,M=k.productDetailSettings.discountRatio,O=k.productDetailSettings.finalPrice,U=k.productDetailSettings.originalPrice,H=k.productDetailSettings.name,V=r(k.horizontalAlignment),$=1;k.layout===c.ONE_COLUMN?$=1:k.layout===c.TWO_COLUMN?$=2:k.layout===c.THREE_COLUMN&&($=3);var q={padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),backgroundColor:k.productBgColor,width:"100%",height:"max-content"},G={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},J={display:"flex",justifyContent:V,alignItems:"center",width:"100%",backgroundColor:null==L?void 0:L.bgColor,borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},K={width:"".concat(null==L?void 0:L.maxWidth,"%"),objectFit:"contain",borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},Q={display:"flex",flexDirection:"column",width:"100%"},X={display:"flex",flexDirection:"column"},Y={backgroundColor:null==H?void 0:H.bgColor,color:null==H?void 0:H.color,fontFamily:H?d(H.fontFamily):void 0,fontSize:null==H?void 0:H.fontSize,fontWeight:null==H?void 0:H.fontWeight,padding:"".concat(null==H?void 0:H.verticalPadding,"px ").concat(null==H?void 0:H.horizontalPadding,"px"),width:"100%",textAlign:null==H?void 0:H.horizontalAlignment,border:"".concat(null==H?void 0:H.borderWidth,"px ").concat(null==H?void 0:H.borderStyle," ").concat(null==H?void 0:H.borderColor),borderRadius:null==H?void 0:H.borderRadius},Z={backgroundColor:null==M?void 0:M.bgColor,color:null==M?void 0:M.color,fontFamily:M?d(M.fontFamily):void 0,fontSize:null==M?void 0:M.fontSize,fontWeight:null==M?void 0:M.fontWeight,padding:"".concat(null==M?void 0:M.verticalPadding,"px ").concat(null==M?void 0:M.horizontalPadding,"px"),width:"100%",textAlign:null==M?void 0:M.horizontalAlignment,border:"".concat(null==M?void 0:M.borderWidth,"px ").concat(null==M?void 0:M.borderStyle," ").concat(null==M?void 0:M.borderColor),borderRadius:null==M?void 0:M.borderRadius},tt={textDecoration:"line-through",backgroundColor:null==U?void 0:U.bgColor,color:null==U?void 0:U.color,fontFamily:U?d(U.fontFamily):void 0,fontSize:null==U?void 0:U.fontSize,fontWeight:null==U?void 0:U.fontWeight,padding:"".concat(null==U?void 0:U.verticalPadding,"px ").concat(null==U?void 0:U.horizontalPadding,"px"),width:"100%",textAlign:null==U?void 0:U.horizontalAlignment,border:"".concat(null==U?void 0:U.borderWidth,"px ").concat(null==U?void 0:U.borderStyle," ").concat(null==U?void 0:U.borderColor),borderRadius:null==U?void 0:U.borderRadius},et={backgroundColor:null==O?void 0:O.bgColor,color:null==O?void 0:O.color,fontFamily:O?d(O.fontFamily):void 0,fontSize:null==O?void 0:O.fontSize,fontWeight:null==O?void 0:O.fontWeight,padding:"".concat(null==O?void 0:O.verticalPadding,"px ").concat(null==O?void 0:O.horizontalPadding,"px"),width:"100%",textAlign:null==O?void 0:O.horizontalAlignment,border:"".concat(null==O?void 0:O.borderWidth,"px ").concat(null==O?void 0:O.borderStyle," ").concat(null==O?void 0:O.borderColor),borderRadius:null==O?void 0:O.borderRadius},ot={width:"".concat(B.width,"%"),minWidth:"fit-content"},nt=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===$?{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),it={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return i.createElement("div",{style:q},i.createElement(v,{onSwiper:z,modules:[u,m],spaceBetween:k.gapBetweenProducts,slidesPerView:$,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},T.map((function(t,e){return i.createElement(g,{style:{height:"auto"},key:t.variantId},i.createElement("div",{style:G,onClick:function(){return function(t){return o(void 0,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return w||!t.url?[3,4]:(null===(o=k.productDetailSettings.button)||void 0===o?void 0:o.action)===b.ADD_TO_CART&&P?[4,P.addProductToCart(t)]:[3,2];case 1:return n.sent(),[3,3];case 2:(e=document.createElement("a")).href=t.url,e.target="
|
|
1
|
+
import{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as d}from"../../helpers/index.js";import{ProductListTypeEnum as a,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from"../../../../../../swiper/modules/navigation.mjs.js";import m from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as v,SwiperSlide as g}from"../../../../../../swiper/swiper-react.mjs.js";import p from"../../assets/left-arrow.js";import f from"../../assets/right-arrow.js";import{ProductActionTypeEnum as b}from"../../models/modal/step/elements/product/detail-settings/index.js";var h=l((function(l){var h,x=l.element,y=l.products,E=l.popup,C=l.editModeChildren,w=l.isPreviewMode,P=l.sfProps,S=l.onClose,j=i.useState(null),R=j[0],z=j[1],W=i.useState(!1),A=W[0],I=W[1],_=i.useState(!1),D=_[0],F=_[1],k=x,T=[];if(y&&(T=k.listType===a.SPECIFIC?(null===(h=k.variantPairs)||void 0===h?void 0:h.length)?y.slice().sort((function(t,e){return k.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-k.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],y,!0)),T.length>k.maxProductsToShow&&(T.length=k.maxProductsToShow),!(T&&T.length||!E.isPreviewMode)&&C)return C;if(!T||!T.length)return null;k.gapBetweenProductElements;var L=k.productDetailSettings.image,N=k.productDetailSettings.button,B=k.buttonSettings,M=k.productDetailSettings.discountRatio,O=k.productDetailSettings.finalPrice,U=k.productDetailSettings.originalPrice,H=k.productDetailSettings.name,V=r(k.horizontalAlignment),$=1;k.layout===c.ONE_COLUMN?$=1:k.layout===c.TWO_COLUMN?$=2:k.layout===c.THREE_COLUMN&&($=3);var q={padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),backgroundColor:k.productBgColor,width:"100%",height:"max-content"},G={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},J={display:"flex",justifyContent:V,alignItems:"center",width:"100%",backgroundColor:null==L?void 0:L.bgColor,borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},K={width:"".concat(null==L?void 0:L.maxWidth,"%"),objectFit:"contain",borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},Q={display:"flex",flexDirection:"column",width:"100%"},X={display:"flex",flexDirection:"column"},Y={backgroundColor:null==H?void 0:H.bgColor,color:null==H?void 0:H.color,fontFamily:H?d(H.fontFamily):void 0,fontSize:null==H?void 0:H.fontSize,fontWeight:null==H?void 0:H.fontWeight,padding:"".concat(null==H?void 0:H.verticalPadding,"px ").concat(null==H?void 0:H.horizontalPadding,"px"),width:"100%",textAlign:null==H?void 0:H.horizontalAlignment,border:"".concat(null==H?void 0:H.borderWidth,"px ").concat(null==H?void 0:H.borderStyle," ").concat(null==H?void 0:H.borderColor),borderRadius:null==H?void 0:H.borderRadius},Z={backgroundColor:null==M?void 0:M.bgColor,color:null==M?void 0:M.color,fontFamily:M?d(M.fontFamily):void 0,fontSize:null==M?void 0:M.fontSize,fontWeight:null==M?void 0:M.fontWeight,padding:"".concat(null==M?void 0:M.verticalPadding,"px ").concat(null==M?void 0:M.horizontalPadding,"px"),width:"100%",textAlign:null==M?void 0:M.horizontalAlignment,border:"".concat(null==M?void 0:M.borderWidth,"px ").concat(null==M?void 0:M.borderStyle," ").concat(null==M?void 0:M.borderColor),borderRadius:null==M?void 0:M.borderRadius},tt={textDecoration:"line-through",backgroundColor:null==U?void 0:U.bgColor,color:null==U?void 0:U.color,fontFamily:U?d(U.fontFamily):void 0,fontSize:null==U?void 0:U.fontSize,fontWeight:null==U?void 0:U.fontWeight,padding:"".concat(null==U?void 0:U.verticalPadding,"px ").concat(null==U?void 0:U.horizontalPadding,"px"),width:"100%",textAlign:null==U?void 0:U.horizontalAlignment,border:"".concat(null==U?void 0:U.borderWidth,"px ").concat(null==U?void 0:U.borderStyle," ").concat(null==U?void 0:U.borderColor),borderRadius:null==U?void 0:U.borderRadius},et={backgroundColor:null==O?void 0:O.bgColor,color:null==O?void 0:O.color,fontFamily:O?d(O.fontFamily):void 0,fontSize:null==O?void 0:O.fontSize,fontWeight:null==O?void 0:O.fontWeight,padding:"".concat(null==O?void 0:O.verticalPadding,"px ").concat(null==O?void 0:O.horizontalPadding,"px"),width:"100%",textAlign:null==O?void 0:O.horizontalAlignment,border:"".concat(null==O?void 0:O.borderWidth,"px ").concat(null==O?void 0:O.borderStyle," ").concat(null==O?void 0:O.borderColor),borderRadius:null==O?void 0:O.borderRadius},ot={width:"".concat(B.width,"%"),minWidth:"fit-content"},nt=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===$?{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),it={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return i.createElement("div",{style:q},i.createElement(v,{onSwiper:z,modules:[u,m],spaceBetween:k.gapBetweenProducts,slidesPerView:$,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},T.map((function(t,e){return i.createElement(g,{style:{height:"auto"},key:t.variantId},i.createElement("div",{style:G,onClick:function(){return function(t){return o(void 0,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return w||!t.url?[3,4]:(null===(o=k.productDetailSettings.button)||void 0===o?void 0:o.action)===b.ADD_TO_CART&&P?[4,P.addProductToCart(t)]:[3,2];case 1:return n.sent(),[3,3];case 2:(e=document.createElement("a")).href=t.url,e.target="_self",e.click(),n.label=3;case 3:S(!0),n.label=4;case 4:return[2]}}))}))}(t)}},i.createElement("div",{style:Q},!!L&&t.imageURL&&i.createElement("div",{style:J},i.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:K})),(!!H||!!M)&&i.createElement("div",{style:X},!!H&&i.createElement("div",{style:Y},t.name),!!M&&!!t.discountPrice&&i.createElement("div",{style:Z},t.$discountRatio)),(!!U||!!O)&&i.createElement("div",null,!!U&&!!t.discountPrice&&i.createElement("div",{style:tt},t.price),!!O&&i.createElement("div",{style:et},t.discountPrice||t.price))),!!N&&i.createElement("div",{style:ot}," ",i.createElement(s,{element:B})," ")))})),i.createElement("div",{style:nt},i.createElement("div",{className:"custom-prev-button",style:e(e({},it),A?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(R.slidePrev(),F(R.isEnd),I(R.isBeginning))}},i.createElement(p,null)),i.createElement("div",{className:"custom-next-button",style:e(e({},it),D?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(R.slideNext(),F(R.isEnd),I(R.isBeginning))}},i.createElement(f,null)))))}));export{h as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.15.0-beta.
|
|
3
|
+
"version": "4.15.0-beta.122",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ikas/popup-renderer": "^1.0.
|
|
20
|
+
"@ikas/popup-renderer": "^1.0.148",
|
|
21
21
|
"swiper": "11.0.6"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@ikas/storefront-api": "^4.15.0-beta.
|
|
25
|
-
"@ikas/storefront-config": "^4.15.0-beta.
|
|
26
|
-
"@ikas/storefront-model-functions": "^4.15.0-beta.
|
|
27
|
-
"@ikas/storefront-models": "^4.15.0-beta.
|
|
28
|
-
"@ikas/storefront-providers": "^4.15.0-beta.
|
|
24
|
+
"@ikas/storefront-api": "^4.15.0-beta.122",
|
|
25
|
+
"@ikas/storefront-config": "^4.15.0-beta.122",
|
|
26
|
+
"@ikas/storefront-model-functions": "^4.15.0-beta.122",
|
|
27
|
+
"@ikas/storefront-models": "^4.15.0-beta.122",
|
|
28
|
+
"@ikas/storefront-providers": "^4.15.0-beta.122",
|
|
29
29
|
"@ikas/localized-address": "1.0.0-beta.3",
|
|
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.3",
|
|
63
|
-
"@ikas/storefront-api": "^4.15.0-beta.
|
|
64
|
-
"@ikas/storefront-config": "^4.15.0-beta.
|
|
65
|
-
"@ikas/storefront-model-functions": "^4.15.0-beta.
|
|
66
|
-
"@ikas/storefront-models": "^4.15.0-beta.
|
|
67
|
-
"@ikas/storefront-providers": "^4.15.0-beta.
|
|
63
|
+
"@ikas/storefront-api": "^4.15.0-beta.122",
|
|
64
|
+
"@ikas/storefront-config": "^4.15.0-beta.122",
|
|
65
|
+
"@ikas/storefront-model-functions": "^4.15.0-beta.122",
|
|
66
|
+
"@ikas/storefront-models": "^4.15.0-beta.122",
|
|
67
|
+
"@ikas/storefront-providers": "^4.15.0-beta.122",
|
|
68
68
|
"mobx": "^6.1.3",
|
|
69
69
|
"mobx-react-lite": "^3.1.5",
|
|
70
70
|
"next": "12.2.0",
|