@gem-sdk/components 2.0.0-dev.854 → 2.0.0-dev.855
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,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,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};
|