@gem-sdk/components 2.0.0-staging.995 → 2.0.0-staging.996
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/product/components/product-quantity/common/styles.js +1 -1
- package/dist/cjs/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/esm/product/components/product-quantity/common/styles.js +1 -1
- package/dist/esm/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e)return{};let o=addPxToValues(e),r={...core.makeStyleState("brw",o),...core.makeStyleState("blw",o)};return t?r:{...core.filterHoverVariables(r)}},getDividerColorStyle=(e,t)=>{if(!e)return{};let o={...core.
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e)return{};let o=addPxToValues(e),r={...core.makeStyleState("brw",o),...core.makeStyleState("blw",o)};return t?r:{...core.filterHoverVariables(r)}},getDividerColorStyle=(e,t)=>{if(!e)return{};let o={...core.getGlobalColorStateStyle("brc",e),...core.getGlobalColorStateStyle("blc",e)},r=Object.fromEntries(Object.entries(o).filter(([e,t])=>void 0!==t));return t?r:core.filterHoverVariables(r)},getInputBorderRadius=({qtyStyle:e,corner:t})=>"minimalist"!==e?{}:{...core.composeRadius({...getDeviceRadius("desktop","mixed",t),...getDeviceRadius("tablet","mixed",t),...getDeviceRadius("mobile","mixed",t)})},getInputStyle=e=>{let{styles:t,setting:o}=e,{borderBtn:r,inputBackgroundColor:l,textColor:a,dividerColor:i,dividerStroke:d,corner:s,inputBoxShadow:b}=t??{},{qtyStyle:n}=o??{},p=core.composeTypographyStyle(t?.typo,t?.typography),c=getDividerWidth(d,o?.enableHoverInput),S=getDividerColorStyle(i,o?.enableHoverInput),v=core.getResponsiveStyleShadow(b,"box-shadow",{desktop:b?.desktop??{},tablet:b?.tablet??b?.desktop??{},mobile:b?.mobile??b?.tablet??b?.desktop??{}}),y={...core.handleConvertBorderStyle(r),...core.handleConvertInputBorderWidth(r,n),...core.handleConvertInputBorderColor(r),...core.getGlobalColorStateStyle("bg",l),...v??{},...core.getGlobalColorStateStyle("c",{...a,hover:a?.hover??a?.normal})};return{...core.makeStyle({}),...p,...o?.enableHoverInput?y:core.filterHoverVariables(y),..."standard"===n?c:{},...S,...core.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText}),...getInputBorderRadius({qtyStyle:n,corner:s})}},getDeviceRadius=(e,t,o)=>{let r="left"===t||"mixed"===t,l="right"===t||"mixed"===t;return{[e]:{normal:{btlr:r?o?.[e]?.normal?.btlr:void 0,bblr:r?o?.[e]?.normal?.bblr:void 0,btrr:l?o?.[e]?.normal?.btrr:void 0,bbrr:l?o?.[e]?.normal?.bbrr:void 0,radiusType:o?.[e]?.normal?.radiusType??"custom"},hover:{btlr:r?o?.[e]?.hover?.btlr:void 0,bblr:r?o?.[e]?.hover?.bblr:void 0,btrr:l?o?.[e]?.hover?.btrr:void 0,bbrr:l?o?.[e]?.hover?.bbrr:void 0,radiusType:o?.[e]?.hover?.radiusType??"custom"}}}},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:o,iconColor:r,corner:l,buttonSide:a,buttonBoxShadow:i,enableHoverButton:d})=>{let s=core.getResponsiveStyleShadow(i,"box-shadow",{desktop:i?.desktop??{},tablet:i?.tablet??i?.desktop??{},mobile:i?.mobile??i?.tablet??i?.desktop??{}}),b={...core.handleConvertBorderStyle(e),...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.getGlobalColorStateStyle("bg",o),...core.getGlobalColorStateStyle("c",r)};return{...core.makeStyleResponsive("w",t),...d?b:core.filterHoverVariables(b),...core.composeRadius({...getDeviceRadius("desktop",a,l),...getDeviceRadius("tablet",a,l),...getDeviceRadius("mobile",a,l)}),...d?s:core.filterHoverVariables(s??{})}},getContainerStyles=({inputHeight:e,align:t})=>({...core.makeStyleResponsive("h",e),...core.makeStyleResponsive("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t})=>{let o=t?.shapeShadow,r=core.getResponsiveStyleShadow(o,"box-shadow",{desktop:o?.desktop??{},tablet:o?.tablet??o?.desktop??{},mobile:o?.mobile??o?.tablet??o?.desktop??{}});return{...core.getGlobalColorStateStyle("bg",e),...core.makeStyleResponsive("maxw",t?.quantityWidth),...r}};exports.getButtonStyle=getButtonStyle,exports.getContainerStyles=getContainerStyles,exports.getInputStyle=getInputStyle,exports.getWrapperStyles=getWrapperStyles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";const ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"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="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:!
|
|
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-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"},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",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"}}}},state:{hover:!0,normal:!0}},{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:"rgba(18, 18, 18, 0.20)",angle:45}}}}},{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",default:{normal:void 0},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Text",type:"input:stepper",min:1,default:{normal:0,hover:0},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('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:"line-3"},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",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},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:"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",compoDefaultValue:"line-3",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",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},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",compoDefaultValue:"line-3",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}],conditionDisplay:"!quantityLayout.includes('input-only')"},{id:"borderBtn",label:{en:"Border"},controlConfig:{id:"borderBtn",type:"border-v2",linkWithSetting:{name:"borderBtn",field:"hover"}},isHideClear:!0,conditionDisplay:"quantityLayout.includes('input-only')"},{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:"line-3"},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",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:"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",compoDefaultValue:"line-3",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",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"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",compoDefaultValue:"line-3",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}],conditionDisplay:"!quantityLayout.includes('input-only') || (quantityLayout.includes('input-only') && hasButton === true)"},{id:"borderBtn",label:{en:"Border"},controlConfig:{id:"borderBtn",type:"border-v2",linkWithSetting:{name:"borderBtn",field:"hover"}},isHideClear:!0,conditionDisplay:"quantityLayout.includes('input-only') && 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",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 +1 @@
|
|
|
1
|
-
import{composeTypographyStyle as e,getResponsiveStyleShadow as t,handleConvertBorderStyle as r,handleConvertInputBorderWidth as o,handleConvertInputBorderColor as i,getGlobalColorStateStyle as
|
|
1
|
+
import{composeTypographyStyle as e,getResponsiveStyleShadow as t,handleConvertBorderStyle as r,handleConvertInputBorderWidth as o,handleConvertInputBorderColor as i,getGlobalColorStateStyle as l,makeStyle as d,filterHoverVariables as a,getStyleShadow as b,handleConvertBorderWidth as s,handleConvertBorderColor as p,makeStyleResponsive as n,composeRadius as u,makeStyleState as m}from"@gem-sdk/core";let addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e)return{};let r=addPxToValues(e),o={...m("brw",r),...m("blw",r)};return t?o:{...a(o)}},getDividerColorStyle=(e,t)=>{if(!e)return{};let r={...l("brc",e),...l("blc",e)},o=Object.fromEntries(Object.entries(r).filter(([e,t])=>void 0!==t));return t?o:a(o)},getInputBorderRadius=({qtyStyle:e,corner:t})=>"minimalist"!==e?{}:{...u({...getDeviceRadius("desktop","mixed",t),...getDeviceRadius("tablet","mixed",t),...getDeviceRadius("mobile","mixed",t)})},getInputStyle=s=>{let{styles:p,setting:n}=s,{borderBtn:u,inputBackgroundColor:m,textColor:v,dividerColor:g,dividerStroke:h,corner:c,inputBoxShadow:y}=p??{},{qtyStyle:x}=n??{},k=e(p?.typo,p?.typography),S=getDividerWidth(h,n?.enableHoverInput),w=getDividerColorStyle(g,n?.enableHoverInput),D=t(y,"box-shadow",{desktop:y?.desktop??{},tablet:y?.tablet??y?.desktop??{},mobile:y?.mobile??y?.tablet??y?.desktop??{}}),R={...r(u),...o(u,x),...i(u),...l("bg",m),...D??{},...l("c",{...v,hover:v?.hover??v?.normal})};return{...d({}),...k,...n?.enableHoverInput?R:a(R),..."standard"===x?S:{},...w,...b({value:p?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:p?.typo?.custom?.hasShadowText}),...getInputBorderRadius({qtyStyle:x,corner:c})}},getDeviceRadius=(e,t,r)=>{let o="left"===t||"mixed"===t,i="right"===t||"mixed"===t;return{[e]:{normal:{btlr:o?r?.[e]?.normal?.btlr:void 0,bblr:o?r?.[e]?.normal?.bblr:void 0,btrr:i?r?.[e]?.normal?.btrr:void 0,bbrr:i?r?.[e]?.normal?.bbrr:void 0,radiusType:r?.[e]?.normal?.radiusType??"custom"},hover:{btlr:o?r?.[e]?.hover?.btlr:void 0,bblr:o?r?.[e]?.hover?.bblr:void 0,btrr:i?r?.[e]?.hover?.btrr:void 0,bbrr:i?r?.[e]?.hover?.bbrr:void 0,radiusType:r?.[e]?.hover?.radiusType??"custom"}}}},getButtonStyle=({borderBtn:e,buttonWidth:o,buttonBackgroundColor:i,iconColor:d,corner:b,buttonSide:m,buttonBoxShadow:v,enableHoverButton:g})=>{let h=t(v,"box-shadow",{desktop:v?.desktop??{},tablet:v?.tablet??v?.desktop??{},mobile:v?.mobile??v?.tablet??v?.desktop??{}}),c={...r(e),...s(e),...p(e),...l("bg",i),...l("c",d)};return{...n("w",o),...g?c:a(c),...u({...getDeviceRadius("desktop",m,b),...getDeviceRadius("tablet",m,b),...getDeviceRadius("mobile",m,b)}),...g?h:a(h??{})}},getContainerStyles=({inputHeight:e,align:t})=>({...n("h",e),...n("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:r})=>{let o=r?.shapeShadow,i=t(o,"box-shadow",{desktop:o?.desktop??{},tablet:o?.tablet??o?.desktop??{},mobile:o?.mobile??o?.tablet??o?.desktop??{}});return{...l("bg",e),...n("maxw",r?.quantityWidth),...i}};export{getButtonStyle,getContainerStyles,getInputStyle,getWrapperStyles};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
let ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"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="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:!
|
|
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-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"},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",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"}}}},state:{hover:!0,normal:!0}},{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:"rgba(18, 18, 18, 0.20)",angle:45}}}}},{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",default:{normal:void 0},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Text",type:"input:stepper",min:1,default:{normal:0,hover:0},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('divider')",source:["quantityLayout"],action:{controlId:"dividerColor",newValue:{normal:"line-3"},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",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},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:"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",compoDefaultValue:"line-3",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",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},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",compoDefaultValue:"line-3",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}],conditionDisplay:"!quantityLayout.includes('input-only')"},{id:"borderBtn",label:{en:"Border"},controlConfig:{id:"borderBtn",type:"border-v2",linkWithSetting:{name:"borderBtn",field:"hover"}},isHideClear:!0,conditionDisplay:"quantityLayout.includes('input-only')"},{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:"line-3"},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",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:"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",compoDefaultValue:"line-3",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",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"}},{id:"divider-hover",label:{en:"Divider"},type:"combo",iconName:"polaris-edit",getValueFromSettingID:"dividerColor.hover",comboType:"color",compoDefaultValue:"line-3",isHideClear:!0,controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"hover"}},{label:{en:"Stroke"},setting:{id:"dividerStroke",state:"hover"}}],conditionDisplay:"!quantityLayout.includes('input-only') || (quantityLayout.includes('input-only') && hasButton === true)"},{id:"borderBtn",label:{en:"Border"},controlConfig:{id:"borderBtn",type:"border-v2",linkWithSetting:{name:"borderBtn",field:"hover"}},isHideClear:!0,conditionDisplay:"quantityLayout.includes('input-only') && 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",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};
|