@gem-sdk/components 2.0.0-dev.370 → 2.0.0-dev.372
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/article/setting/configs/ArticleDate/presets.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleDate/settings.js +3 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +20 -1
- package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +10 -10
- package/dist/cjs/builder.js +2 -2
- package/dist/cjs/button/setting/configs/settings.js +0 -14
- package/dist/cjs/carousel/arrow/Arrow.js +52 -0
- package/dist/cjs/carousel/arrow/Arrow.liquid.js +46 -0
- package/dist/cjs/carousel/{components/common/arrow.js → arrow/common/common.js} +13 -11
- package/dist/cjs/carousel/arrow/common/getClass.js +50 -0
- package/dist/cjs/carousel/arrow/common/getStyle.js +84 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.js +32 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.liquid.js +38 -0
- package/dist/cjs/carousel/carousel-item/common/getClass.js +29 -0
- package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +30 -47
- package/dist/cjs/carousel/carousel-item/hook/useCarouseItem.js +14 -0
- package/dist/cjs/carousel/components/const/index.js +5 -0
- package/dist/cjs/carousel/dots/Dots.js +51 -0
- package/dist/cjs/carousel/dots/Dots.liquid.js +26 -0
- package/dist/cjs/carousel/dots/common/common.js +46 -0
- package/dist/cjs/carousel/dots/common/getClass.js +40 -0
- package/dist/cjs/carousel/dots/common/getStyle.js +33 -0
- package/dist/cjs/carousel/dots/hook/useDotsSetting.js +21 -0
- package/dist/cjs/carousel/index.js +1 -2
- package/dist/cjs/carousel/next.js +2 -2
- package/dist/cjs/carousel/root/Carousel.js +129 -0
- package/dist/cjs/carousel/root/Carousel.liquid.js +104 -0
- package/dist/cjs/carousel/root/common/getAttr.js +25 -0
- package/dist/cjs/carousel/root/common/getClass.js +135 -0
- package/dist/cjs/carousel/root/common/getData.js +56 -0
- package/dist/cjs/carousel/root/common/getStyle.js +64 -0
- package/dist/cjs/carousel/{components/Carousel.js → root/hook/useCarousel.js} +153 -321
- package/dist/cjs/carousel/setting/Carousel.js +8 -1555
- package/dist/cjs/carousel/setting/configs/presets.js +380 -0
- package/dist/cjs/carousel/setting/configs/settingV2.js +771 -0
- package/dist/cjs/carousel/setting/configs/uiV1.js +434 -0
- package/dist/cjs/carousel/setting/configs/uiV2.js +627 -0
- package/dist/cjs/common/components/NoDataState.js +5 -5
- package/dist/cjs/grid/row/commons/common.js +3 -3
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/cjs/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/cjs/product/components/ProductList/common/index.js +5 -5
- package/dist/cjs/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/cjs/text/components/Text.js +3 -3
- package/dist/esm/article/setting/configs/ArticleDate/presets.js +1 -1
- package/dist/esm/article/setting/configs/ArticleDate/settings.js +3 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +20 -1
- package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +10 -10
- package/dist/esm/builder.js +2 -2
- package/dist/esm/button/setting/configs/settings.js +0 -14
- package/dist/esm/carousel/arrow/Arrow.js +48 -0
- package/dist/esm/carousel/arrow/Arrow.liquid.js +42 -0
- package/dist/esm/carousel/{components/common/arrow.js → arrow/common/common.js} +12 -10
- package/dist/esm/carousel/arrow/common/getClass.js +48 -0
- package/dist/esm/carousel/arrow/common/getStyle.js +82 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.js +28 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.liquid.js +34 -0
- package/dist/esm/carousel/carousel-item/common/getClass.js +27 -0
- package/dist/esm/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +31 -46
- package/dist/esm/carousel/carousel-item/hook/useCarouseItem.js +12 -0
- package/dist/esm/carousel/components/const/index.js +3 -0
- package/dist/esm/carousel/dots/Dots.js +47 -0
- package/dist/esm/carousel/dots/Dots.liquid.js +22 -0
- package/dist/esm/carousel/dots/common/common.js +43 -0
- package/dist/esm/carousel/dots/common/getClass.js +38 -0
- package/dist/esm/carousel/dots/common/getStyle.js +31 -0
- package/dist/esm/carousel/dots/hook/useDotsSetting.js +19 -0
- package/dist/esm/carousel/index.js +1 -2
- package/dist/esm/carousel/next.js +2 -2
- package/dist/esm/carousel/root/Carousel.js +125 -0
- package/dist/esm/carousel/root/Carousel.liquid.js +100 -0
- package/dist/esm/carousel/root/common/getAttr.js +23 -0
- package/dist/esm/carousel/root/common/getClass.js +133 -0
- package/dist/esm/carousel/root/common/getData.js +54 -0
- package/dist/esm/carousel/root/common/getStyle.js +62 -0
- package/dist/esm/carousel/{components/Carousel.js → root/hook/useCarousel.js} +150 -316
- package/dist/esm/carousel/setting/Carousel.js +8 -1555
- package/dist/esm/carousel/setting/configs/presets.js +378 -0
- package/dist/esm/carousel/setting/configs/settingV2.js +769 -0
- package/dist/esm/carousel/setting/configs/uiV1.js +432 -0
- package/dist/esm/carousel/setting/configs/uiV2.js +625 -0
- package/dist/esm/common/components/NoDataState.js +6 -6
- package/dist/esm/grid/row/commons/common.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.liquid.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/esm/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/esm/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/esm/product/components/ProductList/common/index.js +3 -3
- package/dist/esm/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/esm/text/components/Text.js +4 -4
- package/dist/types/index.d.ts +164 -67
- package/package.json +3 -3
- package/dist/cjs/carousel/components/Arrow.js +0 -110
- package/dist/cjs/carousel/components/Arrow.liquid.js +0 -103
- package/dist/cjs/carousel/components/Carousel.liquid.js +0 -256
- package/dist/cjs/carousel/components/CarouselItem.js +0 -88
- package/dist/cjs/carousel/components/Dots.js +0 -69
- package/dist/cjs/carousel/components/Dots.liquid.js +0 -23
- package/dist/cjs/carousel/components/common/dots.js +0 -57
- package/dist/esm/carousel/components/Arrow.js +0 -106
- package/dist/esm/carousel/components/Arrow.liquid.js +0 -99
- package/dist/esm/carousel/components/Carousel.liquid.js +0 -252
- package/dist/esm/carousel/components/CarouselItem.js +0 -84
- package/dist/esm/carousel/components/Dots.js +0 -65
- package/dist/esm/carousel/components/Dots.liquid.js +0 -19
- package/dist/esm/carousel/components/common/dots.js +0 -53
|
@@ -336,6 +336,21 @@ const ArticleReadMoreSettings = [
|
|
|
336
336
|
hover: 'text-3'
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
|
+
{
|
|
340
|
+
id: 'textColorHover',
|
|
341
|
+
type: 'color-picker-v2',
|
|
342
|
+
devices: {
|
|
343
|
+
desktop: {
|
|
344
|
+
default: {}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
compoDefaultValue: {
|
|
348
|
+
desktop: {
|
|
349
|
+
default: {}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
enableGradient: true
|
|
353
|
+
},
|
|
339
354
|
{
|
|
340
355
|
id: 'roundedBtn',
|
|
341
356
|
type: 'radius-preset',
|
|
@@ -693,7 +708,11 @@ const ArticleReadMoreSettings = [
|
|
|
693
708
|
desktop: '120%',
|
|
694
709
|
tablet: '120%',
|
|
695
710
|
mobile: '120%'
|
|
696
|
-
}
|
|
711
|
+
},
|
|
712
|
+
hasShadowText: false
|
|
713
|
+
},
|
|
714
|
+
attrs: {
|
|
715
|
+
color: '#ffffff'
|
|
697
716
|
}
|
|
698
717
|
},
|
|
699
718
|
ignoreReRender: true,
|
|
@@ -189,15 +189,6 @@ const uiV2 = [
|
|
|
189
189
|
noRecordHistory: true
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
label: {
|
|
195
|
-
en: 'Content'
|
|
196
|
-
},
|
|
197
|
-
conditionDisplay: `readMoreType === 'text'`,
|
|
198
|
-
setting: {
|
|
199
|
-
id: 'label'
|
|
200
|
-
}
|
|
201
192
|
}
|
|
202
193
|
]
|
|
203
194
|
},
|
|
@@ -594,6 +585,15 @@ const uiV2 = [
|
|
|
594
585
|
},
|
|
595
586
|
conditionDisplay: `readMoreType == 'text'`,
|
|
596
587
|
controls: [
|
|
588
|
+
{
|
|
589
|
+
label: {
|
|
590
|
+
en: 'Content'
|
|
591
|
+
},
|
|
592
|
+
conditionDisplay: `readMoreType === 'text'`,
|
|
593
|
+
setting: {
|
|
594
|
+
id: 'label'
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
597
|
{
|
|
598
598
|
id: 'typo',
|
|
599
599
|
label: {
|
|
@@ -651,7 +651,7 @@ const uiV2 = [
|
|
|
651
651
|
en: 'Text color'
|
|
652
652
|
},
|
|
653
653
|
setting: {
|
|
654
|
-
id: '
|
|
654
|
+
id: 'textColorHover',
|
|
655
655
|
state: 'hover'
|
|
656
656
|
}
|
|
657
657
|
},
|
package/dist/cjs/builder.js
CHANGED
|
@@ -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/
|
|
24
|
-
var CarouselItem = require('./carousel/
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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;
|
package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js}
RENAMED
|
@@ -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('
|
|
4
|
+
var carousel = require('../../components/common/carousel.js');
|
|
5
|
+
var system = require('@gem-sdk/system');
|
|
7
6
|
|
|
8
|
-
const
|
|
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
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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.
|
|
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;
|