@gem-sdk/components 2.0.0-dev.336 → 2.0.0-dev.337
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/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +51 -55
- package/dist/cjs/product/setting/product-image-v2/configs/uiV2.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +52 -56
- package/dist/esm/product/setting/product-image-v2/configs/uiV2.js +1 -1
- package/package.json +1 -1
package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js
CHANGED
|
@@ -26,61 +26,57 @@ const ProductGalleryCarousel = (props)=>{
|
|
|
26
26
|
const { galleryCarouselSettingAttrs } = getProductImagesAttr.getProductImagesAttr(setting);
|
|
27
27
|
const { galleryCarouselStyle, galleryCarouselItemStyle } = getProductImagesStyles.getProductImagesStyles(setting);
|
|
28
28
|
const { moveToIdx, isDisplay, shapeByLayout, isEnableBorderActive, isShowButtonLightbox, filteredProductImages, handleClickCarouselItem } = useGalleryCarousel.useGalleryCarousel(props);
|
|
29
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
30
|
-
children:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
81
|
-
}),
|
|
82
|
-
")"
|
|
83
|
-
]
|
|
29
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
30
|
+
children: isDisplay && /*#__PURE__*/ jsxRuntime.jsx(Carousel.default, {
|
|
31
|
+
parentClass: builderPropsClass,
|
|
32
|
+
rootClass: builderPropsClass,
|
|
33
|
+
setting: galleryCarouselSettingAttrs,
|
|
34
|
+
styles: galleryCarouselStyle,
|
|
35
|
+
slidesClass: productGallery.getEditorMinHeightClass(currentDevice, setting.position, setting.navigationPosition),
|
|
36
|
+
builderProps: {
|
|
37
|
+
uid: `${builderPropUID}-carousel`
|
|
38
|
+
},
|
|
39
|
+
moveToIdx: moveToIdx,
|
|
40
|
+
isHiddenArrowWhenDisabled: true,
|
|
41
|
+
disableMarginAuto: true,
|
|
42
|
+
children: filteredProductImages?.map((image, index)=>{
|
|
43
|
+
const canActive = index === moveToIdx;
|
|
44
|
+
const imageSrc = productFeaturedImage.isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
45
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(CarouselItem.default, {
|
|
46
|
+
contentType: "productImage",
|
|
47
|
+
className: galleryItemClasses(`gp-gallery-image-item gem-slider-item-${builderPropUID} ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
|
|
48
|
+
onClickItem: ()=>handleClickCarouselItem(image?.id),
|
|
49
|
+
style: galleryCarouselItemStyle,
|
|
50
|
+
"data-id": image?.id,
|
|
51
|
+
"data-border": canActive && !!setting?.borderActive && setting?.activeEffectEnable ? 'active' : 'deactive',
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
54
|
+
draggable: "false",
|
|
55
|
+
src: imageSrc,
|
|
56
|
+
width: image?.width,
|
|
57
|
+
height: image?.height,
|
|
58
|
+
alt: image?.alt,
|
|
59
|
+
setting: {
|
|
60
|
+
aspectRatio: common.getAspectRatio(shapeByLayout),
|
|
61
|
+
layout: setting?.layout,
|
|
62
|
+
qualityPercent: setting?.qualityPercent,
|
|
63
|
+
qualityType: setting?.qualityType
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
width: '100%',
|
|
67
|
+
height: '100%',
|
|
68
|
+
cursor: 'pointer'
|
|
69
|
+
},
|
|
70
|
+
className: "product-list-image"
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
|
|
73
|
+
contentType: image?.contentType || ''
|
|
74
|
+
}),
|
|
75
|
+
system.If(isShowButtonLightbox, /*#__PURE__*/ jsxRuntime.jsx(ButtonOpenLightBox.default, {}))
|
|
76
|
+
]
|
|
77
|
+
}, image?.id);
|
|
78
|
+
})
|
|
79
|
+
})
|
|
84
80
|
});
|
|
85
81
|
};
|
|
86
82
|
|
package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useCurrentDevice } from '@gem-sdk/core';
|
|
3
3
|
import { getAspectRatio } from '../../common/common.js';
|
|
4
4
|
import { getEditorMinHeightClass } from '../../common/productGallery.js';
|
|
@@ -22,61 +22,57 @@ const ProductGalleryCarousel = (props)=>{
|
|
|
22
22
|
const { galleryCarouselSettingAttrs } = getProductImagesAttr(setting);
|
|
23
23
|
const { galleryCarouselStyle, galleryCarouselItemStyle } = getProductImagesStyles(setting);
|
|
24
24
|
const { moveToIdx, isDisplay, shapeByLayout, isEnableBorderActive, isShowButtonLightbox, filteredProductImages, handleClickCarouselItem } = useGalleryCarousel(props);
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
-
children:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})
|
|
77
|
-
}),
|
|
78
|
-
")"
|
|
79
|
-
]
|
|
25
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
26
|
+
children: isDisplay && /*#__PURE__*/ jsx(Carousel, {
|
|
27
|
+
parentClass: builderPropsClass,
|
|
28
|
+
rootClass: builderPropsClass,
|
|
29
|
+
setting: galleryCarouselSettingAttrs,
|
|
30
|
+
styles: galleryCarouselStyle,
|
|
31
|
+
slidesClass: getEditorMinHeightClass(currentDevice, setting.position, setting.navigationPosition),
|
|
32
|
+
builderProps: {
|
|
33
|
+
uid: `${builderPropUID}-carousel`
|
|
34
|
+
},
|
|
35
|
+
moveToIdx: moveToIdx,
|
|
36
|
+
isHiddenArrowWhenDisabled: true,
|
|
37
|
+
disableMarginAuto: true,
|
|
38
|
+
children: filteredProductImages?.map((image, index)=>{
|
|
39
|
+
const canActive = index === moveToIdx;
|
|
40
|
+
const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
41
|
+
return /*#__PURE__*/ jsxs(CarouselItem, {
|
|
42
|
+
contentType: "productImage",
|
|
43
|
+
className: galleryItemClasses(`gp-gallery-image-item gem-slider-item-${builderPropUID} ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
|
|
44
|
+
onClickItem: ()=>handleClickCarouselItem(image?.id),
|
|
45
|
+
style: galleryCarouselItemStyle,
|
|
46
|
+
"data-id": image?.id,
|
|
47
|
+
"data-border": canActive && !!setting?.borderActive && setting?.activeEffectEnable ? 'active' : 'deactive',
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ jsx(NextImage, {
|
|
50
|
+
draggable: "false",
|
|
51
|
+
src: imageSrc,
|
|
52
|
+
width: image?.width,
|
|
53
|
+
height: image?.height,
|
|
54
|
+
alt: image?.alt,
|
|
55
|
+
setting: {
|
|
56
|
+
aspectRatio: getAspectRatio(shapeByLayout),
|
|
57
|
+
layout: setting?.layout,
|
|
58
|
+
qualityPercent: setting?.qualityPercent,
|
|
59
|
+
qualityType: setting?.qualityType
|
|
60
|
+
},
|
|
61
|
+
style: {
|
|
62
|
+
width: '100%',
|
|
63
|
+
height: '100%',
|
|
64
|
+
cursor: 'pointer'
|
|
65
|
+
},
|
|
66
|
+
className: "product-list-image"
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ jsx(MediaIcon, {
|
|
69
|
+
contentType: image?.contentType || ''
|
|
70
|
+
}),
|
|
71
|
+
If(isShowButtonLightbox, /*#__PURE__*/ jsx(ButtonOpenLightBox, {}))
|
|
72
|
+
]
|
|
73
|
+
}, image?.id);
|
|
74
|
+
})
|
|
75
|
+
})
|
|
80
76
|
});
|
|
81
77
|
};
|
|
82
78
|
|