@gem-sdk/components 2.0.0-dev.854 → 2.0.0-dev.856
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/product/components/ProductList.liquid.js +35 -30
- package/dist/cjs/product/components/ProductVariants/variants/index.liquid.js +14 -14
- package/dist/esm/product/components/ProductList.liquid.js +33 -28
- package/dist/esm/product/components/ProductVariants/variants/index.liquid.js +8 -8
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var product=require("../helpers/product.js"),core=require("@gem-sdk/core"),CarouselItem_liquid=require("../../carousel/components/CarouselItem.liquid.js"),Carousel_liquid=require("../../carousel/components/Carousel.liquid.js"),carousel=require("../../carousel/components/common/carousel.js"),arrow=require("../../carousel/components/common/arrow.js"),dots=require("../../carousel/components/common/dots.js"),helpers=require("../../helpers.js"),productFeaturedImage=require("./ProductImages/common/productFeaturedImage.js");const ProductList=({setting:t,builderProps:e,styles:o,className:s,children:r,advanced:i,pageContext:d})=>{let n="gid://shopify/Collection/",a=t?.productSetting,c=a?.relatedTag,l=a?.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var product=require("../helpers/product.js"),core=require("@gem-sdk/core"),CarouselItem_liquid=require("../../carousel/components/CarouselItem.liquid.js"),Carousel_liquid=require("../../carousel/components/Carousel.liquid.js"),carousel=require("../../carousel/components/common/carousel.js"),arrow=require("../../carousel/components/common/arrow.js"),dots=require("../../carousel/components/common/dots.js"),helpers=require("../../helpers.js"),productFeaturedImage=require("./ProductImages/common/productFeaturedImage.js");const ProductList=({setting:t,builderProps:e,styles:o,className:s,children:r,advanced:i,pageContext:d})=>{let n="gid://shopify/Collection/",a=t?.productSetting,c=a?.relatedTag,l=a?.hasRelatedExclude,u=a?.relatedExclude,p=a?.productSrc??"Collection",g=a?.collectionId?.includes(n)?a?.collectionId?.replace(n,""):"latest",f=a?.productSrc==="PickProduct"&&a?.productIds?.length===0,m=o?.layout==="grid",P=productFeaturedImage.convertUnitToNumber(t?.numberOfProducts,4),h="PickProduct"===p&&a?.productIds?.length?a?.productIds.map(t=>t.replace("gid://shopify/Product/","")):[],_="PickProduct"===p&&a?.productHandles?.length?a?.productHandles:[],v=arrow.getUpdatedArrowDisplay(t?.arrow,t?.controlOverContent),y=dots.getUpdatedDotStyle(t?.dot),S=e=>core.template`
|
|
2
2
|
<div style="${{...core.makeStyleResponsive("w",core.makeWidth(o?.width,o?.fullWidth)),...core.makeStyleResponsive("rg",o?.horizontalGutter),...core.makeStyleResponsive("cg",o?.verticalGutter),...core.makeStyleResponsive("gtc",{desktop:`repeat(${core.getResponsiveValueByScreen(t?.slidesToShow,"desktop")}, minmax(0, 1fr))`,tablet:t?.slidesToShow?.tablet&&`repeat(${core.getResponsiveValueByScreen(t?.slidesToShow,"tablet")}, minmax(0, 1fr))`,mobile:t?.slidesToShow?.mobile&&`repeat(${core.getResponsiveValueByScreen(t?.slidesToShow,"mobile")}, minmax(0, 1fr))`})}}"
|
|
3
3
|
class="${core.cls(s,"gp-grid !gp-m-auto gp-w-full",i?.cssClass)}"
|
|
4
4
|
>
|
|
5
5
|
${e}
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
${Carousel_liquid.default({advanced:i,builderProps:{...e},setting:{loop:t?.loop,slidesToShow:t?.slidesToShow,dot:t?.dot,dotSize:{desktop:12},dotGapToCarousel:{desktop:16},dotStyle:
|
|
8
|
+
`,$=s=>core.template`
|
|
9
|
+
${Carousel_liquid.default({advanced:i,builderProps:{...e},setting:{loop:t?.loop,slidesToShow:t?.slidesToShow,dot:t?.dot,dotSize:{desktop:12},dotGapToCarousel:{desktop:16},dotStyle:y,navigationStyle:v,arrowCustom:t?.arrowCustom,controlOverContent:t?.controlOverContent,enableDrag:{desktop:t?.dragToScroll,tablet:t?.dragToScroll,mobile:t?.dragToScroll},speed:t?.speed,dotActiveColor:t?.dotActiveColor,dotColor:t?.dotColor,autoplay:t?.autoplay,pauseOnHover:t?.pauseOnHover,autoplayTimeout:t?.autoplayTimeout,arrowCustomColor:t?.arrowCustomColor,arrowButtonSize:{desktop:{width:"24px",height:"24px"}}},rootId:`product-list-carousel-${e?.uid}`,rootClass:"gp-justify-center",styles:{sizeSetting:{...product.getSizeSetting({adaptiveHeight:o?.adaptiveHeight,fullWidth:o?.fullWidth,width:o?.width,height:o?.height})},spacing:o?.spacing},children:`
|
|
10
10
|
${s}
|
|
11
11
|
`})}
|
|
12
|
-
|
|
13
|
-
${
|
|
12
|
+
`,C=()=>core.template`
|
|
13
|
+
${S(`
|
|
14
14
|
{%- assign count = 0 -%}
|
|
15
15
|
{%- for product in products limit: limit -%}
|
|
16
16
|
{%- assign count = count | plus: 1 -%}
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
{%- endform -%}
|
|
26
26
|
</gp-product>
|
|
27
27
|
{% endfor %}
|
|
28
|
-
{%- if count == 0 and ${
|
|
28
|
+
{%- if count == 0 and ${h.length} == 0 -%}
|
|
29
29
|
<div>${helpers.getStaticLocale("ProductList","no_products_found")}</div>
|
|
30
30
|
{%- endif -%}
|
|
31
31
|
`)}
|
|
32
|
-
`,
|
|
33
|
-
${
|
|
32
|
+
`,I=()=>core.template`
|
|
33
|
+
${$(`
|
|
34
34
|
{%- assign count = 0 -%}
|
|
35
35
|
{%- for product in products limit: limit -%}
|
|
36
36
|
{%- assign count = count | plus: 1 -%}
|
|
@@ -45,64 +45,69 @@
|
|
|
45
45
|
{%- endform -%}
|
|
46
46
|
</gp-product>`})}
|
|
47
47
|
{%- endfor -%}
|
|
48
|
-
{%- if count == 0 and ${
|
|
48
|
+
{%- if count == 0 and ${h.length} == 0 -%}
|
|
49
49
|
<div>${helpers.getStaticLocale("ProductList","no_products_found")}</div>
|
|
50
50
|
{%- endif -%}
|
|
51
51
|
`)}
|
|
52
|
-
`,
|
|
52
|
+
`,L=()=>core.template`
|
|
53
53
|
{%- if products == null -%}
|
|
54
54
|
<div>${helpers.getStaticLocale("ProductList","product_not_found")}</div>
|
|
55
55
|
{%-else-%}
|
|
56
|
-
${core.RenderIf(
|
|
57
|
-
${core.RenderIf(!
|
|
56
|
+
${core.RenderIf(m,C())}
|
|
57
|
+
${core.RenderIf(!m,I())}
|
|
58
58
|
{%- endif -%}
|
|
59
59
|
`;return d?.pageType==="GP_FUNNEL_PAGE"?"":core.template`
|
|
60
60
|
${core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></script>',`<script src="${core.baseAssetURL}/assets-v2/gp-product.v2.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
61
61
|
{%- assign gpBkProduct = product -%}
|
|
62
62
|
{%- assign gpBkProducts = products -%}
|
|
63
63
|
{%- liquid
|
|
64
|
-
assign productHandles = '${
|
|
64
|
+
assign productHandles = '${_.toString()}'| split: ','
|
|
65
65
|
assign products = null
|
|
66
66
|
assign stringListProducts = ''
|
|
67
67
|
assign target_collection = null
|
|
68
|
-
assign productSrc = '${
|
|
68
|
+
assign productSrc = '${p}'
|
|
69
69
|
assign c = 0
|
|
70
|
-
assign limit = ${
|
|
70
|
+
assign limit = ${m&&"latest"===g?"RelatedProduct"===p?P:a?.numOfSelectedProducts||4:P}
|
|
71
71
|
if request.page_type == 'collection' or preview_page_type == 'collection'
|
|
72
72
|
assign target_collection = collection
|
|
73
73
|
if target_collection == empty or target_collection == null
|
|
74
|
-
if '${
|
|
74
|
+
if '${g.toLowerCase()}' == 'latest'
|
|
75
75
|
assign target_collection = collections | sort: 'updated_at' | first
|
|
76
76
|
else
|
|
77
77
|
for collection in collections
|
|
78
|
-
if collection.id == ${
|
|
78
|
+
if collection.id == ${g}
|
|
79
79
|
assign target_collection = collection
|
|
80
80
|
break
|
|
81
81
|
endif
|
|
82
82
|
endfor
|
|
83
83
|
endif
|
|
84
84
|
endif
|
|
85
|
-
paginate target_collection.products by ${
|
|
85
|
+
paginate target_collection.products by ${P||4}
|
|
86
86
|
assign products = target_collection.products
|
|
87
87
|
endpaginate
|
|
88
88
|
else
|
|
89
89
|
if productSrc == 'RelatedProduct'
|
|
90
90
|
assign relatedTag = '${c}'
|
|
91
|
-
assign relatedProductHandle = '${l}'
|
|
92
91
|
assign products = null | sort
|
|
93
|
-
assign assignProduct =
|
|
92
|
+
assign assignProduct = product
|
|
94
93
|
assign idAssignProduct = assignProduct.id
|
|
95
94
|
assign allProducts = collections.all.products
|
|
96
95
|
|
|
97
96
|
if relatedTag == 'collection'
|
|
97
|
+
assign hasRelatedExclude = '${l}'
|
|
98
|
+
assign relatedExclude = '${u}'
|
|
99
|
+
assign arrayRelatedExclude = relatedExclude | spit: ", "
|
|
98
100
|
for collection in collections
|
|
99
101
|
assign collectionId = collection.id
|
|
102
|
+
assign collectionTitle = collection.handle
|
|
100
103
|
assign isInCollection = false
|
|
101
104
|
assign collectionsAssignProduct = assignProduct.collections
|
|
102
105
|
for item in collectionsAssignProduct
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
unless arrayRelatedExclude contains item.handle
|
|
107
|
+
if item.id == collectionId
|
|
108
|
+
assign isInCollection = true
|
|
109
|
+
endif
|
|
110
|
+
endunless
|
|
106
111
|
endfor
|
|
107
112
|
if isInCollection
|
|
108
113
|
for item in allProducts
|
|
@@ -175,11 +180,11 @@ ${core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-product.v2.js\' | asset_ur
|
|
|
175
180
|
endfor
|
|
176
181
|
endfor
|
|
177
182
|
endif
|
|
178
|
-
paginate products by ${
|
|
183
|
+
paginate products by ${P||4}
|
|
179
184
|
assign products = products
|
|
180
185
|
endpaginate
|
|
181
186
|
else if productSrc == 'PickProduct'
|
|
182
|
-
unless ${
|
|
187
|
+
unless ${f}
|
|
183
188
|
assign products = null | sort
|
|
184
189
|
for handle in productHandles
|
|
185
190
|
assign productH = all_products[handle] | sort
|
|
@@ -187,30 +192,30 @@ ${core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-product.v2.js\' | asset_ur
|
|
|
187
192
|
endfor
|
|
188
193
|
assign limit = products.length
|
|
189
194
|
else
|
|
190
|
-
if ${
|
|
195
|
+
if ${h.length} == 0
|
|
191
196
|
paginate collections.all.products by 100000
|
|
192
197
|
assign products = collections.all.products | sort : "created_at" | reverse
|
|
193
198
|
endpaginate
|
|
194
199
|
endif
|
|
195
200
|
endunless
|
|
196
201
|
else
|
|
197
|
-
if '${
|
|
202
|
+
if '${g.toLowerCase()}' == 'latest'
|
|
198
203
|
assign target_collection = collections | sort: 'updated_at' | first
|
|
199
204
|
else
|
|
200
205
|
for collection in collections
|
|
201
|
-
if collection.id == ${
|
|
206
|
+
if collection.id == ${g}
|
|
202
207
|
assign target_collection = collection
|
|
203
208
|
break
|
|
204
209
|
endif
|
|
205
210
|
endfor
|
|
206
211
|
endif
|
|
207
|
-
paginate target_collection.products by ${
|
|
212
|
+
paginate target_collection.products by ${P||4}
|
|
208
213
|
assign products = target_collection.products
|
|
209
214
|
endpaginate
|
|
210
215
|
endif
|
|
211
216
|
endif
|
|
212
217
|
-%}
|
|
213
|
-
${
|
|
218
|
+
${L()}
|
|
214
219
|
{%- assign product = gpBkProduct -%}
|
|
215
220
|
{%- assign products = gpBkProducts -%}
|
|
216
221
|
`};exports.default=ProductList;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Base_liquid=require("./Base.liquid.js"),Color_liquid=require("./Color.liquid.js"),Image_liquid=require("./Image.liquid.js"),ImageShopify_liquid=require("./ImageShopify.liquid.js");const VariantItem=({name:e,variantKey:a,value:t,id:i,activeClass:l,optionPosition:p,optionType:s
|
|
2
|
-
${Color_liquid.default({...
|
|
3
|
-
${Image_liquid.default({...
|
|
4
|
-
${ImageShopify_liquid.default({...
|
|
5
|
-
${Base_liquid.default({...
|
|
6
|
-
`,
|
|
7
|
-
${Base_liquid.default({...
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Base_liquid=require("./Base.liquid.js"),Color_liquid=require("./Color.liquid.js"),Image_liquid=require("./Image.liquid.js"),ImageShopify_liquid=require("./ImageShopify.liquid.js");const VariantItem=({name:e,variantKey:a,value:t,id:i,activeClass:l,optionPosition:p,optionType:o,...s})=>{let r="disable"===s.soldOutStyle,n=()=>core.template`
|
|
2
|
+
${Color_liquid.default({...s,isVariantOutStock:r,swatchValue:s.value,value:t})}
|
|
3
|
+
${Image_liquid.default({...s,isVariantOutStock:r,swatchValue:s.value,value:t})}
|
|
4
|
+
${ImageShopify_liquid.default({...s,isVariantOutStock:r,swatchValue:s.value,value:t})}
|
|
5
|
+
${Base_liquid.default({...s,isVariantOutStock:r,swatchValue:s.value,value:t})}
|
|
6
|
+
`,d=()=>core.template`
|
|
7
|
+
${Base_liquid.default({...s,isVariantOutStock:r,swatchValue:s.value,value:t})}
|
|
8
8
|
`;return core.template`
|
|
9
9
|
{%- liquid
|
|
10
10
|
assign option_disabled = true
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
endfor
|
|
27
27
|
-%}
|
|
28
28
|
|
|
29
|
-
${
|
|
29
|
+
${r?"":"{% assign option_disabled = false %}"}
|
|
30
30
|
<label
|
|
31
31
|
id="${i}"
|
|
32
|
-
for="
|
|
32
|
+
for="{{product.id}}-${s.uid}-${a}"
|
|
33
33
|
class="gp-group gp-relative option-item"
|
|
34
34
|
>
|
|
35
35
|
<div class="gp-invisible !gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]">
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
</svg>
|
|
40
40
|
</div>
|
|
41
41
|
<input
|
|
42
|
-
checked="${
|
|
42
|
+
checked="${s.checked}"
|
|
43
43
|
name="{{product.id}}-options-${e}"
|
|
44
|
-
id="
|
|
44
|
+
id="{{product.id}}-${s.uid}-${a}"
|
|
45
45
|
value="${t?.label}"
|
|
46
46
|
type="radio"
|
|
47
|
-
class="gp-sr-only"
|
|
47
|
+
class="gp-sr-only gp-absolute gp-bottom-0 gp-right-0"
|
|
48
48
|
/>
|
|
49
49
|
<span class="gp-sr-only">${t?.label}</span>
|
|
50
|
-
<div class="option-item-inner gp-w-auto gp-h-auto {%- if option_disabled == true -%}${
|
|
51
|
-
${
|
|
50
|
+
<div class="option-item-inner gp-w-auto gp-h-auto {%- if option_disabled == true -%}${r?"gp-opacity-20":""}{%- endif -%}">
|
|
51
|
+
${s.isRenderDefault?d():n()}
|
|
52
52
|
</div>
|
|
53
53
|
</label>`};exports.default=VariantItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{getSizeSetting as t}from"../helpers/product.js";import{template as o,RenderIf as s,isLocalEnv as
|
|
1
|
+
import{getSizeSetting as t}from"../helpers/product.js";import{template as o,RenderIf as s,isLocalEnv as e,baseAssetURL as i,makeStyleResponsive as d,makeWidth as r,getResponsiveValueByScreen as n,cls as a}from"@gem-sdk/core";import c from"../../carousel/components/CarouselItem.liquid.js";import l from"../../carousel/components/Carousel.liquid.js";import{getInitialWidthForCarouselItem as u}from"../../carousel/components/common/carousel.js";import{getUpdatedArrowDisplay as p}from"../../carousel/components/common/arrow.js";import{getUpdatedDotStyle as g}from"../../carousel/components/common/dots.js";import{getStaticLocale as f}from"../../helpers.js";import{convertUnitToNumber as m}from"./ProductImages/common/productFeaturedImage.js";let ProductList=({setting:P,builderProps:h,styles:_,className:y,children:v,advanced:$,pageContext:S})=>{let C="gid://shopify/Collection/",b=P?.productSetting,w=b?.relatedTag,L=b?.hasRelatedExclude,T=b?.relatedExclude,O=b?.productSrc??"Collection",I=b?.collectionId?.includes(C)?b?.collectionId?.replace(C,""):"latest",k=b?.productSrc==="PickProduct"&&b?.productIds?.length===0,A=_?.layout==="grid",j=m(P?.numberOfProducts,4),x="PickProduct"===O&&b?.productIds?.length?b?.productIds.map(t=>t.replace("gid://shopify/Product/","")):[],E="PickProduct"===O&&b?.productHandles?.length?b?.productHandles:[],q=p(P?.arrow,P?.controlOverContent),F=g(P?.dot),H=t=>o`
|
|
2
2
|
<div style="${{...d("w",r(_?.width,_?.fullWidth)),...d("rg",_?.horizontalGutter),...d("cg",_?.verticalGutter),...d("gtc",{desktop:`repeat(${n(P?.slidesToShow,"desktop")}, minmax(0, 1fr))`,tablet:P?.slidesToShow?.tablet&&`repeat(${n(P?.slidesToShow,"tablet")}, minmax(0, 1fr))`,mobile:P?.slidesToShow?.mobile&&`repeat(${n(P?.slidesToShow,"mobile")}, minmax(0, 1fr))`})}}"
|
|
3
|
-
class="${a(
|
|
3
|
+
class="${a(y,"gp-grid !gp-m-auto gp-w-full",$?.cssClass)}"
|
|
4
4
|
>
|
|
5
5
|
${t}
|
|
6
6
|
</div>
|
|
@@ -9,8 +9,8 @@ import{getSizeSetting as t}from"../helpers/product.js";import{template as o,Rend
|
|
|
9
9
|
${l({advanced:$,builderProps:{...h},setting:{loop:P?.loop,slidesToShow:P?.slidesToShow,dot:P?.dot,dotSize:{desktop:12},dotGapToCarousel:{desktop:16},dotStyle:F,navigationStyle:q,arrowCustom:P?.arrowCustom,controlOverContent:P?.controlOverContent,enableDrag:{desktop:P?.dragToScroll,tablet:P?.dragToScroll,mobile:P?.dragToScroll},speed:P?.speed,dotActiveColor:P?.dotActiveColor,dotColor:P?.dotColor,autoplay:P?.autoplay,pauseOnHover:P?.pauseOnHover,autoplayTimeout:P?.autoplayTimeout,arrowCustomColor:P?.arrowCustomColor,arrowButtonSize:{desktop:{width:"24px",height:"24px"}}},rootId:`product-list-carousel-${h?.uid}`,rootClass:"gp-justify-center",styles:{sizeSetting:{...t({adaptiveHeight:_?.adaptiveHeight,fullWidth:_?.fullWidth,width:_?.width,height:_?.height})},spacing:_?.spacing},children:`
|
|
10
10
|
${s}
|
|
11
11
|
`})}
|
|
12
|
-
`,
|
|
13
|
-
${
|
|
12
|
+
`,R=()=>o`
|
|
13
|
+
${H(`
|
|
14
14
|
{%- assign count = 0 -%}
|
|
15
15
|
{%- for product in products limit: limit -%}
|
|
16
16
|
{%- assign count = count | plus: 1 -%}
|
|
@@ -21,15 +21,15 @@ import{getSizeSetting as t}from"../helpers/product.js";import{template as o,Rend
|
|
|
21
21
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
22
22
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
23
23
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
24
|
-
${
|
|
24
|
+
${v??""}
|
|
25
25
|
{%- endform -%}
|
|
26
26
|
</gp-product>
|
|
27
27
|
{% endfor %}
|
|
28
|
-
{%- if count == 0 and ${
|
|
28
|
+
{%- if count == 0 and ${x.length} == 0 -%}
|
|
29
29
|
<div>${f("ProductList","no_products_found")}</div>
|
|
30
30
|
{%- endif -%}
|
|
31
31
|
`)}
|
|
32
|
-
`,
|
|
32
|
+
`,z=()=>o`
|
|
33
33
|
${G(`
|
|
34
34
|
{%- assign count = 0 -%}
|
|
35
35
|
{%- for product in products limit: limit -%}
|
|
@@ -41,11 +41,11 @@ import{getSizeSetting as t}from"../helpers/product.js";import{template as o,Rend
|
|
|
41
41
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
42
42
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
43
43
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
44
|
-
${
|
|
44
|
+
${v??""}
|
|
45
45
|
{%- endform -%}
|
|
46
46
|
</gp-product>`})}
|
|
47
47
|
{%- endfor -%}
|
|
48
|
-
{%- if count == 0 and ${
|
|
48
|
+
{%- if count == 0 and ${x.length} == 0 -%}
|
|
49
49
|
<div>${f("ProductList","no_products_found")}</div>
|
|
50
50
|
{%- endif -%}
|
|
51
51
|
`)}
|
|
@@ -53,56 +53,61 @@ import{getSizeSetting as t}from"../helpers/product.js";import{template as o,Rend
|
|
|
53
53
|
{%- if products == null -%}
|
|
54
54
|
<div>${f("ProductList","product_not_found")}</div>
|
|
55
55
|
{%-else-%}
|
|
56
|
-
${s(
|
|
57
|
-
${s(!
|
|
56
|
+
${s(A,R())}
|
|
57
|
+
${s(!A,z())}
|
|
58
58
|
{%- endif -%}
|
|
59
59
|
`;return S?.pageType==="GP_FUNNEL_PAGE"?"":o`
|
|
60
|
-
${s(
|
|
60
|
+
${s(e,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></script>',`<script src="${i}/assets-v2/gp-product.v2.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
61
61
|
{%- assign gpBkProduct = product -%}
|
|
62
62
|
{%- assign gpBkProducts = products -%}
|
|
63
63
|
{%- liquid
|
|
64
|
-
assign productHandles = '${
|
|
64
|
+
assign productHandles = '${E.toString()}'| split: ','
|
|
65
65
|
assign products = null
|
|
66
66
|
assign stringListProducts = ''
|
|
67
67
|
assign target_collection = null
|
|
68
68
|
assign productSrc = '${O}'
|
|
69
69
|
assign c = 0
|
|
70
|
-
assign limit = ${
|
|
70
|
+
assign limit = ${A&&"latest"===I?"RelatedProduct"===O?j:b?.numOfSelectedProducts||4:j}
|
|
71
71
|
if request.page_type == 'collection' or preview_page_type == 'collection'
|
|
72
72
|
assign target_collection = collection
|
|
73
73
|
if target_collection == empty or target_collection == null
|
|
74
|
-
if '${
|
|
74
|
+
if '${I.toLowerCase()}' == 'latest'
|
|
75
75
|
assign target_collection = collections | sort: 'updated_at' | first
|
|
76
76
|
else
|
|
77
77
|
for collection in collections
|
|
78
|
-
if collection.id == ${
|
|
78
|
+
if collection.id == ${I}
|
|
79
79
|
assign target_collection = collection
|
|
80
80
|
break
|
|
81
81
|
endif
|
|
82
82
|
endfor
|
|
83
83
|
endif
|
|
84
84
|
endif
|
|
85
|
-
paginate target_collection.products by ${
|
|
85
|
+
paginate target_collection.products by ${j||4}
|
|
86
86
|
assign products = target_collection.products
|
|
87
87
|
endpaginate
|
|
88
88
|
else
|
|
89
89
|
if productSrc == 'RelatedProduct'
|
|
90
90
|
assign relatedTag = '${w}'
|
|
91
|
-
assign relatedProductHandle = '${L}'
|
|
92
91
|
assign products = null | sort
|
|
93
|
-
assign assignProduct =
|
|
92
|
+
assign assignProduct = product
|
|
94
93
|
assign idAssignProduct = assignProduct.id
|
|
95
94
|
assign allProducts = collections.all.products
|
|
96
95
|
|
|
97
96
|
if relatedTag == 'collection'
|
|
97
|
+
assign hasRelatedExclude = '${L}'
|
|
98
|
+
assign relatedExclude = '${T}'
|
|
99
|
+
assign arrayRelatedExclude = relatedExclude | spit: ", "
|
|
98
100
|
for collection in collections
|
|
99
101
|
assign collectionId = collection.id
|
|
102
|
+
assign collectionTitle = collection.handle
|
|
100
103
|
assign isInCollection = false
|
|
101
104
|
assign collectionsAssignProduct = assignProduct.collections
|
|
102
105
|
for item in collectionsAssignProduct
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
unless arrayRelatedExclude contains item.handle
|
|
107
|
+
if item.id == collectionId
|
|
108
|
+
assign isInCollection = true
|
|
109
|
+
endif
|
|
110
|
+
endunless
|
|
106
111
|
endfor
|
|
107
112
|
if isInCollection
|
|
108
113
|
for item in allProducts
|
|
@@ -175,11 +180,11 @@ ${s(i,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></scri
|
|
|
175
180
|
endfor
|
|
176
181
|
endfor
|
|
177
182
|
endif
|
|
178
|
-
paginate products by ${
|
|
183
|
+
paginate products by ${j||4}
|
|
179
184
|
assign products = products
|
|
180
185
|
endpaginate
|
|
181
186
|
else if productSrc == 'PickProduct'
|
|
182
|
-
unless ${
|
|
187
|
+
unless ${k}
|
|
183
188
|
assign products = null | sort
|
|
184
189
|
for handle in productHandles
|
|
185
190
|
assign productH = all_products[handle] | sort
|
|
@@ -187,24 +192,24 @@ ${s(i,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></scri
|
|
|
187
192
|
endfor
|
|
188
193
|
assign limit = products.length
|
|
189
194
|
else
|
|
190
|
-
if ${
|
|
195
|
+
if ${x.length} == 0
|
|
191
196
|
paginate collections.all.products by 100000
|
|
192
197
|
assign products = collections.all.products | sort : "created_at" | reverse
|
|
193
198
|
endpaginate
|
|
194
199
|
endif
|
|
195
200
|
endunless
|
|
196
201
|
else
|
|
197
|
-
if '${
|
|
202
|
+
if '${I.toLowerCase()}' == 'latest'
|
|
198
203
|
assign target_collection = collections | sort: 'updated_at' | first
|
|
199
204
|
else
|
|
200
205
|
for collection in collections
|
|
201
|
-
if collection.id == ${
|
|
206
|
+
if collection.id == ${I}
|
|
202
207
|
assign target_collection = collection
|
|
203
208
|
break
|
|
204
209
|
endif
|
|
205
210
|
endfor
|
|
206
211
|
endif
|
|
207
|
-
paginate target_collection.products by ${
|
|
212
|
+
paginate target_collection.products by ${j||4}
|
|
208
213
|
assign products = target_collection.products
|
|
209
214
|
endpaginate
|
|
210
215
|
endif
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{template as a}from"@gem-sdk/core";import t from"./Base.liquid.js";import e from"./Color.liquid.js";import i from"./Image.liquid.js";import
|
|
1
|
+
import{template as a}from"@gem-sdk/core";import t from"./Base.liquid.js";import e from"./Color.liquid.js";import i from"./Image.liquid.js";import p from"./ImageShopify.liquid.js";let VariantItem=({name:l,variantKey:o,value:s,id:n,activeClass:r,optionPosition:g,optionType:d,...u})=>{let f="disable"===u.soldOutStyle,m=()=>a`
|
|
2
2
|
${e({...u,isVariantOutStock:f,swatchValue:u.value,value:s})}
|
|
3
3
|
${i({...u,isVariantOutStock:f,swatchValue:u.value,value:s})}
|
|
4
|
-
${
|
|
4
|
+
${p({...u,isVariantOutStock:f,swatchValue:u.value,value:s})}
|
|
5
5
|
${t({...u,isVariantOutStock:f,swatchValue:u.value,value:s})}
|
|
6
|
-
`,
|
|
6
|
+
`,c=()=>a`
|
|
7
7
|
${t({...u,isVariantOutStock:f,swatchValue:u.value,value:s})}
|
|
8
8
|
`;return a`
|
|
9
9
|
{%- liquid
|
|
@@ -29,7 +29,7 @@ import{template as a}from"@gem-sdk/core";import t from"./Base.liquid.js";import
|
|
|
29
29
|
${f?"":"{% assign option_disabled = false %}"}
|
|
30
30
|
<label
|
|
31
31
|
id="${n}"
|
|
32
|
-
for="
|
|
32
|
+
for="{{product.id}}-${u.uid}-${o}"
|
|
33
33
|
class="gp-group gp-relative option-item"
|
|
34
34
|
>
|
|
35
35
|
<div class="gp-invisible !gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]">
|
|
@@ -40,14 +40,14 @@ import{template as a}from"@gem-sdk/core";import t from"./Base.liquid.js";import
|
|
|
40
40
|
</div>
|
|
41
41
|
<input
|
|
42
42
|
checked="${u.checked}"
|
|
43
|
-
name="{{product.id}}-options-${
|
|
44
|
-
id="
|
|
43
|
+
name="{{product.id}}-options-${l}"
|
|
44
|
+
id="{{product.id}}-${u.uid}-${o}"
|
|
45
45
|
value="${s?.label}"
|
|
46
46
|
type="radio"
|
|
47
|
-
class="gp-sr-only"
|
|
47
|
+
class="gp-sr-only gp-absolute gp-bottom-0 gp-right-0"
|
|
48
48
|
/>
|
|
49
49
|
<span class="gp-sr-only">${s?.label}</span>
|
|
50
50
|
<div class="option-item-inner gp-w-auto gp-h-auto {%- if option_disabled == true -%}${f?"gp-opacity-20":""}{%- endif -%}">
|
|
51
|
-
${u.isRenderDefault?
|
|
51
|
+
${u.isRenderDefault?c():m()}
|
|
52
52
|
</div>
|
|
53
53
|
</label>`};export{VariantItem as default};
|