@gem-sdk/components 2.0.0-dev.866 → 2.0.0-dev.867

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),common=require("./common.js"),productFeaturedImage=require("../../ProductImages/common/productFeaturedImage.js");const getZoomDisplay=e=>common.getDisplayStyle(t=>!core.getResponsiveValueByScreen(e,t),"flex"),HORIZONTAL_LAYOUT=["right","left","inside-left","inside-right"],getCarouselVerticalConfigByPosition=e=>{let t=["desktop","mobile","tablet"],o={};return t.forEach(t=>{let i=core.getResponsiveValueByScreen(e,t),r=HORIZONTAL_LAYOUT.includes(i);o=r?{...o,[t]:!0}:{...o,[t]:!1}}),o},getMinHeightByPosition=(e,t)=>{let o=["desktop","mobile","tablet"],i=getCarouselVerticalConfigByPosition(e),r={};return o.forEach(e=>{let o=core.getResponsiveValueByScreen(t,e),s="desktop"===e?"":`${e}:`;r[`${s}!gp-min-h-0`]=!!i[e]&&"outside"===o,r[`${s}!gp-min-h-full`]=!(i[e]&&"outside"===o)}),core.cls({...r})},getEditorMinHeightClass=(e,t,o)=>{let i=getCarouselVerticalConfigByPosition(t),r=core.getResponsiveValueByScreen(o,e);return i[e]&&"outside"===r?"!gp-min-h-0":"!gp-min-h-full"},getAllowDotConfig=()=>({desktop:!1,tablet:!1,mobile:!1}),getDotStyleConfig=()=>({desktop:"none",tablet:"none",mobile:"none"}),getSettingWidthForGridItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width,r=core.getResponsiveValueByScreen(e.itemSpacing,o),s=0;i?.includes("%")&&(s=100/parseInt(i)),t={...t,[o]:s?`calc(${i} - ${r} * ${s-1} / ${s})`:i}}),t},getSettingWidthForCarouselItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.position,o),r="bottom-center"===i,s=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width;t={...t,[o]:r&&s?.includes("px")?s:"100%"}}),t},getSettingMinWidthForCarouselItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.position,o),r=productFeaturedImage.convertUnitToNumber(core.getResponsiveValueByScreen(e.spacing,o),5),s="bottom-center"===i||"inside-bottom"===i,n=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width,l="100%";if(s){let e=100/productFeaturedImage.convertUnitToNumber(n,20);l=n?.includes("px")?n:n?.includes("%")?`calc(${n} - ${(e-1)*r/e}px)`:"100%"}t={...t,[o]:l}}),t},checkDisplayGalleryByWidth=e=>{let t={desktop:!0,tablet:!0,mobile:!0},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width||"100%",r=0!==parseInt(i);t={...t,[o]:r}}),t},getSliderPerShowConfig=(e,t)=>{let o={desktop:4,tablet:4,mobile:4},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=core.getResponsiveValueByScreen(t,i),s="bottom-center"===r||"inside-bottom"===r,n=core.getResponsiveValueByScreen(e,i)?.width,l=4;n?.includes("%")&&(l=100>parseInt(n)?100/parseInt(n):"auto"),o={...o,[i]:s?l:"auto"}}),o},getShapeByLayout=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=core.getResponsiveValueByScreen(t,i);switch(r){case"bottom-center":case"bottom-left":case"inside-bottom":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeForBottom,i)};break;case"left":case"right":case"inside-left":case"inside-right":o={...o,[i]:core.getResponsiveValueByScreen(e.shape,i)};break;case"only-feature":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeForFtOnly,i)};break;case"one-col":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeFor1Col,i)};break;case"two-col":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeFor2Col,i)}}}),o};exports.HORIZONTAL_LAYOUT=HORIZONTAL_LAYOUT,exports.checkDisplayGalleryByWidth=checkDisplayGalleryByWidth,exports.getAllowDotConfig=getAllowDotConfig,exports.getCarouselVerticalConfigByPosition=getCarouselVerticalConfigByPosition,exports.getDotStyleConfig=getDotStyleConfig,exports.getEditorMinHeightClass=getEditorMinHeightClass,exports.getMinHeightByPosition=getMinHeightByPosition,exports.getSettingMinWidthForCarouselItem=getSettingMinWidthForCarouselItem,exports.getSettingWidthForCarouselItem=getSettingWidthForCarouselItem,exports.getSettingWidthForGridItem=getSettingWidthForGridItem,exports.getShapeByLayout=getShapeByLayout,exports.getSliderPerShowConfig=getSliderPerShowConfig,exports.getZoomDisplay=getZoomDisplay;
1
+ "use strict";var core=require("@gem-sdk/core"),common=require("./common.js"),productFeaturedImage=require("../../ProductImages/common/productFeaturedImage.js");const getZoomDisplay=e=>common.getDisplayStyle(t=>!core.getResponsiveValueByScreen(e,t),"flex"),HORIZONTAL_LAYOUT=["right","left","inside-left","inside-right"],getCarouselVerticalConfigByPosition=e=>{let t=["desktop","mobile","tablet"],o={};return t.forEach(t=>{let i=core.getResponsiveValueByScreen(e,t),r=HORIZONTAL_LAYOUT.includes(i);o=r?{...o,[t]:!0}:{...o,[t]:!1}}),o},getMinHeightByPosition=(e,t)=>{let o=["desktop","mobile","tablet"],i=getCarouselVerticalConfigByPosition(e),r={};return o.forEach(e=>{let o=core.getResponsiveValueByScreen(t,e),s="desktop"===e?"":`${e}:`;r[`${s}!gp-min-h-0`]=!!i[e]&&"outside"===o,r[`${s}!gp-min-h-full`]=!(i[e]&&"outside"===o)}),core.cls({...r})},getEditorMinHeightClass=(e,t,o)=>{let i=getCarouselVerticalConfigByPosition(t),r=core.getResponsiveValueByScreen(o,e);return i[e]&&"outside"===r?"!gp-min-h-0":"!gp-min-h-full"},getAllowDotConfig=()=>({desktop:!1,tablet:!1,mobile:!1}),getDotStyleConfig=()=>({desktop:"none",tablet:"none",mobile:"none"}),getSettingWidthForGridItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width,r=core.getResponsiveValueByScreen(e.itemSpacing,o),s=0;i?.includes("%")&&(s=100/parseInt(i)),t={...t,[o]:s?`calc(${i} - ${r} * ${s-1} / ${s})`:i}}),t},getSettingWidthForCarouselItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.position,o),r="bottom-center"===i,s=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width;t={...t,[o]:r&&s?.includes("px")?s:"100%"}}),t},getSettingMinWidthForCarouselItem=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.position,o),r=productFeaturedImage.convertUnitToNumber(core.getResponsiveValueByScreen(e.spacing,o),5),s="bottom-center"===i||"inside-bottom"===i,n=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width,l="100%";if(s){let e=100/productFeaturedImage.convertUnitToNumber(n,20);l=n?.includes("px")?n:n?.includes("%")?`calc(${n} - ${(e-1)*r/e}px)`:"100%"}t={...t,[o]:l}}),t},checkDisplayGalleryByWidth=e=>{let t={desktop:!0,tablet:!0,mobile:!0},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e.shapeByLayout,o)?.width||"100%",r=0!==parseInt(i);t={...t,[o]:r}}),t},getSliderPerShowConfig=(e,t)=>{let o={desktop:"auto",tablet:"auto",mobile:"auto"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=core.getResponsiveValueByScreen(t,i),s="bottom-center"===r||"inside-bottom"===r,n=core.getResponsiveValueByScreen(e,i)?.width,l="auto";n?.includes("%")&&(l=100>parseInt(n)?100/parseInt(n):"auto"),o={...o,[i]:s?l:"auto"}}),o},getShapeByLayout=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=core.getResponsiveValueByScreen(t,i);switch(r){case"bottom-center":case"bottom-left":case"inside-bottom":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeForBottom,i)};break;case"left":case"right":case"inside-left":case"inside-right":o={...o,[i]:core.getResponsiveValueByScreen(e.shape,i)};break;case"only-feature":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeForFtOnly,i)};break;case"one-col":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeFor1Col,i)};break;case"two-col":o={...o,[i]:core.getResponsiveValueByScreen(e.shapeFor2Col,i)}}}),o};exports.HORIZONTAL_LAYOUT=HORIZONTAL_LAYOUT,exports.checkDisplayGalleryByWidth=checkDisplayGalleryByWidth,exports.getAllowDotConfig=getAllowDotConfig,exports.getCarouselVerticalConfigByPosition=getCarouselVerticalConfigByPosition,exports.getDotStyleConfig=getDotStyleConfig,exports.getEditorMinHeightClass=getEditorMinHeightClass,exports.getMinHeightByPosition=getMinHeightByPosition,exports.getSettingMinWidthForCarouselItem=getSettingMinWidthForCarouselItem,exports.getSettingWidthForCarouselItem=getSettingWidthForCarouselItem,exports.getSettingWidthForGridItem=getSettingWidthForGridItem,exports.getShapeByLayout=getShapeByLayout,exports.getSliderPerShowConfig=getSliderPerShowConfig,exports.getZoomDisplay=getZoomDisplay;
@@ -1 +1 @@
1
- import{getResponsiveValueByScreen as t,cls as e}from"@gem-sdk/core";import{getDisplayStyle as o}from"./common.js";import{convertUnitToNumber as i}from"../../ProductImages/common/productFeaturedImage.js";let getZoomDisplay=e=>o(o=>!t(e,o),"flex"),HORIZONTAL_LAYOUT=["right","left","inside-left","inside-right"],getCarouselVerticalConfigByPosition=e=>{let o=["desktop","mobile","tablet"],i={};return o.forEach(o=>{let l=t(e,o),r=HORIZONTAL_LAYOUT.includes(l);i=r?{...i,[o]:!0}:{...i,[o]:!1}}),i},getMinHeightByPosition=(o,i)=>{let l=["desktop","mobile","tablet"],r=getCarouselVerticalConfigByPosition(o),a={};return l.forEach(e=>{let o=t(i,e),l="desktop"===e?"":`${e}:`;a[`${l}!gp-min-h-0`]=!!r[e]&&"outside"===o,a[`${l}!gp-min-h-full`]=!(r[e]&&"outside"===o)}),e({...a})},getEditorMinHeightClass=(e,o,i)=>{let l=getCarouselVerticalConfigByPosition(o),r=t(i,e);return l[e]&&"outside"===r?"!gp-min-h-0":"!gp-min-h-full"},getAllowDotConfig=()=>({desktop:!1,tablet:!1,mobile:!1}),getDotStyleConfig=()=>({desktop:"none",tablet:"none",mobile:"none"}),getSettingWidthForGridItem=e=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.shapeByLayout,i)?.width,r=t(e.itemSpacing,i),a=0;l?.includes("%")&&(a=100/parseInt(l)),o={...o,[i]:a?`calc(${l} - ${r} * ${a-1} / ${a})`:l}}),o},getSettingWidthForCarouselItem=e=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.position,i),r="bottom-center"===l,a=t(e.shapeByLayout,i)?.width;o={...o,[i]:r&&a?.includes("px")?a:"100%"}}),o},getSettingMinWidthForCarouselItem=e=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let r=t(e.position,l),a=i(t(e.spacing,l),5),s="bottom-center"===r||"inside-bottom"===r,n=t(e.shapeByLayout,l)?.width,g="100%";if(s){let t=100/i(n,20);g=n?.includes("px")?n:n?.includes("%")?`calc(${n} - ${(t-1)*a/t}px)`:"100%"}o={...o,[l]:g}}),o},checkDisplayGalleryByWidth=e=>{let o={desktop:!0,tablet:!0,mobile:!0},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.shapeByLayout,i)?.width||"100%",r=0!==parseInt(l);o={...o,[i]:r}}),o},getSliderPerShowConfig=(e,o)=>{let i={desktop:4,tablet:4,mobile:4},l=["desktop","mobile","tablet"];return l.forEach(l=>{let r=t(o,l),a="bottom-center"===r||"inside-bottom"===r,s=t(e,l)?.width,n=4;s?.includes("%")&&(n=100>parseInt(s)?100/parseInt(s):"auto"),i={...i,[l]:a?n:"auto"}}),i},getShapeByLayout=(e,o)=>{let i={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let r=t(o,l);switch(r){case"bottom-center":case"bottom-left":case"inside-bottom":i={...i,[l]:t(e.shapeForBottom,l)};break;case"left":case"right":case"inside-left":case"inside-right":i={...i,[l]:t(e.shape,l)};break;case"only-feature":i={...i,[l]:t(e.shapeForFtOnly,l)};break;case"one-col":i={...i,[l]:t(e.shapeFor1Col,l)};break;case"two-col":i={...i,[l]:t(e.shapeFor2Col,l)}}}),i};export{HORIZONTAL_LAYOUT,checkDisplayGalleryByWidth,getAllowDotConfig,getCarouselVerticalConfigByPosition,getDotStyleConfig,getEditorMinHeightClass,getMinHeightByPosition,getSettingMinWidthForCarouselItem,getSettingWidthForCarouselItem,getSettingWidthForGridItem,getShapeByLayout,getSliderPerShowConfig,getZoomDisplay};
1
+ import{getResponsiveValueByScreen as t,cls as e}from"@gem-sdk/core";import{getDisplayStyle as o}from"./common.js";import{convertUnitToNumber as i}from"../../ProductImages/common/productFeaturedImage.js";let getZoomDisplay=e=>o(o=>!t(e,o),"flex"),HORIZONTAL_LAYOUT=["right","left","inside-left","inside-right"],getCarouselVerticalConfigByPosition=e=>{let o=["desktop","mobile","tablet"],i={};return o.forEach(o=>{let l=t(e,o),a=HORIZONTAL_LAYOUT.includes(l);i=a?{...i,[o]:!0}:{...i,[o]:!1}}),i},getMinHeightByPosition=(o,i)=>{let l=["desktop","mobile","tablet"],a=getCarouselVerticalConfigByPosition(o),r={};return l.forEach(e=>{let o=t(i,e),l="desktop"===e?"":`${e}:`;r[`${l}!gp-min-h-0`]=!!a[e]&&"outside"===o,r[`${l}!gp-min-h-full`]=!(a[e]&&"outside"===o)}),e({...r})},getEditorMinHeightClass=(e,o,i)=>{let l=getCarouselVerticalConfigByPosition(o),a=t(i,e);return l[e]&&"outside"===a?"!gp-min-h-0":"!gp-min-h-full"},getAllowDotConfig=()=>({desktop:!1,tablet:!1,mobile:!1}),getDotStyleConfig=()=>({desktop:"none",tablet:"none",mobile:"none"}),getSettingWidthForGridItem=e=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.shapeByLayout,i)?.width,a=t(e.itemSpacing,i),r=0;l?.includes("%")&&(r=100/parseInt(l)),o={...o,[i]:r?`calc(${l} - ${a} * ${r-1} / ${r})`:l}}),o},getSettingWidthForCarouselItem=e=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.position,i),a="bottom-center"===l,r=t(e.shapeByLayout,i)?.width;o={...o,[i]:a&&r?.includes("px")?r:"100%"}}),o},getSettingMinWidthForCarouselItem=e=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=t(e.position,l),r=i(t(e.spacing,l),5),s="bottom-center"===a||"inside-bottom"===a,n=t(e.shapeByLayout,l)?.width,g="100%";if(s){let t=100/i(n,20);g=n?.includes("px")?n:n?.includes("%")?`calc(${n} - ${(t-1)*r/t}px)`:"100%"}o={...o,[l]:g}}),o},checkDisplayGalleryByWidth=e=>{let o={desktop:!0,tablet:!0,mobile:!0},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=t(e.shapeByLayout,i)?.width||"100%",a=0!==parseInt(l);o={...o,[i]:a}}),o},getSliderPerShowConfig=(e,o)=>{let i={desktop:"auto",tablet:"auto",mobile:"auto"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=t(o,l),r="bottom-center"===a||"inside-bottom"===a,s=t(e,l)?.width,n="auto";s?.includes("%")&&(n=100>parseInt(s)?100/parseInt(s):"auto"),i={...i,[l]:r?n:"auto"}}),i},getShapeByLayout=(e,o)=>{let i={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=t(o,l);switch(a){case"bottom-center":case"bottom-left":case"inside-bottom":i={...i,[l]:t(e.shapeForBottom,l)};break;case"left":case"right":case"inside-left":case"inside-right":i={...i,[l]:t(e.shape,l)};break;case"only-feature":i={...i,[l]:t(e.shapeForFtOnly,l)};break;case"one-col":i={...i,[l]:t(e.shapeFor1Col,l)};break;case"two-col":i={...i,[l]:t(e.shapeFor2Col,l)}}}),i};export{HORIZONTAL_LAYOUT,checkDisplayGalleryByWidth,getAllowDotConfig,getCarouselVerticalConfigByPosition,getDotStyleConfig,getEditorMinHeightClass,getMinHeightByPosition,getSettingMinWidthForCarouselItem,getSettingWidthForCarouselItem,getSettingWidthForGridItem,getShapeByLayout,getSliderPerShowConfig,getZoomDisplay};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.866",
3
+ "version": "2.0.0-dev.867",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",