@gem-sdk/components 2.0.0-staging.1015 → 2.0.0-staging.1017
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/styles.js +4 -4
- package/dist/cjs/product/components/product-button/SoldOutButton.liquid.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/styles.js +5 -5
- package/dist/esm/product/components/product-button/SoldOutButton.liquid.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,4 +1,4 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle};return t?o:core.filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return core.composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?core.makeStyleResponsive("mr",o):core.makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=core.makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=core.composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":core.getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...core.getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},s=o?.[t],a=r?.[t];if(!s&&!a)return"";let l=`url(${s?.image?.src})`,n=a?`, ${a}`:"";return a?.includes?.(core.GRADIENT_BGR_KEY)&&s?.image?.src?`${l}${n}`:a?.includes?.(core.GRADIENT_BGR_KEY)&&!s?.image?.src?a:s?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return core.makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},s={...t,hover:t?.hover||t?.normal};return{...core.getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:s}),...core.getGlobalColorStateStyle("bg",s)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:s,roundedBtnV2:a}=e??{},l=ignoreStateNoneValue(s||{},'value?.border !== "none"'),n=ignoreStateNoneValue(a||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o,enableHoverEffect:r});return`
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:core.filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return core.composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?core.makeStyleResponsive("mr",o):core.makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=core.makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=core.composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":core.getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...core.getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},s=o?.[t],a=r?.[t];if(!s&&!a)return"";let l=`url(${s?.image?.src})`,n=a?`, ${a}`:"";return a?.includes?.(core.GRADIENT_BGR_KEY)&&s?.image?.src?`${l}${n}`:a?.includes?.(core.GRADIENT_BGR_KEY)&&!s?.image?.src?a:s?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return core.makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},s={...t,hover:t?.hover||t?.normal};return{...core.getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:s}),...core.getGlobalColorStateStyle("bg",s)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:s,roundedBtnV2:a}=e??{},l=ignoreStateNoneValue(s||{},'value?.border !== "none"'),n=ignoreStateNoneValue(a||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o,enableHoverEffect:r});return`
|
|
2
2
|
${g.normalStyles}
|
|
3
3
|
${g.hoverStyles}
|
|
4
4
|
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:s})=>{let a=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=l({styleObj:t,state:"normal"}),g=l({styleObj:s?t:void 0,state:"hover"}),d=l({styleObj:o,state:"normal"}),i=l({styleObj:o,state:"hover"}),u=`
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[data-id="${e}"].gp-button-base::before, [data-id="${e}-interaction"].gp-button-base::before {
|
|
16
16
|
${u}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,y=`
|
|
19
19
|
[data-id="${e}"]:hover::before, [data-id="${e}-interaction"]:hover::before {
|
|
20
20
|
${core.composeBorderCss(g)}
|
|
21
21
|
${core.composeCornerCss(i)}
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base::before {
|
|
25
25
|
${u}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,y=`
|
|
28
28
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base:hover::before {
|
|
29
29
|
${core.composeBorderCss(g)}
|
|
30
30
|
${core.composeCornerCss(i)}
|
|
31
31
|
}
|
|
32
|
-
`}return{normalStyles:c,hoverStyles:
|
|
32
|
+
`}return{normalStyles:c,hoverStyles:y}};exports.generateBorderCornerStyles=generateBorderCornerStyles,exports.getButtonIconStyles=getButtonIconStyles,exports.getButtonStyles=getButtonStyles,exports.getButtonWrapperStyles=getButtonWrapperStyles,exports.getCustomCssStyles=getCustomCssStyles,exports.getRadiusStyles=getRadiusStyles,exports.getShadowStyles=getShadowStyles,exports.getTypoStyles=getTypoStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var system=require("@gem-sdk/system"),data=require("./common/data.js"),ProductButtonPrice_liquid=require("./ProductButtonPrice.liquid.js"),classes=require("./common/classes.js"),Button_liquid=require("../../../button/components/Button.liquid.js");const SoldOutButton=t=>{let{pageContext:e,...s}=t,{styles:u,setting:i,advanced:a,builderProps:d,builderAttrs:
|
|
1
|
+
"use strict";var system=require("@gem-sdk/system"),data=require("./common/data.js"),ProductButtonPrice_liquid=require("./ProductButtonPrice.liquid.js"),classes=require("./common/classes.js"),Button_liquid=require("../../../button/components/Button.liquid.js");const SoldOutButton=t=>{let{pageContext:e,...s}=t,{styles:u,setting:i,advanced:a,builderProps:d,builderAttrs:o}=s,{buttonStyle:l,buttonStyles:r,buttonSettings:n}=data.getSoldOutButtonData(s),c=system.createClass(classes.getSoldOutButtonClasses({isLiquid:!0})),m=ProductButtonPrice_liquid.default({setting:i,styles:u});return Button_liquid.default({advanced:a,style:l,styles:r,nodePrice:m,setting:n,className:c,wrapClassName:"{% if variant.available %} !gp-hidden {% endif %}",builderAttrs:o,builderProps:{...d,uidTranslate:d?.uid,uid:`${d?.uid}-sold-out`},pageContext:e,isUseTranslatedValue:!1,dataId:`${d?.uid}-sold-out`,customAttrs:{"gp-data-hidden":"{% if variant.available %}true{% endif %}"}})};exports.SoldOutButton=SoldOutButton;
|
|
@@ -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:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{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
|
|
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:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{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:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!1}},{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:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{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
|
|
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:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{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:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{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,7 +1,7 @@
|
|
|
1
|
-
import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,makeStyleState,composeBorderCss,composeCornerCss,GRADIENT_BGR_KEY}from"@gem-sdk/core";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle};return t?o:filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?makeStyleResponsive("mr",o):makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},a=o?.[t],n=r?.[t];if(!a&&!n)return"";let l=`url(${a?.image?.src})`,s=n?`, ${n}`:"";return n?.includes?.(GRADIENT_BGR_KEY)&&a?.image?.src?`${l}${s}`:n?.includes?.(GRADIENT_BGR_KEY)&&!a?.image?.src?n:a?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},a={...t,hover:t?.hover||t?.normal};return{...getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:a}),...getGlobalColorStateStyle("bg",a)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:a,roundedBtnV2:n}=e??{},l=ignoreStateNoneValue(a||{},'value?.border !== "none"'),s=ignoreStateNoneValue(n||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:s,builderAttrs:o,enableHoverEffect:r});return`
|
|
1
|
+
import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,makeStyleState,composeBorderCss,composeCornerCss,GRADIENT_BGR_KEY}from"@gem-sdk/core";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?makeStyleResponsive("mr",o):makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},a=o?.[t],n=r?.[t];if(!a&&!n)return"";let l=`url(${a?.image?.src})`,s=n?`, ${n}`:"";return n?.includes?.(GRADIENT_BGR_KEY)&&a?.image?.src?`${l}${s}`:n?.includes?.(GRADIENT_BGR_KEY)&&!a?.image?.src?n:a?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},a={...t,hover:t?.hover||t?.normal};return{...getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:a}),...getGlobalColorStateStyle("bg",a)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:a,roundedBtnV2:n}=e??{},l=ignoreStateNoneValue(a||{},'value?.border !== "none"'),s=ignoreStateNoneValue(n||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:s,builderAttrs:o,enableHoverEffect:r});return`
|
|
2
2
|
${g.normalStyles}
|
|
3
3
|
${g.hoverStyles}
|
|
4
|
-
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:a})=>{let n=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},s=l({styleObj:t,state:"normal"}),g=l({styleObj:a?t:void 0,state:"hover"}),
|
|
4
|
+
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:a})=>{let n=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},s=l({styleObj:t,state:"normal"}),g=l({styleObj:a?t:void 0,state:"hover"}),i=l({styleObj:o,state:"normal"}),d=l({styleObj:o,state:"hover"}),u=`
|
|
5
5
|
content: "";
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
@@ -10,7 +10,7 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
|
|
|
10
10
|
top: 0;
|
|
11
11
|
left: 0;
|
|
12
12
|
${composeBorderCss(s)}
|
|
13
|
-
${composeCornerCss(
|
|
13
|
+
${composeCornerCss(i)}
|
|
14
14
|
`,y=`
|
|
15
15
|
[data-id="${e}"].gp-button-base::before, [data-id="${e}-interaction"].gp-button-base::before {
|
|
16
16
|
${u}
|
|
@@ -18,7 +18,7 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
|
|
|
18
18
|
`,S=`
|
|
19
19
|
[data-id="${e}"]:hover::before, [data-id="${e}-interaction"]:hover::before {
|
|
20
20
|
${composeBorderCss(g)}
|
|
21
|
-
${composeCornerCss(
|
|
21
|
+
${composeCornerCss(d)}
|
|
22
22
|
}
|
|
23
23
|
`;if("ProductButton"===n){let t=r?.["data-is-in-stock"]??!1;y=`
|
|
24
24
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base::before {
|
|
@@ -27,6 +27,6 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
|
|
|
27
27
|
`,S=`
|
|
28
28
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base:hover::before {
|
|
29
29
|
${composeBorderCss(g)}
|
|
30
|
-
${composeCornerCss(
|
|
30
|
+
${composeCornerCss(d)}
|
|
31
31
|
}
|
|
32
32
|
`}return{normalStyles:y,hoverStyles:S}};export{generateBorderCornerStyles,getButtonIconStyles,getButtonStyles,getButtonWrapperStyles,getCustomCssStyles,getRadiusStyles,getShadowStyles,getTypoStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createClass as t}from"@gem-sdk/system";import{getSoldOutButtonData as i}from"./common/data.js";import
|
|
1
|
+
import{createClass as t}from"@gem-sdk/system";import{getSoldOutButtonData as i}from"./common/data.js";import o from"./ProductButtonPrice.liquid.js";import{getSoldOutButtonClasses as d}from"./common/classes.js";import e from"../../../button/components/Button.liquid.js";let SoldOutButton=s=>{let{pageContext:a,...r}=s,{styles:u,setting:l,advanced:n,builderProps:m,builderAttrs:p}=r,{buttonStyle:c,buttonStyles:f,buttonSettings:b}=i(r),v=t(d({isLiquid:!0})),g=o({setting:l,styles:u});return e({advanced:n,style:c,styles:f,nodePrice:g,setting:b,className:v,wrapClassName:"{% if variant.available %} !gp-hidden {% endif %}",builderAttrs:p,builderProps:{...m,uidTranslate:m?.uid,uid:`${m?.uid}-sold-out`},pageContext:a,isUseTranslatedValue:!1,dataId:`${m?.uid}-sold-out`,customAttrs:{"gp-data-hidden":"{% if variant.available %}true{% endif %}"}})};export{SoldOutButton};
|
|
@@ -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:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{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
|
|
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:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{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:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!1}},{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:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{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
|
|
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:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{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:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{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};
|