@gem-sdk/components 18.3.0 → 18.4.2
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/dist/cjs/estimate-delivery/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +16 -14
- package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
- package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/dist/esm/estimate-delivery/common/helpers.js +1 -1
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +28 -26
- package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
- package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../text/components/TextInline.js"),t=require("../../helpers.js"),a=require("@gem-sdk/system"),r=require("./styles.js"),s=require("../settings/configs/translate.js");const u=e=>e?"number"==typeof e?e:Number(e.split("days")[0]):0,l=e=>{let t=new Date(Date.now()),a=u(e?.estimateTime),r=u(e?.minEstimate),s=u(e?.maxEstimate),l=e?.typeFormat==="Custom"?e?.customFormat:e?.typeFormat;if(!l)return"";if(e?.typeEstimate===o.SPECIFIC){let e=`${m(y(a),l)}`;return e}m(t);let n=`${m(y(r),l)} - ${m(y(s),l)}`;return n},n=e=>{switch(e?.htmlTag){case 1:return"h1";case 2:return"h2";case 3:return"h3";case 4:return"h4";case 5:return"h5";case 6:return"h6";default:return"div"}},i=({type:u,styles:n,setting:i,builderProps:o,pageContext:m})=>{let y="React"===u,d=a.createClass({"estimate-date-main":!0}),c=y||m?.isPreviewing?i?.customText:t.getDynamicSourceLocales({val:i?.customText,uid:o?.uid,settingId:t.createSettingId({id:s.EstimateDate?.customText?.id}),pageContext:m??{},isCapitalize:n?.typo?.attrs?.transform==="capitalize"}).toString();return`${i?.enableCustomText===!1?"":e.default({styles:r.getStyleEstimateDate(n,"typoCustom"),setting:{text:c},elementAttrs:{debugText:JSON.stringify({pageContext:m,setting:i,isReact:y,builderProps:o,textWithTranslate:c}).replaceAll("'","'")}})} ${e.default({styles:r.getStyleEstimateDate(n,"typoDate"),setting:{text:l(i)},className:d})}`},o={SPECIFIC:"specific",RANGE:"range"},m=(e,t="%B %d, %Y")=>{let a=e.getMonth()+1,r=e.getDate(),s=e.getFullYear(),u=[{type:"%a",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()]},{type:"%A",value:["Sunday","Monday","
|
|
1
|
+
"use strict";var e=require("../../text/components/TextInline.js"),t=require("../../helpers.js"),a=require("@gem-sdk/system"),r=require("./styles.js"),s=require("../settings/configs/translate.js");const u=e=>e?"number"==typeof e?e:Number(e.split("days")[0]):0,l=e=>{let t=new Date(Date.now()),a=u(e?.estimateTime),r=u(e?.minEstimate),s=u(e?.maxEstimate),l=e?.typeFormat==="Custom"?e?.customFormat:e?.typeFormat;if(!l)return"";if(e?.typeEstimate===o.SPECIFIC){let e=`${m(y(a),l)}`;return e}m(t);let n=`${m(y(r),l)} - ${m(y(s),l)}`;return n},n=e=>{switch(e?.htmlTag){case 1:return"h1";case 2:return"h2";case 3:return"h3";case 4:return"h4";case 5:return"h5";case 6:return"h6";default:return"div"}},i=({type:u,styles:n,setting:i,builderProps:o,pageContext:m})=>{let y="React"===u,d=a.createClass({"estimate-date-main":!0}),c=y||m?.isPreviewing?i?.customText:t.getDynamicSourceLocales({val:i?.customText,uid:o?.uid,settingId:t.createSettingId({id:s.EstimateDate?.customText?.id}),pageContext:m??{},isCapitalize:n?.typo?.attrs?.transform==="capitalize"}).toString();return`${i?.enableCustomText===!1?"":e.default({styles:r.getStyleEstimateDate(n,"typoCustom"),setting:{text:c},elementAttrs:{debugText:JSON.stringify({pageContext:m,setting:i,isReact:y,builderProps:o,textWithTranslate:c}).replaceAll("'","'")}})} ${e.default({styles:r.getStyleEstimateDate(n,"typoDate"),setting:{text:l(i)},className:d})}`},o={SPECIFIC:"specific",RANGE:"range"},m=(e,t="%B %d, %Y")=>{let a=e.getMonth()+1,r=e.getDate(),s=e.getFullYear(),u=[{type:"%a",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()]},{type:"%A",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]},{type:"%d",value:r.toString().padStart(2,"0")},{type:"%b",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a-1]},{type:"%B",value:["January","February","March","April","May","June","July","August","September","October","November","December"][a-1]},{type:"%m",value:a.toString().padStart(2,"0")},{type:"%y",value:s.toString().slice(-2)},{type:"%Y",value:s},{type:"%sf",value:function(e){let t=Math.floor(e/10)%10,a=e%10;return 1===a&&1!==t?"st":2===a&&1!==t?"nd":3===a&&1!==t?"rd":"th"}(r)}];return u.forEach(e=>{t=t.replaceAll(e?.type,e?.value?.toString()||"")}),t},y=e=>{let t=new Date,a=new Date(t);return a.setDate(t.getDate()+Number(e)),a};exports.ESTIMATE_DAYS=o,exports.OUT_OF_STOCK={SHOW:"show",HIDE:"hide"},exports.getDayFormat=m,exports.getFutureDay=y,exports.getNewSetting=({type:e,styles:t,setting:a,builderProps:r,pageContext:s})=>{let u="React"===e,l=i({type:e,styles:t,setting:a,builderProps:r,pageContext:s});return{text:l,htmlTag:n(a),globalSize:a?.globalSize,background:a?.background,...!u&&{isForceValue:!0}}},exports.listFormatDate=()=>{let e=new Date(Date.now());return{FORMAT_1:{Label:m(e,"%b %d"),value:"%b %d"},FORMAT_2:{Label:m(e,"%b %d, %Y"),value:"%b %d, %Y"},FORMAT_3:{Label:m(e,"%a, %b %d"),value:"%a, %b %d"},FORMAT_4:{Label:m(e,"%d/%m/%Y"),value:"%d/%m/%Y"},FORMAT_5:{Label:m(e,"%Y/%m/%d"),value:"%Y/%m/%d"},FORMAT_6:{Label:"Custom"}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/common.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/common.js"),i=require("./components/feature-gallery/FeatureImageWithGallery.liquid.js"),r=require("./components/gallery-carousel/GalleryCarousel.liquid.js"),s=require("./components/gallery-grid/GalleryGrid.liquid.js"),a=require("../../../helpers.js"),o=require("./common/productGallery.js"),l=require("./composables/getProductImagesClassName.js"),d=require("./composables/getProductImagesStyles.js"),u=require("@gem-sdk/system"),p=require("./common/getBorderActiveCss.js"),g=require("../../helpers/function.js");exports.default=n=>{let c=t.setDefaultWhenUndefineSetting(n),{setting:m,styles:f,builderProps:y,style:$}=c,{rawChildren:S,pageContext:I}=n,{enableLazyLoadImage:h}=I??{},v={...m,...f},q=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(y?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(a.filterPageContext(I))},
|
|
@@ -9,33 +9,35 @@
|
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,j=u.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:C,isRenderGalleryGrid:F}=t.getConditionRenderGalleryImages(
|
|
13
|
-
${
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
`,j=u.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:C,isRenderGalleryGrid:F}=t.getConditionRenderGalleryImages(v?.position,m?.type),O=F?{}:u.createAttr({"data-only-image":u.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:P,productImagesGalleryClasses:L}=l.getProductImagesClassName(n),b=u.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),D=u.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:G,wrapContainerStyleOnlyOneImage:z,galleryImageStyle:A}=d.getProductImagesStyles(v),N=o.getShapeByLayout({shape:v.shape,shapeForBottom:v.shapeForBottom,shapeFor1Col:v.shapeFor1Col,shapeFor2Col:v.shapeFor2Col,shapeForFtOnly:v.shapeForFtOnly,shapeForInsideBottom:v.shapeForInsideBottom??o.sizeSettingDefaultForNewLayout,shapeForInside:v.shapeForInside??o.sizeSettingDefaultForNewLayout},v.position),_=t.getStyleInsideLayout(v.position,N,v?.spacing),B=i=>{let r=t.getProductBadgeVisibilityStyle(v?.position,i);return e.template`
|
|
13
|
+
<div style="${g.getStyleOfObject(r)}">
|
|
14
|
+
${e.WrapRenderChildren({uid:y?.uid||"",customProps:S?.[0].customProps},S?.map(t=>{if(t)return e.template`${e.RenderChildren({...t,isInsideProductImage:!0,imageData:{imageShape:f?.ftShape,imageAlign:f?.align,imageLayout:f?.position},dotData:{dotSize:m?.ftDotSize,dotGapToCarousel:m?.ftDotGapToCarousel,dotStyle:m?.ftDotStyle}})}`}))}
|
|
15
|
+
</div>
|
|
16
|
+
`};return e.template`
|
|
17
|
+
${u.If(m?.borderActive?.border!=="none",u.LiquidIf("product.media.size > 1",`<style>${p.getBorderActiveCss({settings:v,uid:y?.uid,type:"Liquid"})}</style>`),"")}
|
|
16
18
|
${u.Liquid(`
|
|
17
19
|
{% assign featured_image = product.featured_image %}
|
|
18
20
|
${u.LiquidIf("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
19
21
|
`)}
|
|
20
22
|
<gp-product-images-v3
|
|
21
|
-
gp-data='${
|
|
23
|
+
gp-data='${q}'
|
|
22
24
|
${{...j}}
|
|
23
25
|
style="${{...$}}"
|
|
24
26
|
class="${P}"
|
|
25
27
|
>
|
|
26
28
|
<div
|
|
27
|
-
class="${u.LiquidIf("product.media.size > 1",`${
|
|
28
|
-
style="${u.LiquidIf("product.media.size > 1",
|
|
29
|
+
class="${u.LiquidIf("product.media.size > 1",`${b}`,`${D}`)}"
|
|
30
|
+
style="${u.LiquidIf("product.media.size > 1",g.getStyleOfObject(G),g.getStyleOfObject(z))}"
|
|
29
31
|
>
|
|
30
|
-
${
|
|
32
|
+
${i.default({builderPropUID:`gp-carousel-${y?.uid}`,...v,children:B("feature"),enableLazyLoadImage:h})}
|
|
31
33
|
${u.If(!C,e.template`
|
|
32
34
|
<div
|
|
33
|
-
class="${
|
|
34
|
-
style="${
|
|
35
|
-
${{...
|
|
35
|
+
class="${L}"
|
|
36
|
+
style="${g.getStyleOfObject(A)}"
|
|
37
|
+
${{...O}}
|
|
36
38
|
>
|
|
37
|
-
${u.LiquidIf("product.media.size > 1",
|
|
38
|
-
${u.If(F,s.default({builderPropUID:y?.uid,wrapperStyle:{..._},children:B(),...
|
|
39
|
+
${u.LiquidIf("product.media.size > 1",r.default({builderPropUID:`gp-gallery-${y?.uid}`,...v,enableLazyLoadImage:h}))}
|
|
40
|
+
${u.If(F,s.default({builderPropUID:y?.uid,wrapperStyle:{..._},children:B("grid"),...v,enableLazyLoadImage:h}))}
|
|
39
41
|
</div>
|
|
40
42
|
`)}
|
|
41
43
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@gem-sdk/core");const t=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core");const t=["one-col","two-col"],o=e=>"one-col"===e||"two-col"===e,r=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},i=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let i=e.getResponsiveValueByScreen(t,r)?.shapeValue;if(i)o={...o,[r]:i};else{let i=e.getResponsiveValueByScreen(t,r)?.shape;switch(i){case"square":o={...o,[r]:"1/1"};break;case"vertical":o={...o,[r]:"3/4"};break;case"horizontal":o={...o,[r]:"4/3"};break;case"original":o={...o,[r]:""}}}}),e.makeAspectRatio(o)},l=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},s=(t,r)=>{let i=e.getResponsiveValueByScreen(t,r);return o(i)},n=e=>{let t=e.match(/\d+/g);return t?t[0]:e};exports.checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",i=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==i||"0px"!==l},exports.convertSpacing=e=>{if(!e)return{desktop:5};let t=r(e.desktop,5),o=r(e.tablet,t),i=r(e.mobile,o);return{desktop:t,tablet:o,mobile:i}},exports.convertSpacingForIndisdeLayout=l,exports.convertUnitToNumber=r,exports.getAspectRatio=i,exports.getConditionRenderGalleryImages=(t,r)=>{let i=!0,l=!1;return["desktop","mobile","tablet"].forEach(s=>{let n=e.getResponsiveValueByScreen(t,s),a=e.getResponsiveValueByScreen(r,s);n&&"only-feature"!==n&&(i=!1),(o(n)||"images"===a)&&(l=!0)}),{isOnlyFeatureAllDevices:i,isRenderGalleryGrid:l}},exports.getDisplayStyle=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},exports.getPaddingBottomByShapeSetting=t=>{let o=i(t),r={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(i=>{let l=e.getResponsiveValueByScreen(t,i),s=l?.height,a=l?.width||"",p=n(s||""),u=a.toString().match(/px/g)?n(a):a;if(s&&a&&!isNaN(Number(p))&&!isNaN(Number(u))){r={...r,[i]:`${Number(p)/Number(u)*100}%`};return}if(s&&!isNaN(Number(p))){r={...r,[i]:s};return}let d=o?.[i]!=="auto"&&o?.[i]?o?.[i]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";r={...r,[i]:`calc((${d})*100%)`}}),r},exports.getProductBadgeVisibilityStyle=(t,o="feature")=>{let r={desktop:"none",tablet:"none",mobile:"none"};return e.DEVICES.forEach(e=>{let i=s(t,e);r[e]=("grid"===o?i:!i)?"block":"none"}),e.makeStyleResponsive("d",r)},exports.getSrcImage=e=>`{{${e} | image_url: width: 480}} 480w, {{${e} | image_url: width: 768}} 768w, {{${e} | image_url: width: 1024}} 1024w, {{${e} | image_url: width: 1440}} 1440w`,exports.getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let r=!1;e.DEVICES.forEach(i=>{let l=e.getResponsiveValueByScreen(t.position,i),s=e.getResponsiveValueByScreen(t.ratioLayout,i),n=e.getResponsiveValueByScreen(t.ratioLayoutRight,i),a="desktop"===i?"--gtc":`--gtc-${i}`,p="desktop"===i?"--gtr":`--gtr-${i}`,u="left"===l?s:n,d=["left","right"].includes(l||"");d&&u?(r=!0,Object.assign(o={...o,[a]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[p]:"fit-content(0)"})):r&&Object.assign(o,{[p]:"unset"})})}return o},exports.getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(r=>{let i=e.getResponsiveValueByScreen(t.position,r),l="desktop"===r?"--o":`--o-${r}`;o={...o,[l]:"left"===i?"1":"0"}}),o},exports.getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(r=>{let i=e.getResponsiveValueByScreen(t.position,r),l="desktop"===r?"--o":`--o-${r}`;o={...o,[l]:"left"===i?"0":"1"}}),o},exports.getStyleInsideLayout=(o,r,i)=>{let s={},n={},a={},p={},u={},d={};return["desktop","mobile","tablet"].forEach(c=>{let m=e.getResponsiveValueByScreen(o,c),g=e.getResponsiveValueByScreen(r,c)?.width,b=e.getResponsiveValueByScreen(i,c);if(s={...s,[c]:["inside-bottom","inside-left","inside-right"].includes(m)?"absolute":"static"},["inside-bottom"].includes(m)){let e=l(b);g=`calc(100% - ${e})`}["bottom-center",...t].includes(m)&&(g="100%"),a={...a,[c]:"inside-bottom"===m?`${b}`:"auto"},p={...p,[c]:["inside-left","inside-right"].includes(m)?`${b}`:"auto"},d={...d,[c]:["inside-bottom","inside-left"].includes(m)?`${b}`:"auto"},u={...u,[c]:"inside-right"===m?`${b}`:"auto"},n={...n,[c]:g}}),{...e.makeStyleResponsive("pos",s),...e.makeStyleResponsive("w",e.removeNullUndefined(n)),...e.makeStyleResponsive("bottom",e.removeNullUndefined(a)),...e.makeStyleResponsive("top",e.removeNullUndefined(p)),...e.makeStyleResponsive("left",e.removeNullUndefined(d)),...e.makeStyleResponsive("right",e.removeNullUndefined(u))}},exports.getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},exports.setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}});
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
${i.Liquid("{%- assign optionRendered = false -%}")}
|
|
3
3
|
${i.Liquid("{%- assign swatches = shop.metafields.GEMPAGES.swatchesJSONFormat.value -%}")}
|
|
4
4
|
|
|
5
|
+
${i.Liquid(`{%- assign variantPresetString = "${r}" -%}
|
|
6
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
7
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
8
|
+
{%- assign type = 'dropdown' -%}
|
|
9
|
+
{% for item in items %}
|
|
10
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
11
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
12
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% endfor %}`)}
|
|
14
|
+
|
|
5
15
|
${i.Liquid(`{% for swatch in swatches %}
|
|
6
16
|
{%- assign optionTitle = swatch.optionTitle -%}
|
|
7
17
|
{%- assign optionType = swatch.optionType -%}
|
|
@@ -21,21 +31,10 @@
|
|
|
21
31
|
{%- assign imageUrls = imageUrlsString | split: '${s.OPTION_VALUES_DELIMITER}' | slice: 0, imageUrlsString.size -%}
|
|
22
32
|
|
|
23
33
|
{% if optionTitle == option.name %}
|
|
24
|
-
{%- assign variantPresetString = "${r}" -%}
|
|
25
|
-
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
26
|
-
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
27
|
-
{%- assign type = 'dropdown' -%}
|
|
28
|
-
|
|
29
|
-
{% for item in items %}
|
|
30
|
-
{%- assign itemPreset = item | split: '($1)' -%}
|
|
31
|
-
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
32
|
-
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
33
|
-
{% endfor %}
|
|
34
34
|
{%- assign optionRendered = true -%}
|
|
35
|
-
|
|
36
35
|
${t({showDropdown:!0})}
|
|
37
36
|
{% endif %}
|
|
38
37
|
{% endfor %}`)}
|
|
39
38
|
|
|
40
|
-
${i.LiquidIf("optionRendered == false",t({showDropdown:!
|
|
39
|
+
${i.LiquidIf("optionRendered == false",t({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
41
40
|
`};
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
${i.Liquid("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
|
|
4
4
|
${i.Liquid("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
|
|
5
5
|
|
|
6
|
+
${i.Liquid(`{%- assign variantPresetString = "${a}" -%}
|
|
7
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
8
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
9
|
+
{%- assign type = 'dropdown' -%}
|
|
10
|
+
{% for item in items %}
|
|
11
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
12
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
14
|
+
{% endfor %}`)}
|
|
15
|
+
|
|
6
16
|
${i.LiquidFor("swatchesItem in swatchesItems",`
|
|
7
17
|
${i.Liquid('{%- assign colorArraysString = "" -%}')}
|
|
8
18
|
${i.Liquid('{%- assign labelsString = "" -%}')}
|
|
@@ -48,19 +58,10 @@
|
|
|
48
58
|
${i.Liquid("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
|
|
49
59
|
|
|
50
60
|
${i.LiquidIf("optionTitle == option.name",`
|
|
51
|
-
${i.Liquid(`{%- assign variantPresetString = "${a}" -%}`)}
|
|
52
|
-
${i.Liquid('{%- assign optionName = option.name | replace: "\'", "'" | replace: \'"\', """ -%}')}
|
|
53
|
-
${i.Liquid("{%- assign items = variantPresetString | split:'($2)' -%}")}
|
|
54
|
-
${i.Liquid("{%- assign type = 'dropdown' -%}")}
|
|
55
|
-
${i.LiquidFor("item in items",`
|
|
56
|
-
${i.Liquid("{%- assign itemPreset = item | split:'($1)' -%}")}
|
|
57
|
-
${i.LiquidIf("itemPreset[0] == optionName",i.Liquid("{%- assign type = itemPreset[1] -%}"))}
|
|
58
|
-
${i.LiquidIf('itemPreset[0] == "base"',i.Liquid("{%- assign type = itemPreset[1] -%}"))}
|
|
59
|
-
`)}
|
|
60
61
|
${i.Liquid("{%- assign optionRendered = true -%}")}
|
|
61
62
|
${t({showDropdown:!0})}
|
|
62
63
|
`)}
|
|
63
64
|
`)}
|
|
64
65
|
|
|
65
|
-
${i.LiquidIf("optionRendered == false",t({showDropdown:!
|
|
66
|
+
${i.LiquidIf("optionRendered == false",t({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
66
67
|
`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../text/components/TextInline.js";import{getDynamicSourceLocales as t,createSettingId as a}from"../../helpers.js";import{createClass as r}from"@gem-sdk/system";import{getStyleEstimateDate as u}from"./styles.js";import{EstimateDate as l}from"../settings/configs/translate.js";let
|
|
1
|
+
import e from"../../text/components/TextInline.js";import{getDynamicSourceLocales as t,createSettingId as a}from"../../helpers.js";import{createClass as r}from"@gem-sdk/system";import{getStyleEstimateDate as u}from"./styles.js";import{EstimateDate as l}from"../settings/configs/translate.js";let s=e=>e?"number"==typeof e?e:Number(e.split("days")[0]):0,n=e=>{let t=new Date(Date.now()),a=s(e?.estimateTime),r=s(e?.minEstimate),u=s(e?.maxEstimate),l=e?.typeFormat==="Custom"?e?.customFormat:e?.typeFormat;if(!l)return"";if(e?.typeEstimate===d.SPECIFIC){let e=`${p(g(a),l)}`;return e}p(t);let n=`${p(g(r),l)} - ${p(g(u),l)}`;return n},i=e=>{switch(e?.htmlTag){case 1:return"h1";case 2:return"h2";case 3:return"h3";case 4:return"h4";case 5:return"h5";case 6:return"h6";default:return"div"}},o=({type:e,styles:t,setting:a,builderProps:r,pageContext:u})=>{let l="React"===e,s=m({type:e,styles:t,setting:a,builderProps:r,pageContext:u});return{text:s,htmlTag:i(a),globalSize:a?.globalSize,background:a?.background,...!l&&{isForceValue:!0}}},m=({type:s,styles:i,setting:o,builderProps:m,pageContext:y})=>{let d="React"===s,p=r({"estimate-date-main":!0}),g=d||y?.isPreviewing?o?.customText:t({val:o?.customText,uid:m?.uid,settingId:a({id:l?.customText?.id}),pageContext:y??{},isCapitalize:i?.typo?.attrs?.transform==="capitalize"}).toString();return`${o?.enableCustomText===!1?"":e({styles:u(i,"typoCustom"),setting:{text:g},elementAttrs:{debugText:JSON.stringify({pageContext:y,setting:o,isReact:d,builderProps:m,textWithTranslate:g}).replaceAll("'","'")}})} ${e({styles:u(i,"typoDate"),setting:{text:n(o)},className:p})}`},y={SHOW:"show",HIDE:"hide"},d={SPECIFIC:"specific",RANGE:"range"},p=(e,t="%B %d, %Y")=>{let a=e.getMonth()+1,r=e.getDate(),u=e.getFullYear(),l=[{type:"%a",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()]},{type:"%A",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]},{type:"%d",value:r.toString().padStart(2,"0")},{type:"%b",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a-1]},{type:"%B",value:["January","February","March","April","May","June","July","August","September","October","November","December"][a-1]},{type:"%m",value:a.toString().padStart(2,"0")},{type:"%y",value:u.toString().slice(-2)},{type:"%Y",value:u},{type:"%sf",value:function(e){let t=Math.floor(e/10)%10,a=e%10;return 1===a&&1!==t?"st":2===a&&1!==t?"nd":3===a&&1!==t?"rd":"th"}(r)}];return l.forEach(e=>{t=t.replaceAll(e?.type,e?.value?.toString()||"")}),t},g=e=>{let t=new Date,a=new Date(t);return a.setDate(t.getDate()+Number(e)),a},c=()=>{let e=new Date(Date.now());return{FORMAT_1:{Label:p(e,"%b %d"),value:"%b %d"},FORMAT_2:{Label:p(e,"%b %d, %Y"),value:"%b %d, %Y"},FORMAT_3:{Label:p(e,"%a, %b %d"),value:"%a, %b %d"},FORMAT_4:{Label:p(e,"%d/%m/%Y"),value:"%d/%m/%Y"},FORMAT_5:{Label:p(e,"%Y/%m/%d"),value:"%Y/%m/%d"},FORMAT_6:{Label:"Custom"}}};export{d as ESTIMATE_DAYS,y as OUT_OF_STOCK,p as getDayFormat,g as getFutureDay,o as getNewSetting,c as listFormatDate};
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as
|
|
1
|
+
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as t,RenderChildren as s}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p,getProductBadgeVisibilityStyle as l}from"./common/common.js";import d from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import m from"./components/gallery-carousel/GalleryCarousel.liquid.js";import c from"./components/gallery-grid/GalleryGrid.liquid.js";import{filterPageContext as u,getSettingPreloadData as n}from"../../../helpers.js";import{getShapeByLayout as g,sizeSettingDefaultForNewLayout as f}from"./common/productGallery.js";import{getProductImagesClassName as $}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as y}from"./composables/getProductImagesStyles.js";import{createAttr as h,LiquidIf as v,createClass as S,If as j,Liquid as F}from"@gem-sdk/system";import{getBorderActiveCss as I}from"./common/getBorderActiveCss.js";import{getStyleOfObject as C}from"../../helpers/function.js";let P=P=>{let G=p(P),{setting:D,styles:b,builderProps:z,style:O}=G,{rawChildren:_,pageContext:N}=P,{enableLazyLoadImage:A}=N??{},B={...D,...b},U=`
|
|
2
2
|
{
|
|
3
|
-
"id":${JSON.stringify(
|
|
4
|
-
"pageContext": ${JSON.stringify(
|
|
5
|
-
"setting":${JSON.stringify(
|
|
6
|
-
"styles":${JSON.stringify(
|
|
3
|
+
"id":${JSON.stringify(z?.uid)},
|
|
4
|
+
"pageContext": ${JSON.stringify(u(N))},
|
|
5
|
+
"setting":${JSON.stringify(D)},
|
|
6
|
+
"styles":${JSON.stringify(b)},
|
|
7
7
|
"productUrl":{{product.url | json | escape}},
|
|
8
8
|
"product":{{product | json | escape}},
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
13
|
-
${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
`,k=h({"section-id":"{{section.id}}","data-id":`${z?.uid}`}),{isOnlyFeatureAllDevices:q,isRenderGalleryGrid:E}=i(B?.position,D?.type),J=E?{}:h({"data-only-image":v("product.media.size > 1","false","true")}),{wrapperClasses:w,productImagesGalleryClasses:T}=$(P),x=S({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),L=S({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:M,wrapContainerStyleOnlyOneImage:R,galleryImageStyle:V}=y(B),W=g({shape:B.shape,shapeForBottom:B.shapeForBottom,shapeFor1Col:B.shapeFor1Col,shapeFor2Col:B.shapeFor2Col,shapeForFtOnly:B.shapeForFtOnly,shapeForInsideBottom:B.shapeForInsideBottom??f,shapeForInside:B.shapeForInside??f},B.position),H=a(B.position,W,B?.spacing),K=e=>{let o=l(B?.position,e);return r`
|
|
13
|
+
<div style="${C(o)}">
|
|
14
|
+
${t({uid:z?.uid||"",customProps:_?.[0].customProps},_?.map(e=>{if(e)return r`${s({...e,isInsideProductImage:!0,imageData:{imageShape:b?.ftShape,imageAlign:b?.align,imageLayout:b?.position},dotData:{dotSize:D?.ftDotSize,dotGapToCarousel:D?.ftDotGapToCarousel,dotStyle:D?.ftDotStyle}})}`}))}
|
|
15
|
+
</div>
|
|
16
|
+
`};return r`
|
|
17
|
+
${j(D?.borderActive?.border!=="none",v("product.media.size > 1",`<style>${I({settings:B,uid:z?.uid,type:"Liquid"})}</style>`),"")}
|
|
18
|
+
${F(`
|
|
17
19
|
{% assign featured_image = product.featured_image %}
|
|
18
|
-
${
|
|
20
|
+
${v("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
19
21
|
`)}
|
|
20
22
|
<gp-product-images-v3
|
|
21
|
-
gp-data='${
|
|
22
|
-
${{...
|
|
23
|
-
style="${{...
|
|
24
|
-
class="${
|
|
23
|
+
gp-data='${U}'
|
|
24
|
+
${{...k}}
|
|
25
|
+
style="${{...O}}"
|
|
26
|
+
class="${w}"
|
|
25
27
|
>
|
|
26
28
|
<div
|
|
27
|
-
class="${
|
|
28
|
-
style="${
|
|
29
|
+
class="${v("product.media.size > 1",`${x}`,`${L}`)}"
|
|
30
|
+
style="${v("product.media.size > 1",C(M),C(R))}"
|
|
29
31
|
>
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
+
${d({builderPropUID:`gp-carousel-${z?.uid}`,...B,children:K("feature"),enableLazyLoadImage:A})}
|
|
33
|
+
${j(!q,r`
|
|
32
34
|
<div
|
|
33
|
-
class="${
|
|
34
|
-
style="${
|
|
35
|
-
${{...
|
|
35
|
+
class="${T}"
|
|
36
|
+
style="${C(V)}"
|
|
37
|
+
${{...J}}
|
|
36
38
|
>
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
+
${v("product.media.size > 1",m({builderPropUID:`gp-gallery-${z?.uid}`,...B,enableLazyLoadImage:A}))}
|
|
40
|
+
${j(E,c({builderPropUID:z?.uid,wrapperStyle:{...H},children:K("grid"),...B,enableLazyLoadImage:A}))}
|
|
39
41
|
</div>
|
|
40
42
|
`)}
|
|
41
43
|
</div>
|
|
42
44
|
</gp-product-images-v3>
|
|
43
|
-
${
|
|
44
|
-
`};export{
|
|
45
|
+
${j(e,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
46
|
+
`};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as
|
|
1
|
+
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as o,makeStyleResponsive as i,removeNullUndefined as r}from"@gem-sdk/core";let l=["one-col","two-col"],a=e=>"one-col"===e||"two-col"===e,n=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,i=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:i}},s=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},d=e=>{if(!e)return{desktop:5};let t=s(e.desktop,5),o=s(e.tablet,t),i=s(e.mobile,o);return{desktop:t,tablet:o,mobile:i}},u=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(i=>{o={...o,[`--d${"desktop"===i?"":`-${i}`}`]:`${e(i)?"none":t}`}}),o},b=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",i=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==i||"0px"!==r||"0px"!==l},c=o=>{let i={};return["desktop","mobile","tablet"].forEach(t=>{let r=e(o,t)?.shapeValue;if(r)i={...i,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":i={...i,[t]:"1/1"};break;case"vertical":i={...i,[t]:"3/4"};break;case"horizontal":i={...i,[t]:"4/3"};break;case"original":i={...i,[t]:""}}}}),t(i)},m=t=>{let i={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let r=!1;o.forEach(o=>{let l=e(t.position,o),a=e(t.ratioLayout,o),n=e(t.ratioLayoutRight,o),s="desktop"===o?"--gtc":`--gtc-${o}`,d="desktop"===o?"--gtr":`--gtr-${o}`,u="left"===l?a:n,b=["left","right"].includes(l||"");b&&u?(r=!0,Object.assign(i={...i,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):r&&Object.assign(i,{[d]:"unset"})})}return i},g=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"1":"0"}}),o},p=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"0":"1"}}),o},f=e=>`{{${e} | image_url: width: 480}} 480w, {{${e} | image_url: width: 768}} 768w, {{${e} | image_url: width: 1024}} 1024w, {{${e} | image_url: width: 1440}} 1440w`,h=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},k=(t,o,a)=>{let n={},s={},d={},u={},b={},c={};return["desktop","mobile","tablet"].forEach(i=>{let r=e(t,i),m=e(o,i)?.width,g=e(a,i);if(n={...n,[i]:["inside-bottom","inside-left","inside-right"].includes(r)?"absolute":"static"},["inside-bottom"].includes(r)){let e=h(g);m=`calc(100% - ${e})`}["bottom-center",...l].includes(r)&&(m="100%"),d={...d,[i]:"inside-bottom"===r?`${g}`:"auto"},u={...u,[i]:["inside-left","inside-right"].includes(r)?`${g}`:"auto"},c={...c,[i]:["inside-bottom","inside-left"].includes(r)?`${g}`:"auto"},b={...b,[i]:"inside-right"===r?`${g}`:"auto"},s={...s,[i]:m}}),{...i("pos",n),...i("w",r(s)),...i("bottom",r(d)),...i("top",r(u)),...i("left",r(c)),...i("right",r(b))}},$=(t,o)=>{let i=!0,r=!1;return["desktop","mobile","tablet"].forEach(l=>{let n=e(t,l),s=e(o,l);n&&"only-feature"!==n&&(i=!1),(a(n)||"images"===s)&&(r=!0)}),{isOnlyFeatureAllDevices:i,isRenderGalleryGrid:r}},y=(t,o)=>{let i=e(t,o);return a(i)},x=(e,t="feature")=>{let r={desktop:"none",tablet:"none",mobile:"none"};return o.forEach(o=>{let i=y(e,o);r[o]=("grid"===t?i:!i)?"block":"none"}),i("d",r)},N=e=>({...e,setting:{...e.setting}}),w=e=>{let t=e.match(/\d+/g);return t?t[0]:e},S=t=>{let o=c(t),i={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(r=>{let l=e(t,r),a=l?.height,n=l?.width||"",s=w(a||""),d=n.toString().match(/px/g)?w(n):n;if(a&&n&&!isNaN(Number(s))&&!isNaN(Number(d))){i={...i,[r]:`${Number(s)/Number(d)*100}%`};return}if(a&&!isNaN(Number(s))){i={...i,[r]:a};return}let u=o?.[r]!=="auto"&&o?.[r]?o?.[r]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";i={...i,[r]:`calc((${u})*100%)`}}),i};export{b as checkAddOverFlowClass,d as convertSpacing,h as convertSpacingForIndisdeLayout,s as convertUnitToNumber,c as getAspectRatio,$ as getConditionRenderGalleryImages,u as getDisplayStyle,S as getPaddingBottomByShapeSetting,x as getProductBadgeVisibilityStyle,f as getSrcImage,m as getStyleGridLayout,g as getStyleGridOrderForFeature,p as getStyleGridOrderForGallery,k as getStyleInsideLayout,n as getTypeWidthDevice,N as setDefaultWhenUndefineSetting};
|
|
@@ -2,6 +2,16 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
|
|
|
2
2
|
${s("{%- assign optionRendered = false -%}")}
|
|
3
3
|
${s("{%- assign swatches = shop.metafields.GEMPAGES.swatchesJSONFormat.value -%}")}
|
|
4
4
|
|
|
5
|
+
${s(`{%- assign variantPresetString = "${r}" -%}
|
|
6
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
7
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
8
|
+
{%- assign type = 'dropdown' -%}
|
|
9
|
+
{% for item in items %}
|
|
10
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
11
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
12
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% endfor %}`)}
|
|
14
|
+
|
|
5
15
|
${s(`{% for swatch in swatches %}
|
|
6
16
|
{%- assign optionTitle = swatch.optionTitle -%}
|
|
7
17
|
{%- assign optionType = swatch.optionType -%}
|
|
@@ -21,21 +31,10 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
|
|
|
21
31
|
{%- assign imageUrls = imageUrlsString | split: '${n}' | slice: 0, imageUrlsString.size -%}
|
|
22
32
|
|
|
23
33
|
{% if optionTitle == option.name %}
|
|
24
|
-
{%- assign variantPresetString = "${r}" -%}
|
|
25
|
-
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
26
|
-
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
27
|
-
{%- assign type = 'dropdown' -%}
|
|
28
|
-
|
|
29
|
-
{% for item in items %}
|
|
30
|
-
{%- assign itemPreset = item | split: '($1)' -%}
|
|
31
|
-
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
32
|
-
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
33
|
-
{% endfor %}
|
|
34
34
|
{%- assign optionRendered = true -%}
|
|
35
|
-
|
|
36
35
|
${o({showDropdown:!0})}
|
|
37
36
|
{% endif %}
|
|
38
37
|
{% endfor %}`)}
|
|
39
38
|
|
|
40
|
-
${i("optionRendered == false",o({showDropdown:!
|
|
39
|
+
${i("optionRendered == false",o({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
41
40
|
`};export{t as renderOptionValuesNewFormatSwatches};
|
|
@@ -3,6 +3,16 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
|
|
|
3
3
|
${e("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
|
|
4
4
|
${e("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
|
|
5
5
|
|
|
6
|
+
${e(`{%- assign variantPresetString = "${o}" -%}
|
|
7
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
8
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
9
|
+
{%- assign type = 'dropdown' -%}
|
|
10
|
+
{% for item in items %}
|
|
11
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
12
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
14
|
+
{% endfor %}`)}
|
|
15
|
+
|
|
6
16
|
${s("swatchesItem in swatchesItems",`
|
|
7
17
|
${e('{%- assign colorArraysString = "" -%}')}
|
|
8
18
|
${e('{%- assign labelsString = "" -%}')}
|
|
@@ -48,19 +58,10 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
|
|
|
48
58
|
${e("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
|
|
49
59
|
|
|
50
60
|
${t("optionTitle == option.name",`
|
|
51
|
-
${e(`{%- assign variantPresetString = "${o}" -%}`)}
|
|
52
|
-
${e('{%- assign optionName = option.name | replace: "\'", "'" | replace: \'"\', """ -%}')}
|
|
53
|
-
${e("{%- assign items = variantPresetString | split:'($2)' -%}")}
|
|
54
|
-
${e("{%- assign type = 'dropdown' -%}")}
|
|
55
|
-
${s("item in items",`
|
|
56
|
-
${e("{%- assign itemPreset = item | split:'($1)' -%}")}
|
|
57
|
-
${t("itemPreset[0] == optionName",e("{%- assign type = itemPreset[1] -%}"))}
|
|
58
|
-
${t('itemPreset[0] == "base"',e("{%- assign type = itemPreset[1] -%}"))}
|
|
59
|
-
`)}
|
|
60
61
|
${e("{%- assign optionRendered = true -%}")}
|
|
61
62
|
${n({showDropdown:!0})}
|
|
62
63
|
`)}
|
|
63
64
|
`)}
|
|
64
65
|
|
|
65
|
-
${t("optionRendered == false",n({showDropdown:!
|
|
66
|
+
${t("optionRendered == false",n({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
66
67
|
`};export{a as renderOptionValuesOld};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.4.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "18.
|
|
30
|
-
"@gem-sdk/styles": "18.0
|
|
29
|
+
"@gem-sdk/core": "18.4.0",
|
|
30
|
+
"@gem-sdk/styles": "18.4.0",
|
|
31
31
|
"@gem-sdk/system": "18.0.0",
|
|
32
32
|
"@types/react-transition-group": "^4.4.12",
|
|
33
33
|
"postcss-import": "16.1.1",
|