@gem-sdk/components 2.0.0-staging.1025 → 2.0.0-staging.1027
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/button/common/attrs.js +1 -1
- package/dist/cjs/button/components/Button.liquid.js +4 -4
- package/dist/cjs/product/components/product-quantity/ProductQuantity.js +1 -1
- package/dist/cjs/product/components/product-quantity/ProductQuantity.liquid.js +1 -1
- package/dist/cjs/product/components/product-quantity/common/classes.js +1 -1
- package/dist/cjs/product/components/product-quantity/common/styles.js +1 -1
- package/dist/cjs/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/esm/button/common/attrs.js +1 -1
- package/dist/esm/button/components/Button.liquid.js +1 -1
- package/dist/esm/product/components/product-quantity/ProductQuantity.js +1 -1
- package/dist/esm/product/components/product-quantity/ProductQuantity.liquid.js +1 -1
- package/dist/esm/product/components/product-quantity/common/classes.js +1 -1
- package/dist/esm/product/components/product-quantity/common/styles.js +1 -1
- package/dist/esm/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const getButtonAttributes=({dataId:t,disabled:a,dataState:e,arialLabel:s
|
|
1
|
+
"use strict";const getButtonAttributes=({dataId:t,disabled:a,dataState:e,arialLabel:s})=>({...!!a&&{disabled:a},"data-id":t,dataId:t,"data-state":e,"aria-label":s});exports.getButtonAttributes=getButtonAttributes;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../../helpers.js"),ButtonIcon_liquid=require("./ButtonIcon.liquid.js"),ButtonLabel_liquid=require("./ButtonLabel.liquid.js"),ButtonLoadingIndicator_liquid=require("./ButtonLoadingIndicator.liquid.js"),helpers=require("../common/helpers.js");const Button=e=>{let{advanced:s,className:t,nodePrice:a,customAttrs:l,styles:r={},setting:i={},builderProps:o,wrapClassName:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../../helpers.js"),ButtonIcon_liquid=require("./ButtonIcon.liquid.js"),ButtonLabel_liquid=require("./ButtonLabel.liquid.js"),ButtonLoadingIndicator_liquid=require("./ButtonLoadingIndicator.liquid.js"),helpers=require("../common/helpers.js");const Button=e=>{let{advanced:s,className:t,nodePrice:a,customAttrs:l,styles:r={},setting:i={},builderProps:o,wrapClassName:n=""}=e,{iconSvg:u,btnLink:c,htmlType:d,disabled:y,enableBtnLink:g,shouldClearSpace:p,disabledLoading:m=!0}=i,{enableTextStyle:$=!0}=r,{customCss:q,wrapStyle:f,restStyle:L,dataState:B,dataIdAttr:S,isShowIcon:b,isScrollToElement:I,getArialLabel:v,getLabelToDisplay:C,checkIsShowLabel:h,checkIsEditableLabel:j}=helpers.getData(e),{HTMLTag:_,urlData:k,shouldRenderLink:E}=helpers.getInsertLinkData({enableBtnLink:g,htmlType:d,setting:c,defaultTag:"button",isLiquid:!0}),T=system.createStyle({...styles.getButtonStyles(r,i?.enableHoverEffect)}),A=system.createStyle({...styles.getTypoStyles(r)}),D=system.createStyle({...styles.getTypoStyles(r),...styles.getButtonIconStyles(r,i)}),P=system.createStyle({...styles.getButtonWrapperStyles(L,r)}),x=system.createClass({...classes.getButtonClasses({styles:r,className:t,shouldRenderLink:E,uid:o?.uid})}),M=system.createClass({...classes.getButtonIconClasses(C({isLiquid:!0}),p,$)}),O=system.createClass({...classes.getButtonLabelClasses(r,j({isLiquid:!0}))}),W=system.createClass({...classes.getButtonWrapperClasses(n,t,s?.cssClass)}),G=system.createClass({...classes.getButtonContentWrapperClasses(i)}),H=system.createAttr({...attrs.getButtonAttributes({disabled:y,dataState:B,dataId:S,arialLabel:v({isLiquid:!0})})}),R=system.createStateOrContext({btnLink:i?.btnLink});return system.Liquid(core.template`
|
|
2
2
|
<gp-button-v7-5
|
|
3
3
|
gp-data='${core.dataStringify(R)}'
|
|
4
4
|
style="${{...f}}"
|
|
5
5
|
>
|
|
6
6
|
<div style="${P}" class="${W}">
|
|
7
|
-
<style>${
|
|
7
|
+
<style>${q}</style>
|
|
8
8
|
${system.If(I,`<a
|
|
9
9
|
class="gp-trigger-button-link gp-hidden"
|
|
10
10
|
href=${k.href}
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
>
|
|
20
20
|
${system.If(!m,ButtonLoadingIndicator_liquid.default(),"")}
|
|
21
21
|
<div class="${G}">
|
|
22
|
-
${system.If(b,ButtonIcon_liquid.default({iconSvg:
|
|
23
|
-
${system.If(
|
|
22
|
+
${system.If(b,ButtonIcon_liquid.default({iconSvg:u??"",styles:D,classes:M}))}
|
|
23
|
+
${system.If($&&h({isLiquid:!0}),ButtonLabel_liquid.default({label:C({isLiquid:!0}),styles:A,classes:O}))}
|
|
24
24
|
</div>
|
|
25
25
|
${system.If(!!a,a?.toString()??"","")}
|
|
26
26
|
</${_}>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useProductQuantity=require("./hooks/useProductQuantity.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=e=>{let{setting:s={},styles:t={},builderProps:r,advanced:a}=e,l=core.useCurrentVariant(),{quantity:n}=core.useQuantity(),{isInStock:u,ref:c,onClickIncrement:o,onClickDecrement:y,onChangeInput:i,onFocusInput:m}=useProductQuantity.useProductQuantity(e),{plusIcon:d,minusIcon:g}=s,j=s.defaultQtyValue||1,{inputHeight:p,buttonBackgroundColor:C,backgroundColor:h,iconColor:x,inputBackgroundColor:S,textColor:b,align:B,borderBtn:I,buttonWidth:f,iconSizeCustom:q,corner:v}=t,A=s?.hasButton,P=system.createAttr({...attrs.getContainerAttrs({isDisabled:!u,uid:r?.uid||""})}),Q=system.createClass({...classes.getContainerClasses(a?.cssClass)}),R=system.createStyle({...styles.getContainerStyles({align:B,inputHeight:p})}),N=system.createClass({...classes.getWrapperClasses()}),H=system.createStyle({...styles.getWrapperStyles({backgroundColor:h,styles:t})}),_=system.createAttr({...attrs.getInputAttr({hasButton:A,quantity:n,currentVariant:l,defaultQty:j})}),k=system.createClass({...classes.getInputClasses({styles:t,borderBtn:I,inputBackgroundColor:S,textColor:b,isDisabled:!u})}),D=system.createStyle({...styles.getInputStyle(e)}),M=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"left",isDisabled:!u})}),W=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),L=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),T=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"right",isDisabled:!u})}),V=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),F=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),O=system.createClass({...classes.getIconWrapperClasses()}),w=system.createStyle({...helpers.getIconWidth(q)});return jsxRuntime.jsx("div",{ref:c,...P,className:Q,style:R,children:jsxRuntime.jsxs("div",{className:N,style:H,children:[system.If(A,jsxRuntime.jsx("button",{...L,onClick:y,className:M,style:W,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getMinusIcon(g)}})})),jsxRuntime.jsx("input",{..._,className:k,style:D,onChange:e=>i(e),onFocus:e=>m(e)}),system.If(A,jsxRuntime.jsx("button",{...F,onClick:o,className:T,style:V,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getPlusIcon(d)}})}))]})})};exports.default=ProductQuantity;
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useProductQuantity=require("./hooks/useProductQuantity.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=e=>{let{setting:s={},styles:t={},builderProps:r,advanced:a}=e,l=core.useCurrentVariant(),{quantity:n}=core.useQuantity(),{isInStock:u,ref:c,onClickIncrement:o,onClickDecrement:y,onChangeInput:i,onFocusInput:m}=useProductQuantity.useProductQuantity(e),{plusIcon:d,minusIcon:g}=s,j=s.defaultQtyValue||1,{inputHeight:p,buttonBackgroundColor:C,backgroundColor:h,iconColor:x,inputBackgroundColor:S,textColor:b,align:B,borderBtn:I,buttonWidth:f,iconSizeCustom:q,corner:v}=t,A=s?.hasButton,P=system.createAttr({...attrs.getContainerAttrs({isDisabled:!u,uid:r?.uid||""})}),Q=system.createClass({...classes.getContainerClasses(a?.cssClass)}),R=system.createStyle({...styles.getContainerStyles({align:B,inputHeight:p})}),N=system.createClass({...classes.getWrapperClasses()}),H=system.createStyle({...styles.getWrapperStyles({backgroundColor:h,styles:t})}),_=system.createAttr({...attrs.getInputAttr({hasButton:A,quantity:n,currentVariant:l,defaultQty:j})}),k=system.createClass({...classes.getInputClasses({styles:t,borderBtn:I,inputBackgroundColor:S,textColor:b,isDisabled:!u})}),D=system.createStyle({...styles.getInputStyle(e)}),M=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"left",isDisabled:!u})}),W=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),L=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),T=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"right",isDisabled:!u})}),V=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,flipStyle:!0,enableHoverButton:s?.enableHoverButton})}),F=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),O=system.createClass({...classes.getIconWrapperClasses()}),w=system.createStyle({...helpers.getIconWidth(q)});return jsxRuntime.jsx("div",{ref:c,...P,className:Q,style:R,children:jsxRuntime.jsxs("div",{className:N,style:H,children:[system.If(A,jsxRuntime.jsx("button",{...L,onClick:y,className:M,style:W,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getMinusIcon(g)}})})),jsxRuntime.jsx("input",{..._,className:k,style:D,onChange:e=>i(e),onFocus:e=>m(e)}),system.If(A,jsxRuntime.jsx("button",{...F,onClick:o,className:T,style:V,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getPlusIcon(d)}})}))]})})};exports.default=ProductQuantity;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=({setting:e={},styles:t={},advanced:s,builderProps:a})=>{let{plusIcon:r,minusIcon:l,updatePrice:n}=e,i=e.defaultQtyValue??1,{inputHeight:c,buttonBackgroundColor:o,iconColor:u,inputBackgroundColor:y,textColor:d,align:p,borderBtn:g,buttonWidth:m,iconSizeCustom:$,corner:f,backgroundColor:b,dividerColor:v,dividerStroke:S}=t,C=e?.hasButton,h=system.createAttr({...attrs.getContainerAttrs({uid:a?.uid||"",isDisableByLiquid:!0})}),q=system.createClass({...classes.getContainerClasses(s?.cssClass)}),B=system.createStyle({...styles.getContainerStyles({align:p,inputHeight:c})}),A=system.createClass({...classes.getWrapperClasses()}),I=system.createStyle({...styles.getWrapperStyles({backgroundColor:b,styles:t})}),_=system.createAttr({...attrs.getInputAttr({isLiquid:!0,hasButton:C,defaultQty:i})}),j=system.createClass({...classes.getInputClasses({styles:t,borderBtn:g,inputBackgroundColor:y,textColor:d})}),P=system.createStyle({...styles.getInputStyle({setting:e,styles:{...t,borderBtn:g,inputBackgroundColor:y,textColor:d,dividerColor:v,dividerStroke:S}})}),E=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"left"})}),R=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),k=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),H=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"right"})}),L=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),M=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),W=system.createClass({...classes.getIconWrapperClasses()}),D=helpers.getIconWidth($);return core.template`
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=({setting:e={},styles:t={},advanced:s,builderProps:a})=>{let{plusIcon:r,minusIcon:l,updatePrice:n}=e,i=e.defaultQtyValue??1,{inputHeight:c,buttonBackgroundColor:o,iconColor:u,inputBackgroundColor:y,textColor:d,align:p,borderBtn:g,buttonWidth:m,iconSizeCustom:$,corner:f,backgroundColor:b,dividerColor:v,dividerStroke:S}=t,C=e?.hasButton,h=system.createAttr({...attrs.getContainerAttrs({uid:a?.uid||"",isDisableByLiquid:!0})}),q=system.createClass({...classes.getContainerClasses(s?.cssClass)}),B=system.createStyle({...styles.getContainerStyles({align:p,inputHeight:c})}),A=system.createClass({...classes.getWrapperClasses()}),I=system.createStyle({...styles.getWrapperStyles({backgroundColor:b,styles:t})}),_=system.createAttr({...attrs.getInputAttr({isLiquid:!0,hasButton:C,defaultQty:i})}),j=system.createClass({...classes.getInputClasses({styles:t,borderBtn:g,inputBackgroundColor:y,textColor:d})}),P=system.createStyle({...styles.getInputStyle({setting:e,styles:{...t,borderBtn:g,inputBackgroundColor:y,textColor:d,dividerColor:v,dividerStroke:S}})}),E=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"left"})}),R=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),k=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),H=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"right"})}),L=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,flipStyle:!0,enableHoverButton:e?.enableHoverButton})}),M=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),W=system.createClass({...classes.getIconWrapperClasses()}),D=helpers.getIconWidth($);return core.template`
|
|
2
2
|
{%- liquid
|
|
3
3
|
assign current_variant = product.selected_or_first_available_variant
|
|
4
4
|
assign available = current_variant.available | default: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let p="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",r=core.composeTypographyClassName(e?.typo,e?.typography),a=core.handleConvertClassColor(s),g=core.getGlobalColorStateClass("bg",t),n=core.getGlobalColorStateClass("text",o);return a&&(p+=` ${a} `),r&&(p+=` ${r} `),g&&(p+=` ${g} `),n&&(p+=` ${n} `),l&&(p+="gp-cursor-not-allowed"),{...core.composeClasses(p)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:t,buttonSide:o,isDisabled:l})=>{let p=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${l?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===o?"gp-minus":"gp-plus"} `,r=core.handleConvertClassColor(e),a=core.getGlobalColorStateClass("bg",s),g=core.getGlobalColorStateClass("text",t);return r&&(p+=` ${r} `),a&&(p+=` ${a} `),g&&(p+=` ${g} `),{...core.composeClasses(p)}},getContainerClasses=e=>({...core.composeClasses(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-w-full")}),getIconWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});exports.getButtonClass=getButtonClass,exports.getContainerClasses=getContainerClasses,exports.getIconWrapperClasses=getIconWrapperClasses,exports.getInputClasses=getInputClasses,exports.getWrapperClasses=getWrapperClasses;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let p="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",r=core.composeTypographyClassName(e?.typo,e?.typography),a=core.handleConvertClassColor(s),g=core.getGlobalColorStateClass("bg",t),n=core.getGlobalColorStateClass("text",o);return a&&(p+=` ${a} `),r&&(p+=` ${r} `),g&&(p+=` ${g} `),n&&(p+=` ${n} `),l&&(p+="gp-cursor-not-allowed"),{...core.composeClasses(p)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:t,buttonSide:o,isDisabled:l})=>{let p=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${l?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===o?"gp-minus":"gp-plus"} `,r=core.handleConvertClassColor(e),a=core.getGlobalColorStateClass("bg",s),g=core.getGlobalColorStateClass("text",t);return r&&(p+=` ${r} `),a&&(p+=` ${a} `),g&&(p+=` ${g} `),{...core.composeClasses(p)}},getContainerClasses=e=>({...core.composeClasses(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});exports.getButtonClass=getButtonClass,exports.getContainerClasses=getContainerClasses,exports.getIconWrapperClasses=getIconWrapperClasses,exports.getInputClasses=getInputClasses,exports.getWrapperClasses=getWrapperClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e||!t)return{};let
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),flipBorderWidth=e=>{if(!e)return e;let t=e.split(" ").map(e=>e.trim());return 4===t.length?`${t[0]} ${t[3]} ${t[2]} ${t[1]}`:e},flipCornerRadius=e=>{if(!e)return e;let t={...e},r=t.btlr,o=t.bblr,l=t.btrr,a=t.bbrr;return t.btrr=o,t.bbrr=r,t.btlr=a,t.bblr=l,t},flipBorderObject=e=>{if(!e)return e;let t={...e};return t.width&&(t.width=flipBorderWidth(t.width)),t},getDividerWidth=(e,t)=>{if(!e||!t)return{};let r=addPxToValues(e),o={...core.makeStyleState("brw",r),...core.makeStyleState("blw",r)};return o},getDividerColorStyle=e=>{if(!e)return{};let t={...e,normal:e?.normal??"transparent"},r={...core.getGlobalColorStateStyle("brc",t),...core.getGlobalColorStateStyle("blc",t)},o=Object.fromEntries(Object.entries(r).filter(([e,t])=>void 0!==t));return o},getInputStyle=e=>{let{styles:t,setting:r}=e,{inputBackgroundColor:o,textColor:l,dividerColor:a,dividerStroke:n}=t??{},{enableHoverInput:s,hasButton:i}=r??{},d=core.composeTypographyStyle(t?.typo,t?.typography),p={...getDividerWidth(n,a),...getDividerColorStyle(a)},c={...core.getGlobalColorStateStyle("bg",{...o,normal:o?.normal??"transparent"}),...core.getGlobalColorStateStyle("c",{...l,hover:l?.hover??l?.normal}),...i?p:{}},S=t?.inputBorder,b={...core.handleConvertBorderStyle(S),...core.handleConvertBorderWidth(S),...core.handleConvertBorderColor(S)},y={...i?{}:b,...i?{}:core.composeRadiusResponsive(t?.shapeRounded),...core.makeStyle({}),...d,...c,...core.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText})};return s?y:core.filterHoverVariables(y)},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:r,iconColor:o,corner:l,flipStyle:a,enableHoverButton:n})=>{let s=a?Object.fromEntries(Object.entries(e||{}).map(([e,t])=>[e,flipBorderObject(t)])):e,i=a?Object.fromEntries(Object.entries(l||{}).map(([e,t])=>[e,flipCornerRadius(t)])):l,d={...core.makeStyleResponsive("w",t),...core.handleConvertBorderStyle(s),...core.handleConvertBorderWidth(s),...core.handleConvertBorderColor(s),...core.getGlobalColorStateStyle("bg",r),...core.getGlobalColorStateStyle("c",o),...core.composeRadius(i)};return n?d:core.filterHoverVariables(d)},getContainerStyles=({inputHeight:e,align:t})=>({...core.makeStyleResponsive("h",e),...core.makeStyleResponsive("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t})=>{let r=t?.shapeShadow,o=core.getResponsiveStyleShadowWithoutState(r,"box-shadow",{desktop:r?.desktop??{},tablet:r?.tablet??r?.desktop??{},mobile:r?.mobile??r?.tablet??r?.desktop??{}});return{...core.getGlobalColorResponsiveStyle("bg",e),...core.makeStyleResponsive("maxw",t?.quantityWidth),...core.composeBorderResponsive(t?.shapeBorder),...core.composeRadiusResponsive(t?.shapeRounded),...o}};exports.getButtonStyle=getButtonStyle,exports.getContainerStyles=getContainerStyles,exports.getInputStyle=getInputStyle,exports.getWrapperStyles=getWrapperStyles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";const ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"hasButton",label:"Button",type:"toggle",default:!0},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1},{id:"plusIcon",type:"icon",isHideClear:!0,customLabel:"Plus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="plus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817698760687976">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="minus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817690725712232">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{}},state:{hover:!0,normal:!0}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];exports.ProductQuantitySettings=ProductQuantitySettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"
|
|
1
|
+
"use strict";const SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];exports.SettingUIV2=SettingUIV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let getButtonAttributes=({dataId:t,disabled:a,dataState:e,arialLabel:d
|
|
1
|
+
let getButtonAttributes=({dataId:t,disabled:a,dataState:e,arialLabel:d})=>({...!!a&&{disabled:a},"data-id":t,dataId:t,"data-state":e,"aria-label":d});export{getButtonAttributes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{template as s,dataStringify as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as o,createClass as r,createAttr as l,createStateOrContext as a,Liquid as d,If as m}from"@gem-sdk/system";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as p,getTypoStyles as u,getButtonIconStyles as c,getButtonWrapperStyles as $}from"../common/styles.js";import{getButtonClasses as f,getButtonIconClasses as g,getButtonLabelClasses as
|
|
1
|
+
import{template as s,dataStringify as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as o,createClass as r,createAttr as l,createStateOrContext as a,Liquid as d,If as m}from"@gem-sdk/system";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as p,getTypoStyles as u,getButtonIconStyles as c,getButtonWrapperStyles as $}from"../common/styles.js";import{getButtonClasses as f,getButtonIconClasses as g,getButtonLabelClasses as b,getButtonWrapperClasses as v,getButtonContentWrapperClasses as L}from"../common/classes.js";import{getSettingPreloadData as y}from"../../helpers.js";import j from"./ButtonIcon.liquid.js";import q from"./ButtonLabel.liquid.js";import k from"./ButtonLoadingIndicator.liquid.js";import{getData as S,getInsertLinkData as h}from"../common/helpers.js";let Button=B=>{let{advanced:E,className:I,nodePrice:T,customAttrs:A,styles:G={},setting:H={},builderProps:M,wrapClassName:_=""}=B,{iconSvg:x,btnLink:C,htmlType:N,disabled:O,enableBtnLink:P,shouldClearSpace:R,disabledLoading:V=!0}=H,{enableTextStyle:w=!0}=G,{customCss:z,wrapStyle:D,restStyle:F,dataState:J,dataIdAttr:K,isShowIcon:Q,isScrollToElement:U,getArialLabel:W,getLabelToDisplay:X,checkIsShowLabel:Y,checkIsEditableLabel:Z}=S(B),{HTMLTag:ss,urlData:st,shouldRenderLink:si}=h({enableBtnLink:P,htmlType:N,setting:C,defaultTag:"button",isLiquid:!0}),se=o({...p(G,H?.enableHoverEffect)}),so=o({...u(G)}),sr=o({...u(G),...c(G,H)}),sl=o({...$(F,G)}),sa=r({...f({styles:G,className:I,shouldRenderLink:si,uid:M?.uid})}),sd=r({...g(X({isLiquid:!0}),R,w)}),sm=r({...b(G,Z({isLiquid:!0}))}),sn=r({...v(_,I,E?.cssClass)}),sp=r({...L(H)}),su=l({...n({disabled:O,dataState:J,dataId:K,arialLabel:W({isLiquid:!0})})}),sc=a({btnLink:H?.btnLink});return d(s`
|
|
2
2
|
<gp-button-v7-5
|
|
3
3
|
gp-data='${t(sc)}'
|
|
4
4
|
style="${{...D}}"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useCurrentVariant as s,useQuantity as o}from"@gem-sdk/core";import{createAttr as l,createClass as n,createStyle as r,If as a}from"@gem-sdk/system";import{useProductQuantity as i}from"./hooks/useProductQuantity.js";import{getContainerAttrs as m,getInputAttr as u,getButtonAttrs as c}from"./common/attrs.js";import{getContainerClasses as d,getWrapperClasses as y,getInputClasses as b,getButtonClass as f,getIconWrapperClasses as
|
|
2
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useCurrentVariant as s,useQuantity as o}from"@gem-sdk/core";import{createAttr as l,createClass as n,createStyle as r,If as a}from"@gem-sdk/system";import{useProductQuantity as i}from"./hooks/useProductQuantity.js";import{getContainerAttrs as m,getInputAttr as u,getButtonAttrs as c}from"./common/attrs.js";import{getContainerClasses as d,getWrapperClasses as y,getInputClasses as b,getButtonClass as f,getIconWrapperClasses as p}from"./common/classes.js";import{getContainerStyles as h,getWrapperStyles as g,getInputStyle as N,getButtonStyle as S}from"./common/styles.js";import{getIconWidth as j,getMinusIcon as v,getPlusIcon as B}from"./common/helpers.js";let ProductQuantity=H=>{let{setting:k={},styles:C={},builderProps:D,advanced:Q}=H,_=s(),{quantity:P}=o(),{isInStock:x,ref:I,onClickIncrement:L,onClickDecrement:M,onChangeInput:T,onFocusInput:F}=i(H),{plusIcon:V,minusIcon:q}=k,w=k.defaultQtyValue||1,{inputHeight:z,buttonBackgroundColor:A,backgroundColor:E,iconColor:G,inputBackgroundColor:J,textColor:K,align:O,borderBtn:R,buttonWidth:U,iconSizeCustom:W,corner:X}=C,Y=k?.hasButton,Z=l({...m({isDisabled:!x,uid:D?.uid||""})}),$=n({...d(Q?.cssClass)}),tt=r({...h({align:O,inputHeight:z})}),te=n({...y()}),ts=r({...g({backgroundColor:E,styles:C})}),to=l({...u({hasButton:Y,quantity:P,currentVariant:_,defaultQty:w})}),tl=n({...b({styles:C,borderBtn:R,inputBackgroundColor:J,textColor:K,isDisabled:!x})}),tn=r({...N(H)}),tr=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"left",isDisabled:!x})}),ta=r({...S({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,enableHoverButton:k?.enableHoverButton})}),ti=l({...c({buttonSide:"left"})}),tm=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"right",isDisabled:!x})}),tu=r({...S({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,flipStyle:!0,enableHoverButton:k?.enableHoverButton})}),tc=l({...c({buttonSide:"right"})}),td=n({...p()}),ty=r({...j(W)});return t("div",{ref:I,...Z,className:$,style:tt,children:e("div",{className:te,style:ts,children:[a(Y,t("button",{...ti,onClick:M,className:tr,style:ta,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:v(q)}})})),t("input",{...to,className:tl,style:tn,onChange:t=>T(t),onFocus:t=>F(t)}),a(Y,t("button",{...tc,onClick:L,className:tm,style:tu,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:B(V)}})}))]})})};export{ProductQuantity as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{template as t,RenderIf as s,isLocalEnv as e,baseAssetURL as a}from"@gem-sdk/core";import{getSettingPreloadData as i}from"../../../helpers.js";import{createAttr as l,createClass as r,createStyle as o}from"@gem-sdk/system";import{getContainerAttrs as n,getInputAttr as u,getButtonAttrs as d}from"./common/attrs.js";import{getContainerClasses as c,getWrapperClasses as p,getInputClasses as f,getButtonClass as m,getIconWrapperClasses as $}from"./common/classes.js";import{getContainerStyles as b,getWrapperStyles as v,getInputStyle as y,getButtonStyle as g}from"./common/styles.js";import{getIconWidth as S,getMinusIcon as _,getPlusIcon as h}from"./common/helpers.js";let ProductQuantity=({setting:j={},styles:q={},advanced:B,builderProps:k})=>{let{plusIcon:E,minusIcon:H,updatePrice:P}=j,Q=j.defaultQtyValue??1,{inputHeight:A,buttonBackgroundColor:G,iconColor:L,inputBackgroundColor:M,textColor:V,align:x,borderBtn:C,buttonWidth:D,iconSizeCustom:I,corner:N,backgroundColor:O,dividerColor:R,dividerStroke:T}=q,w=j?.hasButton,z=l({...n({uid:k?.uid||"",isDisableByLiquid:!0})}),F=r({...c(B?.cssClass)}),J=o({...b({align:x,inputHeight:A})}),K=r({...p()}),U=o({...v({backgroundColor:O,styles:q})}),W=l({...u({isLiquid:!0,hasButton:w,defaultQty:Q})}),X=r({...f({styles:q,borderBtn:C,inputBackgroundColor:M,textColor:V})}),Y=o({...y({setting:j,styles:{...q,borderBtn:C,inputBackgroundColor:M,textColor:V,dividerColor:R,dividerStroke:T}})}),Z=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"left"})}),tt=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ts=l({...d({buttonSide:"left"})}),te=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"right"})}),ta=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ti=l({...d({buttonSide:"right"})}),tl=r({...$()}),tr=S(I);return t`
|
|
1
|
+
import{template as t,RenderIf as s,isLocalEnv as e,baseAssetURL as a}from"@gem-sdk/core";import{getSettingPreloadData as i}from"../../../helpers.js";import{createAttr as l,createClass as r,createStyle as o}from"@gem-sdk/system";import{getContainerAttrs as n,getInputAttr as u,getButtonAttrs as d}from"./common/attrs.js";import{getContainerClasses as c,getWrapperClasses as p,getInputClasses as f,getButtonClass as m,getIconWrapperClasses as $}from"./common/classes.js";import{getContainerStyles as b,getWrapperStyles as v,getInputStyle as y,getButtonStyle as g}from"./common/styles.js";import{getIconWidth as S,getMinusIcon as _,getPlusIcon as h}from"./common/helpers.js";let ProductQuantity=({setting:j={},styles:q={},advanced:B,builderProps:k})=>{let{plusIcon:E,minusIcon:H,updatePrice:P}=j,Q=j.defaultQtyValue??1,{inputHeight:A,buttonBackgroundColor:G,iconColor:L,inputBackgroundColor:M,textColor:V,align:x,borderBtn:C,buttonWidth:D,iconSizeCustom:I,corner:N,backgroundColor:O,dividerColor:R,dividerStroke:T}=q,w=j?.hasButton,z=l({...n({uid:k?.uid||"",isDisableByLiquid:!0})}),F=r({...c(B?.cssClass)}),J=o({...b({align:x,inputHeight:A})}),K=r({...p()}),U=o({...v({backgroundColor:O,styles:q})}),W=l({...u({isLiquid:!0,hasButton:w,defaultQty:Q})}),X=r({...f({styles:q,borderBtn:C,inputBackgroundColor:M,textColor:V})}),Y=o({...y({setting:j,styles:{...q,borderBtn:C,inputBackgroundColor:M,textColor:V,dividerColor:R,dividerStroke:T}})}),Z=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"left"})}),tt=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ts=l({...d({buttonSide:"left"})}),te=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"right"})}),ta=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,flipStyle:!0,enableHoverButton:j?.enableHoverButton})}),ti=l({...d({buttonSide:"right"})}),tl=r({...$()}),tr=S(I);return t`
|
|
2
2
|
{%- liquid
|
|
3
3
|
assign current_variant = product.selected_or_first_available_variant
|
|
4
4
|
assign available = current_variant.available | default: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as l}from"@gem-sdk/core";let getInputClasses=({styles:g,borderBtn:s,inputBackgroundColor:n,textColor:r,isDisabled:a})=>{let o="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",i=e(g?.typo,g?.typography),u=t(s),c=p("bg",n),f=p("text",r);return u&&(o+=` ${u} `),i&&(o+=` ${i} `),c&&(o+=` ${c} `),f&&(o+=` ${f} `),a&&(o+="gp-cursor-not-allowed"),{...l(o)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:g,iconColor:s,buttonSide:n,isDisabled:r})=>{let a=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${r?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===n?"gp-minus":"gp-plus"} `,o=t(e),i=p("bg",g),u=p("text",s);return o&&(a+=` ${o} `),i&&(a+=` ${i} `),u&&(a+=` ${u} `),{...l(a)}},getContainerClasses=e=>({...l(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...l("gp-inline-flex gp-w-full")}),getIconWrapperClasses=()=>({...l("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});export{getButtonClass,getContainerClasses,getIconWrapperClasses,getInputClasses,getWrapperClasses};
|
|
1
|
+
import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as l}from"@gem-sdk/core";let getInputClasses=({styles:g,borderBtn:s,inputBackgroundColor:n,textColor:r,isDisabled:a})=>{let o="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",i=e(g?.typo,g?.typography),u=t(s),c=p("bg",n),f=p("text",r);return u&&(o+=` ${u} `),i&&(o+=` ${i} `),c&&(o+=` ${c} `),f&&(o+=` ${f} `),a&&(o+="gp-cursor-not-allowed"),{...l(o)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:g,iconColor:s,buttonSide:n,isDisabled:r})=>{let a=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${r?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===n?"gp-minus":"gp-plus"} `,o=t(e),i=p("bg",g),u=p("text",s);return o&&(a+=` ${o} `),i&&(a+=` ${i} `),u&&(a+=` ${u} `),{...l(a)}},getContainerClasses=e=>({...l(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...l("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...l("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});export{getButtonClass,getContainerClasses,getIconWrapperClasses,getInputClasses,getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeTypographyStyle as
|
|
1
|
+
import{composeTypographyStyle as t,getGlobalColorStateStyle as e,handleConvertBorderStyle as r,handleConvertBorderWidth as o,handleConvertBorderColor as l,composeRadiusResponsive as i,makeStyle as n,getStyleShadow as a,filterHoverVariables as d,makeStyleResponsive as p,composeRadius as b,getResponsiveStyleShadowWithoutState as s,getGlobalColorResponsiveStyle as u,composeBorderResponsive as h,makeStyleState as m}from"@gem-sdk/core";let addPxToValues=t=>Object.fromEntries(Object.entries(t).map(([t,e])=>[t,`${e}px`])),flipBorderWidth=t=>{if(!t)return t;let e=t.split(" ").map(t=>t.trim());return 4===e.length?`${e[0]} ${e[3]} ${e[2]} ${e[1]}`:t},flipCornerRadius=t=>{if(!t)return t;let e={...t},r=e.btlr,o=e.bblr,l=e.btrr,i=e.bbrr;return e.btrr=o,e.bbrr=r,e.btlr=i,e.bblr=l,e},flipBorderObject=t=>{if(!t)return t;let e={...t};return e.width&&(e.width=flipBorderWidth(e.width)),e},getDividerWidth=(t,e)=>{if(!t||!e)return{};let r=addPxToValues(t),o={...m("brw",r),...m("blw",r)};return o},getDividerColorStyle=t=>{if(!t)return{};let r={...t,normal:t?.normal??"transparent"},o={...e("brc",r),...e("blc",r)},l=Object.fromEntries(Object.entries(o).filter(([t,e])=>void 0!==e));return l},getInputStyle=p=>{let{styles:b,setting:s}=p,{inputBackgroundColor:u,textColor:h,dividerColor:m,dividerStroke:c}=b??{},{enableHoverInput:g,hasButton:f}=s??{},y=t(b?.typo,b?.typography),S={...getDividerWidth(c,m),...getDividerColorStyle(m)},w={...e("bg",{...u,normal:u?.normal??"transparent"}),...e("c",{...h,hover:h?.hover??h?.normal}),...f?S:{}},j=b?.inputBorder,O={...r(j),...o(j),...l(j)},x={...f?{}:O,...f?{}:i(b?.shapeRounded),...n({}),...y,...w,...a({value:b?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:b?.typo?.custom?.hasShadowText})};return g?x:d(x)},getButtonStyle=({borderBtn:t,buttonWidth:i,buttonBackgroundColor:n,iconColor:a,corner:s,flipStyle:u,enableHoverButton:h})=>{let m=u?Object.fromEntries(Object.entries(t||{}).map(([t,e])=>[t,flipBorderObject(e)])):t,c=u?Object.fromEntries(Object.entries(s||{}).map(([t,e])=>[t,flipCornerRadius(e)])):s,g={...p("w",i),...r(m),...o(m),...l(m),...e("bg",n),...e("c",a),...b(c)};return h?g:d(g)},getContainerStyles=({inputHeight:t,align:e})=>({...p("h",t),...p("jc",e)}),getWrapperStyles=({backgroundColor:t,styles:e})=>{let r=e?.shapeShadow,o=s(r,"box-shadow",{desktop:r?.desktop??{},tablet:r?.tablet??r?.desktop??{},mobile:r?.mobile??r?.tablet??r?.desktop??{}});return{...u("bg",t),...p("maxw",e?.quantityWidth),...h(e?.shapeBorder),...i(e?.shapeRounded),...o}};export{getButtonStyle,getContainerStyles,getInputStyle,getWrapperStyles};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
let ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"hasButton",label:"Button",type:"toggle",default:!0},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1},{id:"plusIcon",type:"icon",isHideClear:!0,customLabel:"Plus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="plus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817698760687976">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="minus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817690725712232">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{}},state:{hover:!0,normal:!0}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];export{ProductQuantitySettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"
|
|
1
|
+
let SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];export{SettingUIV2};
|