@gem-sdk/components 12.0.0-dev.91 → 12.0.0-dev.93

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
- "use strict";var core=require("@gem-sdk/core");const filterStyles=e=>{let o=["--mb","--mb-mobile","--mb-tablet","--d","--d-mobile","--d-tablet"];return o.forEach(o=>{delete e?.[o]}),e},contentSizePaddingSize=e=>core.makeGlobalSize(e?.contentSizePadding),getContainerStyles=(e,o)=>({...filterStyles(e),...contentSizePaddingSize(o).gap,...core.getStyleBackgroundByDevice(e?.backgroundContent),"border-radius":"inherit"}),widthHeightSizeControl=e=>core.makeGlobalSize(e),widthStyle=(e,o,t)=>widthHeightSizeControl(t).width["--w"]?widthHeightSizeControl(t).width:core.makeStyleResponsive("w",core.makeWidth(e,o)),getItemContainerStyles=(e,o)=>{let{borderContent:t,backgroundContent:r,roundedContent:l,accordionShadow:a,width:i,fullWidth:n,widthHeightSize:c,iconColor:g,color:S,textColor:d,hasActiveShadow:s}=e??{};return{"--text-hover-color":o?core.getSingleColorVariable(d?.active??d?.normal):core.getSingleColorVariable(d?.hover??d?.normal),"--icon-expand-hover-color":o?core.getSingleColorVariable(S?.active??S?.normal):core.getSingleColorVariable(S?.hover??S?.normal),"--icon-expand-active-color":core.getSingleColorVariable(S?.active??S?.normal),"--icon-active-color":core.getSingleColorVariable(g?.active??g?.normal),"--icon-hover-color":o?core.getSingleColorVariable(g?.active??g?.normal):core.getSingleColorVariable(g?.hover??g?.normal),...widthStyle(i,n,c),...core.makeStyle({bs:t?.border??t?.border,bw:t?.width??t?.width,bc:core.getSingleColorVariable(t?.color??t?.color)}),...core.makeStyleResponsive("bg",r),...core.getStyleShadow({value:a,styleAppliedFor:"box-shadow",isEnableShadow:a?.enable||s}),...core.getRadiusStyleActiveState({...l,active:{...l||{},radiusType:"custom"}})}},headerContentPaddingSize=e=>core.makeGlobalSize(e),composePosition=e=>core.makeStyle({fd:"left"===e?"row":"row-reverse",jc:"right"===e?"space-between":""}),getDropdownStyles=(e,o)=>{let{headerContentPadding:t,widthHeightSize:r,itemHeaderSpacing:l,bgColor:a,headerBorder:i}=e??{},{isShow:n,iconPosition:c}=o??{};return{...t&&headerContentPaddingSize(t).padding,...l?.type||t?{}:core.composeSize(l?.custom),...widthHeightSizeControl(r).height,...composePosition(c),...n?core.makeStyle({bgc:core.getSingleColorVariable(a?.active??a?.normal),bs:i?.active?.border??i?.normal?.border,bw:i?.active?.width??i?.normal?.width,bc:core.getSingleColorVariable(i?.active?.color??i?.normal?.color)}):{...core.getGlobalColorStateStyle("bgc",a),...core.handleConvertBorderStyle(i),...core.handleConvertBorderWidth(i),...core.handleConvertBorderColor(i),...core.getGlobalColorStateStyle("bgc",a)}}},getDropdownTextStyles=(e,o)=>({...o?core.makeStyle({c:core.getSingleColorVariable(e?.active??e?.normal)}):core.makeStyle({c:core.getSingleColorVariable(e?.normal)})}),getIconRotateStyles=(e,o,t)=>{let{color:r}=e??{};return{...core.makeStyle({c:core.getSingleColorVariable(o?r?.active??r?.normal??"transparent":r?.normal??"transparent")}),width:`${t??16}px`,height:`${t??16}px`}},composeIconGlobalSize=e=>core.makeGlobalSize(e),getGapStyles=(e,o)=>({...composeIconGlobalSize(e).gap,...core.makeStyleResponsive("jc",o)}),getIconStyles=(e,o)=>{let t=o?`${o}px`:"16px";return{...e,width:t,height:t,"--height":t}},getTemplateRow=e=>({"grid-template-rows":`${+!!e}fr`}),getRenderChildrenStyles=()=>({"grid-template-columns":"minmax(auto, 100%)"}),getIconGlobalSize=e=>core.makeGlobalSize(e)?.padding;exports.getContainerStyles=getContainerStyles,exports.getDropdownStyles=getDropdownStyles,exports.getDropdownTextStyles=getDropdownTextStyles,exports.getGapStyles=getGapStyles,exports.getIconGlobalSize=getIconGlobalSize,exports.getIconRotateStyles=getIconRotateStyles,exports.getIconStyles=getIconStyles,exports.getItemContainerStyles=getItemContainerStyles,exports.getRenderChildrenStyles=getRenderChildrenStyles,exports.getTemplateRow=getTemplateRow;
1
+ "use strict";var core=require("@gem-sdk/core");const filterStyles=e=>{let o=["--mb","--mb-mobile","--mb-tablet","--d","--d-mobile","--d-tablet"];return o.forEach(o=>{delete e?.[o]}),e},contentSizePaddingSize=e=>core.makeGlobalSize(e?.contentSizePadding),getContainerStyles=(e,o)=>({...filterStyles(e),...contentSizePaddingSize(o).gap,...core.getStyleBackgroundByDevice(e?.backgroundContent),"border-radius":"inherit"}),widthHeightSizeControl=e=>core.makeGlobalSize(e),widthStyle=(e,o,t)=>widthHeightSizeControl(t).width["--w"]?widthHeightSizeControl(t).width:core.makeStyleResponsive("w",core.makeWidth(e,o)),getItemContainerStyles=(e,o)=>{let{borderContent:t,backgroundContent:r,roundedContent:l,accordionShadow:a,width:i,fullWidth:n,widthHeightSize:c,iconColor:g,color:S,textColor:d,hasActiveShadow:s}=e??{};return{"--text-hover-color":o?core.getSingleColorVariable(d?.active??d?.normal):core.getSingleColorVariable(d?.hover??d?.normal),"--icon-expand-hover-color":o?core.getSingleColorVariable(S?.active??S?.normal):core.getSingleColorVariable(S?.hover??S?.normal),"--icon-expand-active-color":core.getSingleColorVariable(S?.active??S?.normal),"--icon-active-color":core.getSingleColorVariable(g?.active??g?.normal),"--icon-hover-color":o?core.getSingleColorVariable(g?.active??g?.normal):core.getSingleColorVariable(g?.hover??g?.normal),...widthStyle(i,n,c),...core.makeStyle({bs:t?.border??t?.border,bw:t?.width??t?.width,bc:core.getSingleColorVariable(t?.color??t?.color)}),...core.makeStyleResponsive("bg",r),...core.getStyleShadow({value:a,styleAppliedFor:"box-shadow",isEnableShadow:a?.enable||s}),...core.getRadiusStyleActiveState({...l,active:{...l||{},radiusType:"custom"}})}},headerContentPaddingSize=e=>core.makeGlobalSize(e),composePosition=e=>core.makeStyle({fd:"left"===e?"row":"row-reverse",jc:"right"===e?"space-between":""}),getDropdownStyles=(e,o)=>{let{headerContentPadding:t,widthHeightSize:r,itemHeaderSpacing:l,bgColor:a,headerBorder:i}=e??{},{isShow:n,iconPosition:c}=o??{};return{...t&&headerContentPaddingSize(t).padding,...l?.type||t?{}:core.composeSize(l?.custom),...widthHeightSizeControl(r).height,...composePosition(c),...n?core.makeStyle({bgc:core.getSingleColorVariable(a?.active??a?.normal),bs:i?.active?.border??i?.normal?.border,bw:i?.active?.width??i?.normal?.width,bc:core.getSingleColorVariable(i?.active?.color??i?.normal?.color)}):{...core.getGlobalColorStateStyle("bgc",a),...core.handleConvertBorderStyle(i),...core.handleConvertBorderWidth(i),...core.handleConvertBorderColor(i),...core.getGlobalColorStateStyle("bgc",a)}}},getDropdownTextStyles=(e,o)=>({...o?core.makeStyle({c:core.getSingleColorVariable(e?.active??e?.normal)}):core.makeStyle({c:core.getSingleColorVariable(e?.normal)})}),getIconRotateStyles=(e,o,t)=>{let{color:r}=e??{};return{...core.makeStyle({c:core.getSingleColorVariable(o?r?.active??r?.normal??"transparent":r?.normal??"transparent")}),width:`${t??16}px`,height:`${t??16}px`}},composeIconGlobalSize=e=>core.makeGlobalSize(e),getGapStyles=(e,o)=>({...composeIconGlobalSize(e).gap,...core.makeStyleResponsive("jc",o),...core.makeStyleResponsive("ta",o)}),getIconStyles=(e,o)=>{let t=o?`${o}px`:"16px";return{...e,width:t,height:t,"--height":t}},getTemplateRow=e=>({"grid-template-rows":`${+!!e}fr`}),getRenderChildrenStyles=()=>({"grid-template-columns":"minmax(auto, 100%)"}),getIconGlobalSize=e=>core.makeGlobalSize(e)?.padding;exports.getContainerStyles=getContainerStyles,exports.getDropdownStyles=getDropdownStyles,exports.getDropdownTextStyles=getDropdownTextStyles,exports.getGapStyles=getGapStyles,exports.getIconGlobalSize=getIconGlobalSize,exports.getIconRotateStyles=getIconRotateStyles,exports.getIconStyles=getIconStyles,exports.getItemContainerStyles=getItemContainerStyles,exports.getRenderChildrenStyles=getRenderChildrenStyles,exports.getTemplateRow=getTemplateRow;
@@ -1,5 +1,5 @@
1
- "use strict";const generateBadgeContent=(n,i)=>`
2
- {% assign content = ${i?JSON.stringify(n):n} %}
1
+ "use strict";const generateBadgeContent=(n,t)=>`
2
+ {% assign content = ${t?JSON.stringify(n):n} %}
3
3
 
4
4
  {%if content.size > 0 %}
5
5
  {% if variant.compare_at_price and variant.compare_at_price > 0 %}
@@ -14,7 +14,7 @@
14
14
  {% assign amountDiscountValue = amountDiscount | money_without_trailing_zeros %}
15
15
  {% assign price = variant.price | divided_by: 100 %}
16
16
  {% assign minPriceValue = product.variants | map: "price" | sort | first | money_without_trailing_zeros %}
17
- {% assign inventoryQuantityValue = variant.inventory_quantity %}
17
+ {% assign inventoryQuantityValue = variant.inventory_quantity | default: 0 %}
18
18
 
19
19
  {% assign percentDiscountKey = "{percent_discount}" %}
20
20
  {% assign amountDiscountKey = "{amount_discount}" %}
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,children:n}=t,{productItemClass:o,gpProductClass:a}=classes.getClass(t);return core.template`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -4,7 +4,7 @@
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
7
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${r}"
9
9
  >
10
10
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,children:n}=t,{productItemClass:o,gpProductClass:a}=classes.getClass(t);return core.template`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -4,7 +4,7 @@
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
7
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${r}"
9
9
  >
10
10
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -79,7 +79,7 @@
79
79
  data-id="${a?.uid}"
80
80
  style="${y}"
81
81
  class="${d?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${s}", "hasPreSelected": ${c}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
82
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${s}", "hasPreSelected": ${c}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
84
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }}}</script>
85
85
  <product-form class="product-form">
@@ -1 +1 @@
1
- import{getStyleBackgroundByDevice as e,getSingleColorVariable as t,makeStyle as o,makeStyleResponsive as r,getStyleShadow as i,getRadiusStyleActiveState as n,composeSize as l,getGlobalColorStateStyle as a,handleConvertBorderStyle as c,handleConvertBorderWidth as d,handleConvertBorderColor as g,makeGlobalSize as h,makeWidth as s}from"@gem-sdk/core";let filterStyles=e=>{let t=["--mb","--mb-mobile","--mb-tablet","--d","--d-mobile","--d-tablet"];return t.forEach(t=>{delete e?.[t]}),e},contentSizePaddingSize=e=>h(e?.contentSizePadding),getContainerStyles=(t,o)=>({...filterStyles(t),...contentSizePaddingSize(o).gap,...e(t?.backgroundContent),"border-radius":"inherit"}),widthHeightSizeControl=e=>h(e),widthStyle=(e,t,o)=>widthHeightSizeControl(o).width["--w"]?widthHeightSizeControl(o).width:r("w",s(e,t)),getItemContainerStyles=(e,l)=>{let{borderContent:a,backgroundContent:c,roundedContent:d,accordionShadow:g,width:h,fullWidth:s,widthHeightSize:m,iconColor:S,color:p,textColor:b,hasActiveShadow:w}=e??{};return{"--text-hover-color":l?t(b?.active??b?.normal):t(b?.hover??b?.normal),"--icon-expand-hover-color":l?t(p?.active??p?.normal):t(p?.hover??p?.normal),"--icon-expand-active-color":t(p?.active??p?.normal),"--icon-active-color":t(S?.active??S?.normal),"--icon-hover-color":l?t(S?.active??S?.normal):t(S?.hover??S?.normal),...widthStyle(h,s,m),...o({bs:a?.border??a?.border,bw:a?.width??a?.width,bc:t(a?.color??a?.color)}),...r("bg",c),...i({value:g,styleAppliedFor:"box-shadow",isEnableShadow:g?.enable||w}),...n({...d,active:{...d||{},radiusType:"custom"}})}},headerContentPaddingSize=e=>h(e),composePosition=e=>o({fd:"left"===e?"row":"row-reverse",jc:"right"===e?"space-between":""}),getDropdownStyles=(e,r)=>{let{headerContentPadding:i,widthHeightSize:n,itemHeaderSpacing:h,bgColor:s,headerBorder:m}=e??{},{isShow:S,iconPosition:p}=r??{};return{...i&&headerContentPaddingSize(i).padding,...h?.type||i?{}:l(h?.custom),...widthHeightSizeControl(n).height,...composePosition(p),...S?o({bgc:t(s?.active??s?.normal),bs:m?.active?.border??m?.normal?.border,bw:m?.active?.width??m?.normal?.width,bc:t(m?.active?.color??m?.normal?.color)}):{...a("bgc",s),...c(m),...d(m),...g(m),...a("bgc",s)}}},getDropdownTextStyles=(e,r)=>({...r?o({c:t(e?.active??e?.normal)}):o({c:t(e?.normal)})}),getIconRotateStyles=(e,r,i)=>{let{color:n}=e??{};return{...o({c:t(r?n?.active??n?.normal??"transparent":n?.normal??"transparent")}),width:`${i??16}px`,height:`${i??16}px`}},composeIconGlobalSize=e=>h(e),getGapStyles=(e,t)=>({...composeIconGlobalSize(e).gap,...r("jc",t)}),getIconStyles=(e,t)=>{let o=t?`${t}px`:"16px";return{...e,width:o,height:o,"--height":o}},getTemplateRow=e=>({"grid-template-rows":`${+!!e}fr`}),getRenderChildrenStyles=()=>({"grid-template-columns":"minmax(auto, 100%)"}),getIconGlobalSize=e=>h(e)?.padding;export{getContainerStyles,getDropdownStyles,getDropdownTextStyles,getGapStyles,getIconGlobalSize,getIconRotateStyles,getIconStyles,getItemContainerStyles,getRenderChildrenStyles,getTemplateRow};
1
+ import{getStyleBackgroundByDevice as e,getSingleColorVariable as t,makeStyle as o,makeStyleResponsive as r,getStyleShadow as i,getRadiusStyleActiveState as n,composeSize as l,getGlobalColorStateStyle as a,handleConvertBorderStyle as c,handleConvertBorderWidth as d,handleConvertBorderColor as g,makeGlobalSize as h,makeWidth as s}from"@gem-sdk/core";let filterStyles=e=>{let t=["--mb","--mb-mobile","--mb-tablet","--d","--d-mobile","--d-tablet"];return t.forEach(t=>{delete e?.[t]}),e},contentSizePaddingSize=e=>h(e?.contentSizePadding),getContainerStyles=(t,o)=>({...filterStyles(t),...contentSizePaddingSize(o).gap,...e(t?.backgroundContent),"border-radius":"inherit"}),widthHeightSizeControl=e=>h(e),widthStyle=(e,t,o)=>widthHeightSizeControl(o).width["--w"]?widthHeightSizeControl(o).width:r("w",s(e,t)),getItemContainerStyles=(e,l)=>{let{borderContent:a,backgroundContent:c,roundedContent:d,accordionShadow:g,width:h,fullWidth:s,widthHeightSize:m,iconColor:S,color:p,textColor:b,hasActiveShadow:w}=e??{};return{"--text-hover-color":l?t(b?.active??b?.normal):t(b?.hover??b?.normal),"--icon-expand-hover-color":l?t(p?.active??p?.normal):t(p?.hover??p?.normal),"--icon-expand-active-color":t(p?.active??p?.normal),"--icon-active-color":t(S?.active??S?.normal),"--icon-hover-color":l?t(S?.active??S?.normal):t(S?.hover??S?.normal),...widthStyle(h,s,m),...o({bs:a?.border??a?.border,bw:a?.width??a?.width,bc:t(a?.color??a?.color)}),...r("bg",c),...i({value:g,styleAppliedFor:"box-shadow",isEnableShadow:g?.enable||w}),...n({...d,active:{...d||{},radiusType:"custom"}})}},headerContentPaddingSize=e=>h(e),composePosition=e=>o({fd:"left"===e?"row":"row-reverse",jc:"right"===e?"space-between":""}),getDropdownStyles=(e,r)=>{let{headerContentPadding:i,widthHeightSize:n,itemHeaderSpacing:h,bgColor:s,headerBorder:m}=e??{},{isShow:S,iconPosition:p}=r??{};return{...i&&headerContentPaddingSize(i).padding,...h?.type||i?{}:l(h?.custom),...widthHeightSizeControl(n).height,...composePosition(p),...S?o({bgc:t(s?.active??s?.normal),bs:m?.active?.border??m?.normal?.border,bw:m?.active?.width??m?.normal?.width,bc:t(m?.active?.color??m?.normal?.color)}):{...a("bgc",s),...c(m),...d(m),...g(m),...a("bgc",s)}}},getDropdownTextStyles=(e,r)=>({...r?o({c:t(e?.active??e?.normal)}):o({c:t(e?.normal)})}),getIconRotateStyles=(e,r,i)=>{let{color:n}=e??{};return{...o({c:t(r?n?.active??n?.normal??"transparent":n?.normal??"transparent")}),width:`${i??16}px`,height:`${i??16}px`}},composeIconGlobalSize=e=>h(e),getGapStyles=(e,t)=>({...composeIconGlobalSize(e).gap,...r("jc",t),...r("ta",t)}),getIconStyles=(e,t)=>{let o=t?`${t}px`:"16px";return{...e,width:o,height:o,"--height":o}},getTemplateRow=e=>({"grid-template-rows":`${+!!e}fr`}),getRenderChildrenStyles=()=>({"grid-template-columns":"minmax(auto, 100%)"}),getIconGlobalSize=e=>h(e)?.padding;export{getContainerStyles,getDropdownStyles,getDropdownTextStyles,getGapStyles,getIconGlobalSize,getIconRotateStyles,getIconStyles,getItemContainerStyles,getRenderChildrenStyles,getTemplateRow};
@@ -14,7 +14,7 @@ let generateBadgeContent=(n,i)=>`
14
14
  {% assign amountDiscountValue = amountDiscount | money_without_trailing_zeros %}
15
15
  {% assign price = variant.price | divided_by: 100 %}
16
16
  {% assign minPriceValue = product.variants | map: "price" | sort | first | money_without_trailing_zeros %}
17
- {% assign inventoryQuantityValue = variant.inventory_quantity %}
17
+ {% assign inventoryQuantityValue = variant.inventory_quantity | default: 0 %}
18
18
 
19
19
  {% assign percentDiscountKey = "{percent_discount}" %}
20
20
  {% assign amountDiscountKey = "{amount_discount}" %}
@@ -1,6 +1,6 @@
1
1
  import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -1,10 +1,10 @@
1
- import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
2
- ${r?.map((o,e)=>{if(o)return t`
3
- ${n({...o,index:e})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o),d=()=>t`
2
+ ${r?.map((e,o)=>{if(e)return t`
3
+ ${n({...e,index:o})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
7
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
10
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
@@ -1,6 +1,6 @@
1
1
  import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
@@ -1,10 +1,10 @@
1
- import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
2
- ${r?.map((o,e)=>{if(o)return t`
3
- ${n({...o,index:e})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o),d=()=>t`
2
+ ${r?.map((e,o)=>{if(e)return t`
3
+ ${n({...e,index:o})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
7
- gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
10
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
@@ -79,7 +79,7 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
79
79
  data-id="${v?.uid}"
80
80
  style="${E}"
81
81
  class="${$?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${I}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
82
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${I}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
84
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }}}</script>
85
85
  <product-form class="product-form">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "12.0.0-dev.91",
3
+ "version": "12.0.0-dev.93",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",