@gem-sdk/components 2.0.0-dev.370 → 2.0.0-dev.371

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.
Files changed (124) hide show
  1. package/dist/cjs/builder.js +2 -2
  2. package/dist/cjs/button/setting/configs/settings.js +0 -14
  3. package/dist/cjs/carousel/arrow/Arrow.js +52 -0
  4. package/dist/cjs/carousel/arrow/Arrow.liquid.js +46 -0
  5. package/dist/cjs/carousel/{components/common/arrow.js → arrow/common/common.js} +13 -11
  6. package/dist/cjs/carousel/arrow/common/getClass.js +50 -0
  7. package/dist/cjs/carousel/arrow/common/getStyle.js +84 -0
  8. package/dist/cjs/carousel/carousel-item/CarouselItem.js +32 -0
  9. package/dist/cjs/carousel/carousel-item/CarouselItem.liquid.js +38 -0
  10. package/dist/cjs/carousel/carousel-item/common/getClass.js +29 -0
  11. package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +30 -47
  12. package/dist/cjs/carousel/carousel-item/hook/useCarouseItem.js +14 -0
  13. package/dist/cjs/carousel/components/const/index.js +5 -0
  14. package/dist/cjs/carousel/dots/Dots.js +51 -0
  15. package/dist/cjs/carousel/dots/Dots.liquid.js +26 -0
  16. package/dist/cjs/carousel/dots/common/common.js +46 -0
  17. package/dist/cjs/carousel/dots/common/getClass.js +40 -0
  18. package/dist/cjs/carousel/dots/common/getStyle.js +33 -0
  19. package/dist/cjs/carousel/dots/hook/useDotsSetting.js +21 -0
  20. package/dist/cjs/carousel/index.js +1 -2
  21. package/dist/cjs/carousel/next.js +2 -2
  22. package/dist/cjs/carousel/root/Carousel.js +129 -0
  23. package/dist/cjs/carousel/root/Carousel.liquid.js +104 -0
  24. package/dist/cjs/carousel/root/common/getAttr.js +25 -0
  25. package/dist/cjs/carousel/root/common/getClass.js +135 -0
  26. package/dist/cjs/carousel/root/common/getData.js +56 -0
  27. package/dist/cjs/carousel/root/common/getStyle.js +64 -0
  28. package/dist/cjs/carousel/{components/Carousel.js → root/hook/useCarousel.js} +153 -321
  29. package/dist/cjs/carousel/setting/Carousel.js +8 -1555
  30. package/dist/cjs/carousel/setting/configs/presets.js +380 -0
  31. package/dist/cjs/carousel/setting/configs/settingV2.js +771 -0
  32. package/dist/cjs/carousel/setting/configs/uiV1.js +434 -0
  33. package/dist/cjs/carousel/setting/configs/uiV2.js +627 -0
  34. package/dist/cjs/common/components/NoDataState.js +5 -5
  35. package/dist/cjs/grid/row/commons/common.js +3 -3
  36. package/dist/cjs/index.js +2 -2
  37. package/dist/cjs/index.liquid.js +2 -2
  38. package/dist/cjs/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
  39. package/dist/cjs/product/components/ProductImages/ProductImagesLightBox.js +2 -2
  40. package/dist/cjs/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
  41. package/dist/cjs/product/components/ProductImagesV2/common/getAttr.js +1 -0
  42. package/dist/cjs/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
  43. package/dist/cjs/product/components/ProductImagesV2/common/productGallery.js +1 -1
  44. package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
  45. package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
  46. package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
  47. package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
  48. package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
  49. package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
  50. package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.js +2 -2
  51. package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
  52. package/dist/cjs/product/components/ProductList/common/index.js +5 -5
  53. package/dist/cjs/product/components/ProductVariants/common/main/getAttr.js +1 -1
  54. package/dist/cjs/text/components/Text.js +3 -3
  55. package/dist/esm/builder.js +2 -2
  56. package/dist/esm/button/setting/configs/settings.js +0 -14
  57. package/dist/esm/carousel/arrow/Arrow.js +48 -0
  58. package/dist/esm/carousel/arrow/Arrow.liquid.js +42 -0
  59. package/dist/esm/carousel/{components/common/arrow.js → arrow/common/common.js} +12 -10
  60. package/dist/esm/carousel/arrow/common/getClass.js +48 -0
  61. package/dist/esm/carousel/arrow/common/getStyle.js +82 -0
  62. package/dist/esm/carousel/carousel-item/CarouselItem.js +28 -0
  63. package/dist/esm/carousel/carousel-item/CarouselItem.liquid.js +34 -0
  64. package/dist/esm/carousel/carousel-item/common/getClass.js +27 -0
  65. package/dist/esm/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +31 -46
  66. package/dist/esm/carousel/carousel-item/hook/useCarouseItem.js +12 -0
  67. package/dist/esm/carousel/components/const/index.js +3 -0
  68. package/dist/esm/carousel/dots/Dots.js +47 -0
  69. package/dist/esm/carousel/dots/Dots.liquid.js +22 -0
  70. package/dist/esm/carousel/dots/common/common.js +43 -0
  71. package/dist/esm/carousel/dots/common/getClass.js +38 -0
  72. package/dist/esm/carousel/dots/common/getStyle.js +31 -0
  73. package/dist/esm/carousel/dots/hook/useDotsSetting.js +19 -0
  74. package/dist/esm/carousel/index.js +1 -2
  75. package/dist/esm/carousel/next.js +2 -2
  76. package/dist/esm/carousel/root/Carousel.js +125 -0
  77. package/dist/esm/carousel/root/Carousel.liquid.js +100 -0
  78. package/dist/esm/carousel/root/common/getAttr.js +23 -0
  79. package/dist/esm/carousel/root/common/getClass.js +133 -0
  80. package/dist/esm/carousel/root/common/getData.js +54 -0
  81. package/dist/esm/carousel/root/common/getStyle.js +62 -0
  82. package/dist/esm/carousel/{components/Carousel.js → root/hook/useCarousel.js} +150 -316
  83. package/dist/esm/carousel/setting/Carousel.js +8 -1555
  84. package/dist/esm/carousel/setting/configs/presets.js +378 -0
  85. package/dist/esm/carousel/setting/configs/settingV2.js +769 -0
  86. package/dist/esm/carousel/setting/configs/uiV1.js +432 -0
  87. package/dist/esm/carousel/setting/configs/uiV2.js +625 -0
  88. package/dist/esm/common/components/NoDataState.js +6 -6
  89. package/dist/esm/grid/row/commons/common.js +1 -1
  90. package/dist/esm/index.js +2 -2
  91. package/dist/esm/index.liquid.js +2 -2
  92. package/dist/esm/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
  93. package/dist/esm/product/components/ProductImages/ProductImagesLightBox.js +2 -2
  94. package/dist/esm/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
  95. package/dist/esm/product/components/ProductImagesV2/common/getAttr.js +1 -0
  96. package/dist/esm/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
  97. package/dist/esm/product/components/ProductImagesV2/common/productGallery.js +1 -1
  98. package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
  99. package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
  100. package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
  101. package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
  102. package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
  103. package/dist/esm/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
  104. package/dist/esm/product/components/ProductList/ProductListCarouselLayout.js +2 -2
  105. package/dist/esm/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
  106. package/dist/esm/product/components/ProductList/common/index.js +3 -3
  107. package/dist/esm/product/components/ProductVariants/common/main/getAttr.js +1 -1
  108. package/dist/esm/text/components/Text.js +4 -4
  109. package/dist/types/index.d.ts +164 -67
  110. package/package.json +3 -3
  111. package/dist/cjs/carousel/components/Arrow.js +0 -110
  112. package/dist/cjs/carousel/components/Arrow.liquid.js +0 -103
  113. package/dist/cjs/carousel/components/Carousel.liquid.js +0 -256
  114. package/dist/cjs/carousel/components/CarouselItem.js +0 -88
  115. package/dist/cjs/carousel/components/Dots.js +0 -69
  116. package/dist/cjs/carousel/components/Dots.liquid.js +0 -23
  117. package/dist/cjs/carousel/components/common/dots.js +0 -57
  118. package/dist/esm/carousel/components/Arrow.js +0 -106
  119. package/dist/esm/carousel/components/Arrow.liquid.js +0 -99
  120. package/dist/esm/carousel/components/Carousel.liquid.js +0 -252
  121. package/dist/esm/carousel/components/CarouselItem.js +0 -84
  122. package/dist/esm/carousel/components/Dots.js +0 -65
  123. package/dist/esm/carousel/components/Dots.liquid.js +0 -19
  124. package/dist/esm/carousel/components/common/dots.js +0 -53
@@ -20,8 +20,8 @@ var ArticleReadMore = require('./article/components/ArticleReadMore.js');
20
20
  var HeroBanner = require('./banner/components/HeroBanner.js');
21
21
  var Breadcrumb = require('./breadcrumb/components/Breadcrumb.js');
22
22
  var Button = require('./button/components/Button.js');
23
- var Carousel = require('./carousel/components/Carousel.js');
24
- var CarouselItem = require('./carousel/components/CarouselItem.js');
23
+ var Carousel = require('./carousel/root/Carousel.js');
24
+ var CarouselItem = require('./carousel/carousel-item/CarouselItem.js');
25
25
  var Cart = require('./cart/components/Cart.js');
26
26
  var CartList = require('./cart/components/CartList.js');
27
27
  var CartLinePrice = require('./cart/components/CartLinePrice.js');
@@ -197,13 +197,6 @@ const ButtonSettings = [
197
197
  bbrr: '0px',
198
198
  btlr: '0px',
199
199
  radiusType: 'none'
200
- },
201
- hover: {
202
- btrr: '0px',
203
- bblr: '0px',
204
- bbrr: '0px',
205
- btlr: '0px',
206
- radiusType: 'none'
207
200
  }
208
201
  }
209
202
  }
@@ -217,13 +210,6 @@ const ButtonSettings = [
217
210
  bbrr: '8px',
218
211
  btlr: '8px',
219
212
  radiusType: 'rounded'
220
- },
221
- hover: {
222
- btrr: '8px',
223
- bblr: '8px',
224
- bbrr: '8px',
225
- btlr: '8px',
226
- radiusType: 'rounded'
227
213
  }
228
214
  }
229
215
  }
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var getClass = require('./common/getClass.js');
8
+ var getStyle = require('./common/getStyle.js');
9
+ var common = require('./common/common.js');
10
+ var system = require('@gem-sdk/system');
11
+
12
+ const Arrow = (props)=>{
13
+ const { custom, left, onClick } = props;
14
+ const { isRenderCustomIcon } = common.getData(props);
15
+ const { buttonClass, buttonContentClass } = getClass.getClass(props);
16
+ const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle.getStyle(props, 'react');
17
+ const customIcon = system.If(isRenderCustomIcon, custom ?? '', /*#__PURE__*/ jsxRuntime.jsx("svg", {
18
+ height: "100%",
19
+ width: "100%",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ viewBox: "0 0 24 24",
22
+ fill: "currentColor",
23
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
24
+ d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
25
+ })
26
+ }));
27
+ const buttonContent = /*#__PURE__*/ jsxRuntime.jsx("div", {
28
+ className: buttonContentClass,
29
+ style: buttonContentStyle,
30
+ dangerouslySetInnerHTML: {
31
+ __html: customIcon || ''
32
+ }
33
+ });
34
+ return /*#__PURE__*/ jsxRuntime.jsxs("button", {
35
+ type: "button",
36
+ "aria-label": `Carousel ${left ? 'Back' : 'Next'} Arrow`,
37
+ className: buttonClass,
38
+ style: buttonStyle,
39
+ onClick: onClick,
40
+ children: [
41
+ /*#__PURE__*/ jsxRuntime.jsx("style", {
42
+ type: "text/css",
43
+ dangerouslySetInnerHTML: {
44
+ __html: innerBorderCss
45
+ }
46
+ }),
47
+ buttonContent
48
+ ]
49
+ });
50
+ };
51
+
52
+ exports.default = Arrow;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@gem-sdk/core');
6
+ var getClass = require('./common/getClass.js');
7
+ var getStyle = require('./common/getStyle.js');
8
+ var common = require('./common/common.js');
9
+ var system = require('@gem-sdk/system');
10
+
11
+ const Arrow = (props)=>{
12
+ const { custom, left } = props;
13
+ const { isRenderCustomIcon } = common.getData(props);
14
+ const { buttonClass, buttonContentClass } = getClass.getClass(props);
15
+ const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle.getStyle(props);
16
+ const customIcon = system.If(isRenderCustomIcon, custom ?? '', `<svg
17
+ height="100%"
18
+ width="100%"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ viewBox="0 0 24 24"
21
+ fill="currentColor"
22
+ >
23
+ <path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" />
24
+ </svg>`);
25
+ const buttonContent = core.template`
26
+ <div
27
+ class="${buttonContentClass}"
28
+ style="${buttonContentStyle}"
29
+ >
30
+ ${customIcon || ''}
31
+ </div>
32
+ `;
33
+ return core.template`
34
+ <button
35
+ type="button"
36
+ aria-label='Carousel ${left ? 'Back' : 'Next'} Arrow'
37
+ class="${buttonClass}"
38
+ style="${buttonStyle}"
39
+ >
40
+ <style type="text/css">${innerBorderCss}</style>
41
+ ${buttonContent}
42
+ </button>
43
+ `;
44
+ };
45
+
46
+ exports.default = Arrow;
@@ -17,7 +17,7 @@ const getResponsiveSetting = (setting)=>{
17
17
  mobile
18
18
  };
19
19
  };
20
- const getClassArrowPosition = ({ vertical, arrowType, gapToEachSize, left })=>{
20
+ const getArrowPositionStyle = ({ vertical, arrowType, gapToEachSize, left })=>{
21
21
  const result = {};
22
22
  devices.forEach((item)=>{
23
23
  const verticalResponsive = core.getResponsiveValueByScreen(vertical, item, false);
@@ -48,13 +48,9 @@ const getClassArrowRotate = (left, vertical)=>{
48
48
  });
49
49
  return result;
50
50
  };
51
- const getArrowRotate = (left, vertical)=>{
52
- const rotation = left ? vertical ? '[-90deg]' : '180' : vertical ? '90' : '0';
53
- return `gp-rotate-${rotation}`;
54
- };
55
51
  const getClassArrowDisplay = (arrowType, vertical)=>{
56
52
  const result = {};
57
- devices.map((device)=>{
53
+ devices.forEach((device)=>{
58
54
  const verticalResponsive = core.getResponsiveValueByScreen(vertical, device, false);
59
55
  const deviceRes = device === 'desktop' ? '' : `${device}:`;
60
56
  result[`${deviceRes}!gp-flex ${deviceRes}!gp-absolute ${deviceRes}gp-z-2`] = arrowType[device] === 'inside' || !!verticalResponsive;
@@ -65,7 +61,7 @@ const getClassArrowDisplay = (arrowType, vertical)=>{
65
61
  };
66
62
  const getArrowDisplayStyle = (arrowType)=>{
67
63
  let result = {};
68
- devices.map((device)=>{
64
+ devices.forEach((device)=>{
69
65
  const arrowTypeResponsive = core.getResponsiveValueByScreen(arrowType, device, 'none');
70
66
  result = {
71
67
  ...result,
@@ -92,7 +88,7 @@ const mappingNavigationCarousel = (setting)=>{
92
88
  ...value
93
89
  };
94
90
  const deviceNotExits = devices.filter((x)=>!Object.keys(newValue).includes(x));
95
- deviceNotExits.map((el)=>{
91
+ deviceNotExits.forEach((el)=>{
96
92
  if (el === 'tablet') {
97
93
  newValue[el] = newValue['desktop'];
98
94
  }
@@ -107,7 +103,7 @@ const mappingNavigationCarousel = (setting)=>{
107
103
  const newArrow = generateValueByDevices(arrow);
108
104
  const newControlOverContent = generateValueByDevices(controlOverContent);
109
105
  const navigationStyle = {};
110
- devices.map((el)=>{
106
+ devices.forEach((el)=>{
111
107
  if (!newArrow[el]) navigationStyle[el] = 'none';
112
108
  else if (newArrow[el] && newControlOverContent[el]) navigationStyle[el] = 'inside';
113
109
  else navigationStyle[el] = 'outside';
@@ -119,12 +115,18 @@ const mappingNavigationCarousel = (setting)=>{
119
115
  }
120
116
  return setting;
121
117
  };
118
+ const getData = (props)=>{
119
+ const isRenderCustomIcon = !!props.custom && props.custom !== '';
120
+ return {
121
+ isRenderCustomIcon
122
+ };
123
+ };
122
124
 
123
125
  exports.getArrowDisplayStyle = getArrowDisplayStyle;
124
- exports.getArrowRotate = getArrowRotate;
126
+ exports.getArrowPositionStyle = getArrowPositionStyle;
125
127
  exports.getClassArrowDisplay = getClassArrowDisplay;
126
- exports.getClassArrowPosition = getClassArrowPosition;
127
128
  exports.getClassArrowRotate = getClassArrowRotate;
129
+ exports.getData = getData;
128
130
  exports.getResponsiveSetting = getResponsiveSetting;
129
131
  exports.getUpdatedArrowDisplay = getUpdatedArrowDisplay;
130
132
  exports.mappingNavigationCarousel = mappingNavigationCarousel;
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var system = require('@gem-sdk/system');
4
+ var common = require('./common.js');
5
+
6
+ const getClass = (props)=>{
7
+ const { className, componentId, rootId, left, uid, isHiddenWhenDisabled, disabled, showWhenHover, showArrow, vertical } = props;
8
+ const idClass = 'gp-carousel-arrow-' + uid;
9
+ const arrowType = common.getResponsiveSetting(showArrow || {});
10
+ const classAction = left ? 'gp-carousel-action-back gem-slider-previous' : 'gp-carousel-action-next gem-slider-next';
11
+ const buttonClass = system.createClass({
12
+ ...{
13
+ 'gp-z-1 gp-items-center gp-justify-center gp-overflow-hidden gp-shrink-0': true
14
+ },
15
+ ...{
16
+ [idClass]: true
17
+ },
18
+ ...className && {
19
+ [className]: true
20
+ },
21
+ ...componentId && {
22
+ [componentId]: true
23
+ },
24
+ ...rootId && {
25
+ [rootId]: true
26
+ },
27
+ ...classAction && {
28
+ [classAction]: true
29
+ },
30
+ ...{
31
+ hidden: isHiddenWhenDisabled && disabled,
32
+ 'gp-cursor-default gp-text-gray-300': disabled,
33
+ 'gp-cursor-pointer gp-text-gray-500': !disabled,
34
+ '!gp-invisible group-hover/carousel:!gp-visible': showWhenHover,
35
+ ...common.getClassArrowDisplay(arrowType, vertical)
36
+ }
37
+ });
38
+ const buttonContentClass = system.createClass({
39
+ ...{
40
+ 'gp-flex gp-items-center gp-justify-center [&>svg]:gp-h-full [&>svg]:gp-w-full': true
41
+ },
42
+ ...common.getClassArrowRotate(Boolean(left), vertical)
43
+ });
44
+ return {
45
+ buttonClass,
46
+ buttonContentClass
47
+ };
48
+ };
49
+
50
+ exports.getClass = getClass;
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ var system = require('@gem-sdk/system');
4
+ var core = require('@gem-sdk/core');
5
+ var common = require('./common.js');
6
+
7
+ const getStyle = (props, type = 'liquid')=>{
8
+ const { uid, vertical, showArrow, gapToEachSize, left, arrowBackgroundColor, arrowButtonSize, rootId, arrowBorder, arrowCorner, arrowCustomColor, arrowIconSize, arrowShadow } = props;
9
+ const arrowShadowStyle = core.getResponsiveStyleShadowWithoutState(arrowShadow, 'box-shadow', arrowShadow);
10
+ const arrowBorderStyle = common.getResponsiveSetting(arrowBorder || {});
11
+ const arrowCornerStyle = common.getResponsiveSetting(arrowCorner || {});
12
+ const buttonPadding = core.getPaddingGlobalSize(arrowButtonSize);
13
+ const iconSizeResponsive = common.getResponsiveSetting(arrowIconSize || {});
14
+ const arrowType = common.getResponsiveSetting(showArrow || {});
15
+ const buttonWidth = core.makeGlobalSizeWidthResponsive(arrowButtonSize);
16
+ const buttonHeight = core.makeGlobalSizeHeightResponsive(arrowButtonSize);
17
+ const iconWidth = core.makeStyleResponsive('w', iconSizeResponsive, 'px');
18
+ const iconHeight = core.makeStyleResponsive('h', iconSizeResponsive, 'px');
19
+ const display = core.makeStyleResponsive('d', common.getArrowDisplayStyle(arrowType));
20
+ const position = core.makeStyle(common.getArrowPositionStyle({
21
+ vertical,
22
+ arrowType,
23
+ gapToEachSize: gapToEachSize ?? '',
24
+ left: Boolean(left)
25
+ }));
26
+ const buttonStyleObj = {
27
+ 'background-color': arrowBackgroundColor ?? '',
28
+ ...display,
29
+ ...position,
30
+ ...buttonWidth,
31
+ ...buttonHeight,
32
+ ...buttonPadding,
33
+ ...arrowShadowStyle
34
+ };
35
+ const buttonContentStyleObj = {
36
+ ...core.makeStyle({
37
+ c: arrowCustomColor
38
+ }),
39
+ ...iconWidth,
40
+ ...iconHeight
41
+ };
42
+ const buttonStyle = type === 'react' ? system.createStyleReact(buttonStyleObj) : system.createStyle(buttonStyleObj);
43
+ const buttonContentStyle = type === 'react' ? system.createStyleReact(buttonContentStyleObj) : system.createStyle(buttonContentStyleObj);
44
+ const innerBorderCss = `
45
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
46
+ ${core.composeCornerCss(arrowCornerStyle.desktop)}
47
+ }
48
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
49
+ content: '';
50
+ height: 100%;
51
+ width: 100%;
52
+ position: absolute;
53
+ pointer-events: none;
54
+ z-index: 10;
55
+ ${core.composeBorderCss(arrowBorderStyle.desktop)}
56
+ ${core.composeCornerCss(arrowCornerStyle.desktop)}
57
+ }
58
+ @media only screen and (max-width: 1024px) and (min-width: 768px) {
59
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
60
+ ${core.composeCornerCss(arrowCornerStyle.tablet)}
61
+ }
62
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
63
+ ${core.composeBorderCss(arrowBorderStyle.tablet)}
64
+ ${core.composeCornerCss(arrowCornerStyle.tablet)}
65
+ }
66
+ }
67
+ @media only screen and (max-width: 768px) {
68
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
69
+ ${core.composeCornerCss(arrowCornerStyle.mobile)}
70
+ }
71
+ ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
72
+ ${core.composeBorderCss(arrowBorderStyle.mobile)}
73
+ ${core.composeCornerCss(arrowCornerStyle.mobile)}
74
+ }
75
+ }
76
+ `;
77
+ return {
78
+ buttonStyle,
79
+ buttonContentStyle,
80
+ innerBorderCss
81
+ };
82
+ };
83
+
84
+ exports.getStyle = getStyle;
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var core = require('@gem-sdk/core');
8
+ var ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
9
+ var getStyle = require('./common/getStyle.js');
10
+ var getClass = require('./common/getClass.js');
11
+ var useCarouseItem = require('./hook/useCarouseItem.js');
12
+
13
+ const CarouselItem = (props)=>{
14
+ const { children, builderAttrs } = props;
15
+ const { handleClick } = useCarouseItem.useCarouselItem(props);
16
+ const { carouselItemStyle, carouselItemInnerStyle } = getStyle.getStyle(props);
17
+ const { carouselItemClass, carouselItemInnerClass } = getClass.getClass(props);
18
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
19
+ ...builderAttrs,
20
+ className: carouselItemClass,
21
+ style: carouselItemStyle,
22
+ onClick: handleClick,
23
+ "aria-hidden": true,
24
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
25
+ className: carouselItemInnerClass,
26
+ style: carouselItemInnerStyle,
27
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
28
+ })
29
+ });
30
+ };
31
+
32
+ exports.default = CarouselItem;
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@gem-sdk/core');
6
+ var getStyle = require('./common/getStyle.js');
7
+ var getClass = require('./common/getClass.js');
8
+
9
+ const CarouselItem = (props)=>{
10
+ const { builderAttrs, index, children } = props;
11
+ const { carouselItemStyle, carouselItemInnerStyle } = getStyle.getStyle(props);
12
+ const { carouselItemClass, carouselItemInnerClass } = getClass.getClass(props);
13
+ return core.template`
14
+ <div
15
+ ${{
16
+ ...builderAttrs
17
+ }}
18
+ class="${carouselItemClass}"
19
+ style="${carouselItemStyle}"
20
+ data-index="${index}"
21
+ grid-index="{{forloop.index}}"
22
+ external-id="{{media.external_id}}"
23
+ media-type="{{media.media_type}}"
24
+ media-poster="{{media.preview_image.src}}"
25
+ media-source-url="{{media.sources.first.url}}"
26
+ media-last-source-url="{{mediaSourceUrl}}"
27
+ >
28
+ <div
29
+ class="${carouselItemInnerClass}"
30
+ style="${carouselItemInnerStyle}"
31
+ >
32
+ ${children}
33
+ </div>
34
+ </div>
35
+ `;
36
+ };
37
+
38
+ exports.default = CarouselItem;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var system = require('@gem-sdk/system');
4
+
5
+ const getClass = (props)=>{
6
+ const { parentId, parentUid, builderProps, className } = props;
7
+ const carouselItemClass = system.createClass({
8
+ [`gem-slider-item gp-w-full`]: true,
9
+ [`gem-slider-item-${parentId || parentUid}`]: true,
10
+ ...parentUid && {
11
+ [`gp-child-item-${parentUid}`]: true
12
+ },
13
+ ...builderProps?.uid && {
14
+ [builderProps?.uid]: true
15
+ },
16
+ ...className && {
17
+ [className]: true
18
+ }
19
+ });
20
+ const carouselItemInnerClass = system.createClass({
21
+ 'gp-h-full gp-w-full': true
22
+ });
23
+ return {
24
+ carouselItemClass,
25
+ carouselItemInnerClass
26
+ };
27
+ };
28
+
29
+ exports.getClass = getClass;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var core = require('@gem-sdk/core');
6
- var carousel = require('./common/carousel.js');
4
+ var carousel = require('../../components/common/carousel.js');
5
+ var system = require('@gem-sdk/system');
7
6
 
8
- const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, style, className, parentId, parentStyle, parentSettings, background, index, customStyle, parentUid, contentType = 'normalItem', ...passProps })=>{
7
+ const getStyle = (props)=>{
8
+ const { style, contentType, parentStyle, parentSettings, background, customStyle, index } = props;
9
9
  const itemPadding = core.makeGlobalSize(parentStyle?.itemPadding);
10
10
  const styleByContentType = ()=>{
11
11
  const delList = [
@@ -31,32 +31,9 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
31
31
  })
32
32
  };
33
33
  };
34
- const itemShadowStyle = core.getStyleShadow({
35
- value: parentStyle?.carouselShadow,
36
- styleAppliedFor: 'box-shadow',
37
- isEnableShadow: parentStyle?.hasActiveShadow
38
- });
39
- return core.template`
40
- <div
41
- media-type="{{media.media_type}}"
42
- media-poster="{{media.preview_image.src}}"
43
- media-source-url="{{media.sources.first.url}}"
44
- media-last-source-url="{{mediaSourceUrl}}"
45
- external-id="{{media.external_id}}"
46
- grid-index="{{forloop.index}}"
47
- ${{
48
- ...builderAttrs
49
- }}
50
- ${{
51
- ...passProps
52
- }}
53
- style="${{
34
+ const getCarouselItemStyle = {
54
35
  ...customStyle,
55
- ...core.getStyleBackgroundByDevice(background, {
56
- ignoreBackgroundImage: true,
57
- ignoreBackgroundImageProperties: true,
58
- ignoreBgAttachment: true
59
- }),
36
+ ...itemPadding && itemPadding.padding,
60
37
  ...carousel.getInitialWidthForCarouselItem({
61
38
  spacing: parentStyle?.spacing,
62
39
  slidesToShow: parentSettings?.itemNumber ?? parentSettings?.slidesToShow,
@@ -66,7 +43,12 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
66
43
  sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward,
67
44
  vertical: parentSettings?.vertical
68
45
  }),
69
- ...styleByContentType(),
46
+ ...core.getStyleBackgroundByDevice(background),
47
+ ...core.getGradientBgrStyleByDevice(background, {
48
+ desktop: true,
49
+ tablet: true,
50
+ mobile: true
51
+ }),
70
52
  ...core.makeStyleResponsive('ml', carousel.getCarouselSneakPeakTranslate({
71
53
  index,
72
54
  spacing: parentStyle?.spacing,
@@ -75,22 +57,23 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
75
57
  sneakPeakType: parentSettings?.sneakPeakType,
76
58
  sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
77
59
  sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward
78
- })),
79
- ...itemPadding && itemPadding.padding
80
- }}"
81
- class="${core.cls(`gem-slider-item gp-w-full gem-slider-item-${parentId || ''} gp-child-item-${parentUid}`, builderProps?.uid, className)}"
82
- data-index="${index}"
83
- >
84
- <div
85
- class="gp-w-full"
86
- style="${{
87
- ...itemShadowStyle
88
- }}"
89
- >
90
- ${children}
91
- </div>
92
- </div>
93
- `;
60
+ }))
61
+ };
62
+ const carouselItemInnerStyle = system.createStyle({
63
+ ...core.getStyleShadow({
64
+ value: parentStyle?.carouselShadow,
65
+ styleAppliedFor: 'box-shadow',
66
+ isEnableShadow: parentStyle?.hasActiveShadow
67
+ })
68
+ });
69
+ const carouselItemStyle = system.createStyle({
70
+ ...getCarouselItemStyle,
71
+ ...styleByContentType()
72
+ });
73
+ return {
74
+ carouselItemStyle,
75
+ carouselItemInnerStyle
76
+ };
94
77
  };
95
78
 
96
- exports.default = CarouselItem;
79
+ exports.getStyle = getStyle;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const useCarouselItem = (props)=>{
4
+ const { onClickItem, dispatchEventSelectSlide, index = 0 } = props;
5
+ const handleClick = (e)=>{
6
+ onClickItem && onClickItem(e);
7
+ dispatchEventSelectSlide && dispatchEventSelectSlide(index);
8
+ };
9
+ return {
10
+ handleClick
11
+ };
12
+ };
13
+
14
+ exports.useCarouselItem = useCarouselItem;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const DOT_CONTAINER_SELECTOR = 'gp-carousel-dot-container';
4
+
5
+ exports.DOT_CONTAINER_SELECTOR = DOT_CONTAINER_SELECTOR;
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var core = require('@gem-sdk/core');
8
+ var common = require('./common/common.js');
9
+ var getClass = require('./common/getClass.js');
10
+ var getStyle = require('./common/getStyle.js');
11
+ var useDotsSetting = require('./hook/useDotsSetting.js');
12
+ var system = require('@gem-sdk/system');
13
+
14
+ const Dots = (props)=>{
15
+ const { onHandleClick, dotSize, dotActiveColor, dotColor } = props;
16
+ const { isLoop, checkIsActive } = useDotsSetting.useDotsSetting(props);
17
+ const { checkHidden, getDotItems } = common.getData(props);
18
+ const dotItems = getDotItems(isLoop);
19
+ const { dotClass } = getClass.getDotClass(props);
20
+ const { dotStyle } = getStyle.getDotStyle(props, 'react');
21
+ const renderDotItems = ()=>{
22
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
23
+ children: dotItems?.map((idx)=>{
24
+ const isActive = checkIsActive(idx);
25
+ return /*#__PURE__*/ jsxRuntime.jsx("button", {
26
+ "aria-label": "Dot",
27
+ onClick: ()=>{
28
+ onHandleClick && onHandleClick(idx, isLoop);
29
+ },
30
+ style: {
31
+ ...core.makeStyleResponsiveByScreen('w', dotSize, 'px'),
32
+ ...isActive ? core.getGlobalColorResponsiveStyle('bg', dotActiveColor) : core.getGlobalColorResponsiveStyle('bg', dotColor)
33
+ },
34
+ className: core.cls('gp-aspect-square gp-w-3 gp-rounded-full gp-shadow-md', {
35
+ 'gem-slider-dot-active': isActive,
36
+ 'gem-slider-dot-inactive': !isActive
37
+ })
38
+ }, idx);
39
+ })
40
+ });
41
+ };
42
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
43
+ children: system.If(!checkHidden(dotItems), /*#__PURE__*/ jsxRuntime.jsx("div", {
44
+ className: dotClass,
45
+ style: dotStyle,
46
+ children: renderDotItems()
47
+ }))
48
+ });
49
+ };
50
+
51
+ exports.default = Dots;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@gem-sdk/core');
6
+ var getClass = require('./common/getClass.js');
7
+ var getStyle = require('./common/getStyle.js');
8
+ var system = require('@gem-sdk/system');
9
+ var common = require('./common/common.js');
10
+
11
+ const Dots = (props)=>{
12
+ const isLoop = core.getResponsiveValueByScreen(props.loop, 'desktop', false);
13
+ const { checkHidden, getDotItems } = common.getData(props);
14
+ const dotItems = getDotItems(isLoop);
15
+ const { dotClass } = getClass.getDotClass(props);
16
+ const { dotStyle } = getStyle.getDotStyle(props);
17
+ return core.template`
18
+ ${system.If(!checkHidden(dotItems), core.template`
19
+ <div class="${dotClass}" style="${dotStyle}">
20
+ <!-- item render by js -->
21
+ </div>
22
+ `)}
23
+ `;
24
+ };
25
+
26
+ exports.default = Dots;