@gem-sdk/components 2.0.0-staging.749 → 2.0.0-staging.750
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/components/common/styles.js +1 -1
- package/dist/cjs/product/setting/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/product/setting/product-quantity/configs/uiV2.js +1 -1
- package/dist/esm/button/components/common/styles.js +1 -1
- package/dist/esm/product/setting/product-quantity/configs/settings.js +1 -1
- package/dist/esm/product/setting/product-quantity/configs/uiV2.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=e=>({...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle}),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"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.enable !== false");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},'value?.radiusType !== "none"');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?.textColorHover?.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"}),getBackgroundStyles=e=>{let{backgroundImage:t,backgroundColorV2:o}=e||{},r=Object.entries(
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=e=>({...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle}),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"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.enable !== false");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},'value?.radiusType !== "none"');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?.textColorHover?.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"}),getBackgroundStyles=e=>{let{backgroundImage:t,backgroundColorV2:o}=e||{},r={...t,...!o?.hover&&{hover:t?.hover||t?.normal}},s={...o,hover:o?.hover||o?.normal},l=Object.entries(s||{}).reduce((e,[t])=>((!r?.[t]||helpers.isEmptyObject(r?.[t]))&&s?.[t]&&(e[t]=s[t]),e),{});return{...core.getStyleBackgroundImage(r),...core.getGlobalColorStateStyle("bg",l),...core.getGradientBgrStyleForButton(l)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o})=>{if(!t)return"";let{borderBtnV2:r,roundedBtnV2:s}=e??{},l=ignoreStateNoneValue(r||{},'value?.borderType !== "none"'),n=ignoreStateNoneValue(s||{},'value?.radiusType !== "none"'),a=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o});return`
|
|
2
2
|
${a.normalStyles}
|
|
3
3
|
${a.hoverStyles}
|
|
4
4
|
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r})=>{let s=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=l({styleObj:t,state:"normal"}),a=l({styleObj:t,state:"hover"}),y=l({styleObj:o,state:"normal"}),S=l({styleObj:o,state:"hover"}),g=`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";const ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"qtyStyle",type:"option:value",label:"Style",options:[{label:"Default",value:"standard"},{label:"Simple",value:"minimalist"}],default:"standard"},{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="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817587901825384">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817584339812712">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"></path></svg>`}]},{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-v2",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"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"brand",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"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"style-1",border:"solid",borderWidth:"1px",width:"1px 1px 1px 1px",color:"line-1",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}}}},{id:"corner",label:"Corner",type:"corner-v2",devices:{desktop:{default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"buttonBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"inputBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",default:{normal:"#FFFFFF",hover:"#FFFFFF"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",devices:{desktop:{default:{normal:
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"></path></svg>`}]},{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-v2",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"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"brand",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"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"style-1",border:"solid",borderWidth:"1px",width:"1px 1px 1px 1px",color:"line-1",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}}}},{id:"corner",label:"Corner",type:"corner-v2",devices:{desktop:{default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"buttonBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"inputBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",default:{normal:"#FFFFFF",hover:"#FFFFFF"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",devices:{desktop:{default:{normal:void 0}}},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Text",type:"input:stepper",min:0,devices:{desktop:{default:{normal:1,hover:1}}},state:{hover:!0,normal:!0}}]}];exports.ProductQuantitySettings=ProductQuantitySettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{label:{en:"Style"},controls:[{layout:"vertical",setting:{id:"quantityLayout"},controlChangeTrigger:{settings:[{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"1"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"0"},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!1,groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!0,groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('rounded')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"99999px",bblr:"99999px",bbrr:"99999px",btlr:"99999px",radiusType:"circle"}},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('square')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px"}},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"},controlChangeTrigger:{settings:[{condition:"hasButton === true",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"!hasButton",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}}]}},{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:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Shadow"},setting:{id:"buttonBoxShadow",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},type:"combo",iconName:"polaris-text-title",getValueFromSettingID:"typo.type",isTypoValue:!0,isHideClear:!0,controls:[{setting:{id:"typo"},layout:"vertical",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",isHideClear:!0,conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}]},{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",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},compoDefaultValue:{desktop:{default:{normal:{borderType:"style-1",border:"solid",color:"#212121",width:"1px 1px 1px 1px",borderWidth:"1px"}}}}},{label:{en:"Corner"},setting:{id:"corner",state:"normal"}},{label:{en:"Shadow"},setting:{id:"shapeShadow",state:"normal"}}]},{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
|
+
"use strict";const SettingUIV2=[{label:{en:"Style"},controls:[{layout:"vertical",setting:{id:"quantityLayout"},controlChangeTrigger:{settings:[{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"1"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"0"},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:"#121212"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:void 0},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!1,groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!0,groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('rounded')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"99999px",bblr:"99999px",bbrr:"99999px",btlr:"99999px",radiusType:"circle"}},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('square')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px"}},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"},controlChangeTrigger:{settings:[{condition:"hasButton === true",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"!hasButton",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}}]}},{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:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Shadow"},setting:{id:"buttonBoxShadow",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},type:"combo",iconName:"polaris-text-title",getValueFromSettingID:"typo.type",isTypoValue:!0,isHideClear:!0,controls:[{setting:{id:"typo"},layout:"vertical",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",isHideClear:!0,conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}]},{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",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},compoDefaultValue:{desktop:{default:{normal:{borderType:"style-1",border:"solid",color:"#212121",width:"1px 1px 1px 1px",borderWidth:"1px"}}}}},{label:{en:"Corner"},setting:{id:"corner",state:"normal"}},{label:{en:"Shadow"},setting:{id:"shapeShadow",state:"normal"}}]},{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,4 +1,4 @@
|
|
|
1
|
-
import{makeStyleResponsive,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,getGradientBgrStyleForButton,composeBorderCss,composeCornerCss}from"@gem-sdk/core";import{isEmptyObject}from"../../../helpers.js";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=e=>({...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle}),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"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.enable !== false");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},'value?.radiusType !== "none"');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?.textColorHover?.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"}),getBackgroundStyles=e=>{let{backgroundImage:t,backgroundColorV2:o}=e||{},r=Object.entries(
|
|
1
|
+
import{makeStyleResponsive,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,getGradientBgrStyleForButton,composeBorderCss,composeCornerCss}from"@gem-sdk/core";import{isEmptyObject}from"../../../helpers.js";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=e=>({...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle}),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"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.enable !== false");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},'value?.radiusType !== "none"');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?.textColorHover?.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"}),getBackgroundStyles=e=>{let{backgroundImage:t,backgroundColorV2:o}=e||{},r={...t,...!o?.hover&&{hover:t?.hover||t?.normal}},l={...o,hover:o?.hover||o?.normal},s=Object.entries(l||{}).reduce((e,[t])=>((!r?.[t]||isEmptyObject(r?.[t]))&&l?.[t]&&(e[t]=l[t]),e),{});return{...getStyleBackgroundImage(r),...getGlobalColorStateStyle("bg",s),...getGradientBgrStyleForButton(s)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o})=>{if(!t)return"";let{borderBtnV2:r,roundedBtnV2:l}=e??{},s=ignoreStateNoneValue(r||{},'value?.borderType !== "none"'),n=ignoreStateNoneValue(l||{},'value?.radiusType !== "none"'),a=generateBorderCornerStyles({uid:t,borderBtn:s,roundedBtn:n,builderAttrs:o});return`
|
|
2
2
|
${a.normalStyles}
|
|
3
3
|
${a.hoverStyles}
|
|
4
4
|
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r})=>{let l=r?.["data-component-tag"],s=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=s({styleObj:t,state:"normal"}),a=s({styleObj:t,state:"hover"}),i=s({styleObj:o,state:"normal"}),d=s({styleObj:o,state:"hover"}),u=`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
let ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"qtyStyle",type:"option:value",label:"Style",options:[{label:"Default",value:"standard"},{label:"Simple",value:"minimalist"}],default:"standard"},{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="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817587901825384">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817584339812712">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"></path></svg>`}]},{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-v2",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"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"brand",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"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"style-1",border:"solid",borderWidth:"1px",width:"1px 1px 1px 1px",color:"line-1",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}}}},{id:"corner",label:"Corner",type:"corner-v2",devices:{desktop:{default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"buttonBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"inputBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",default:{normal:"#FFFFFF",hover:"#FFFFFF"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",devices:{desktop:{default:{normal:
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"></path></svg>`}]},{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-v2",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"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"brand",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"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"style-1",border:"solid",borderWidth:"1px",width:"1px 1px 1px 1px",color:"line-1",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}}}},{id:"corner",label:"Corner",type:"corner-v2",devices:{desktop:{default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"buttonBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"inputBoxShadow",type:"shadow-v2",devices:{desktop:{default:{normal:{}}}},compoDefaultValue:{desktop:{default:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",default:{normal:"#FFFFFF",hover:"#FFFFFF"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",devices:{desktop:{default:{normal:void 0}}},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Text",type:"input:stepper",min:0,devices:{desktop:{default:{normal:1,hover:1}}},state:{hover:!0,normal:!0}}]}];export{ProductQuantitySettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:{en:"Style"},controls:[{layout:"vertical",setting:{id:"quantityLayout"},controlChangeTrigger:{settings:[{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"1"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"0"},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!1,groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!0,groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('rounded')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"99999px",bblr:"99999px",bbrr:"99999px",btlr:"99999px",radiusType:"circle"}},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('square')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px"}},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"},controlChangeTrigger:{settings:[{condition:"hasButton === true",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"!hasButton",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}}]}},{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:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Shadow"},setting:{id:"buttonBoxShadow",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},type:"combo",iconName:"polaris-text-title",getValueFromSettingID:"typo.type",isTypoValue:!0,isHideClear:!0,controls:[{setting:{id:"typo"},layout:"vertical",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",isHideClear:!0,conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}]},{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",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},compoDefaultValue:{desktop:{default:{normal:{borderType:"style-1",border:"solid",color:"#212121",width:"1px 1px 1px 1px",borderWidth:"1px"}}}}},{label:{en:"Corner"},setting:{id:"corner",state:"normal"}},{label:{en:"Shadow"},setting:{id:"shapeShadow",state:"normal"}}]},{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};
|
|
1
|
+
let SettingUIV2=[{label:{en:"Style"},controls:[{layout:"vertical",setting:{id:"quantityLayout"},controlChangeTrigger:{settings:[{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"1"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerStroke",newValue:{normal:"0"},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:"#121212"},groupType:"style",controlType:"style"}},{condition:"!quantityLayout.includes('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:void 0},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!1,groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"hasButton",newValue:!0,groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}},{condition:"!quantityLayout.includes('input-only')",source:["quantityLayout"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"quantityLayout.includes('rounded')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"99999px",bblr:"99999px",bbrr:"99999px",btlr:"99999px",radiusType:"circle"}},groupType:"style",controlType:"style"}},{condition:"quantityLayout.includes('square')",source:["quantityLayout"],action:{controlId:"corner",newValue:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px"}},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"},controlChangeTrigger:{settings:[{condition:"hasButton === true",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"standard",groupType:"setting",controlType:"setting"}},{condition:"!hasButton",source:["hasButton"],action:{controlId:"qtyStyle",newValue:"minimalist",groupType:"setting",controlType:"setting"}}]}},{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:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Shadow"},setting:{id:"buttonBoxShadow",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},type:"combo",iconName:"polaris-text-title",getValueFromSettingID:"typo.type",isTypoValue:!0,isHideClear:!0,controls:[{setting:{id:"typo"},layout:"vertical",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",isHideClear:!0,conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",isHideClear:!0,fixedValue:"Enabled",enableCheckSettingsValue:!0,popoverLabel:{en:"Hover effect"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}]},{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",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},compoDefaultValue:{desktop:{default:{normal:{borderType:"style-1",border:"solid",color:"#212121",width:"1px 1px 1px 1px",borderWidth:"1px"}}}}},{label:{en:"Corner"},setting:{id:"corner",state:"normal"}},{label:{en:"Shadow"},setting:{id:"shapeShadow",state:"normal"}}]},{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};
|