@gem-sdk/components 2.0.0-dev.621 → 2.0.0-dev.623
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/ArticleAuthor/uiV2.js +1 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +0 -1
- package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +1 -0
- package/dist/cjs/banner/setting/presets/heroBanner1Col.js +1 -1
- package/dist/cjs/banner/setting/presets/heroBannerContentLeft.js +2 -4
- package/dist/cjs/banner/setting/presets/heroBannerContentRight.js +2 -5
- package/dist/cjs/banner/setting/presets/heroBannerVideo.js +10 -0
- package/dist/cjs/banner/setting/setting.js +9 -6
- package/dist/cjs/banner/setting/uiV2.js +34 -10
- package/dist/cjs/builder.js +12 -6
- package/dist/cjs/collection/components/collection-banner/components/CollectionBanner.liquid.js +1 -1
- package/dist/cjs/collection/components/collection-paginator/common/index.js +1 -2
- package/dist/cjs/collection/components/collection-paginator/common/styles.js +2 -2
- package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +3 -3
- package/dist/cjs/collection/setting/collection-banner/configs/uiV2.js +2 -2
- package/dist/cjs/collection/setting/collection-paginator/configs/settings.js +8 -5
- package/dist/cjs/collection/setting/collection-paginator/configs/uiV2.js +28 -3
- package/dist/cjs/index.js +34 -32
- package/dist/cjs/index.liquid.js +16 -10
- package/dist/cjs/next.js +3 -1
- package/dist/cjs/product/components/ProductImagesV3/common/common.js +360 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +192 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +26 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +94 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +303 -0
- package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +95 -0
- package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +59 -0
- package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +266 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +63 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +36 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +109 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +139 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +100 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +77 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +300 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +44 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +83 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +182 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +30 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +239 -0
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +28 -0
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +144 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +14 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +54 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +53 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +55 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +41 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +134 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +203 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +87 -0
- package/dist/cjs/product/components/ProductImagesV3/index.js +291 -0
- package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +153 -0
- package/dist/cjs/product/index.js +6 -4
- package/dist/cjs/product/next.js +4 -0
- package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +252 -0
- package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +251 -0
- package/dist/cjs/product/setting/product-image-v3/ProductImages.js +74 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +388 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +518 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +336 -0
- package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +118 -0
- package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +119 -0
- package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +237 -0
- package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +491 -0
- package/dist/cjs/setting.js +97 -95
- package/dist/cjs/swiper-carousel/arrow/Arrow.js +52 -0
- package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +46 -0
- package/dist/cjs/swiper-carousel/arrow/common/common.js +119 -0
- package/dist/cjs/swiper-carousel/arrow/common/getClass.js +50 -0
- package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +84 -0
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +34 -0
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +38 -0
- package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +29 -0
- package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +79 -0
- package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +22 -0
- package/dist/cjs/swiper-carousel/components/common/carousel.js +98 -0
- package/dist/cjs/swiper-carousel/components/const/index.js +5 -0
- package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +34 -0
- package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +42 -0
- package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +105 -0
- package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +15 -0
- package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +45 -0
- package/dist/cjs/swiper-carousel/dots/Dots.js +51 -0
- package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +26 -0
- package/dist/cjs/swiper-carousel/dots/common/common.js +28 -0
- package/dist/cjs/swiper-carousel/dots/common/getClass.js +40 -0
- package/dist/cjs/swiper-carousel/dots/common/getStyle.js +33 -0
- package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +21 -0
- package/dist/cjs/swiper-carousel/index.js +17 -0
- package/dist/cjs/swiper-carousel/next.js +22 -0
- package/dist/cjs/swiper-carousel/root/Swiper.js +128 -0
- package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +104 -0
- package/dist/cjs/swiper-carousel/root/common/getAttr.js +25 -0
- package/dist/cjs/swiper-carousel/root/common/getClass.js +135 -0
- package/dist/cjs/swiper-carousel/root/common/getData.js +56 -0
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +64 -0
- package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +482 -0
- package/dist/cjs/swiper-carousel/setting/Swiper.js +42 -0
- package/dist/cjs/swiper-carousel/setting/SwiperItem.js +40 -0
- package/dist/cjs/swiper-carousel/setting/configs/presets.js +87 -0
- package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +819 -0
- package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +718 -0
- package/dist/esm/article/setting/configs/ArticleAuthor/uiV2.js +1 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +0 -1
- package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +1 -0
- package/dist/esm/banner/setting/presets/heroBanner1Col.js +1 -1
- package/dist/esm/banner/setting/presets/heroBannerContentLeft.js +2 -4
- package/dist/esm/banner/setting/presets/heroBannerContentRight.js +2 -5
- package/dist/esm/banner/setting/presets/heroBannerVideo.js +10 -0
- package/dist/esm/banner/setting/setting.js +9 -6
- package/dist/esm/banner/setting/uiV2.js +34 -10
- package/dist/esm/builder.js +6 -0
- package/dist/esm/collection/components/collection-banner/components/CollectionBanner.liquid.js +1 -1
- package/dist/esm/collection/components/collection-paginator/common/index.js +1 -2
- package/dist/esm/collection/components/collection-paginator/common/styles.js +2 -2
- package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +3 -3
- package/dist/esm/collection/setting/collection-banner/configs/uiV2.js +2 -2
- package/dist/esm/collection/setting/collection-paginator/configs/settings.js +8 -5
- package/dist/esm/collection/setting/collection-paginator/configs/uiV2.js +28 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.liquid.js +3 -0
- package/dist/esm/next.js +3 -1
- package/dist/esm/product/components/ProductImagesV3/common/common.js +344 -0
- package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +189 -0
- package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +24 -0
- package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +83 -0
- package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +292 -0
- package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +92 -0
- package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +53 -0
- package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +251 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +59 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +32 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +105 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +135 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +96 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +73 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +296 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +40 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +79 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +178 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +26 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +235 -0
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +24 -0
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +140 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +12 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +52 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +51 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +53 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +39 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +132 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +201 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +85 -0
- package/dist/esm/product/components/ProductImagesV3/index.js +287 -0
- package/dist/esm/product/components/ProductImagesV3/index.liquid.js +149 -0
- package/dist/esm/product/index.js +26 -24
- package/dist/esm/product/next.js +4 -0
- package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +248 -0
- package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +248 -0
- package/dist/esm/product/setting/product-image-v3/ProductImages.js +70 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +384 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +515 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +334 -0
- package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +116 -0
- package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +117 -0
- package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +235 -0
- package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +489 -0
- package/dist/esm/setting.js +2 -0
- package/dist/esm/swiper-carousel/arrow/Arrow.js +48 -0
- package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +42 -0
- package/dist/esm/swiper-carousel/arrow/common/common.js +111 -0
- package/dist/esm/swiper-carousel/arrow/common/getClass.js +48 -0
- package/dist/esm/swiper-carousel/arrow/common/getStyle.js +82 -0
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +30 -0
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +34 -0
- package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +27 -0
- package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +77 -0
- package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +20 -0
- package/dist/esm/swiper-carousel/components/common/carousel.js +93 -0
- package/dist/esm/swiper-carousel/components/const/index.js +3 -0
- package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +30 -0
- package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +35 -0
- package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +103 -0
- package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +13 -0
- package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +43 -0
- package/dist/esm/swiper-carousel/dots/Dots.js +47 -0
- package/dist/esm/swiper-carousel/dots/Dots.liquid.js +22 -0
- package/dist/esm/swiper-carousel/dots/common/common.js +26 -0
- package/dist/esm/swiper-carousel/dots/common/getClass.js +38 -0
- package/dist/esm/swiper-carousel/dots/common/getStyle.js +31 -0
- package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +19 -0
- package/dist/esm/swiper-carousel/index.js +15 -0
- package/dist/esm/swiper-carousel/next.js +18 -0
- package/dist/esm/swiper-carousel/root/Swiper.js +124 -0
- package/dist/esm/swiper-carousel/root/Swiper.liquid.js +100 -0
- package/dist/esm/swiper-carousel/root/common/getAttr.js +23 -0
- package/dist/esm/swiper-carousel/root/common/getClass.js +133 -0
- package/dist/esm/swiper-carousel/root/common/getData.js +54 -0
- package/dist/esm/swiper-carousel/root/common/getStyle.js +62 -0
- package/dist/esm/swiper-carousel/root/hook/useCarousel.js +480 -0
- package/dist/esm/swiper-carousel/setting/Swiper.js +38 -0
- package/dist/esm/swiper-carousel/setting/SwiperItem.js +36 -0
- package/dist/esm/swiper-carousel/setting/configs/presets.js +85 -0
- package/dist/esm/swiper-carousel/setting/configs/settingV2.js +815 -0
- package/dist/esm/swiper-carousel/setting/configs/uiV2.js +713 -0
- package/dist/types/index.d.ts +552 -117
- package/package.json +3 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
+
import { createClass } from '@gem-sdk/system';
|
|
3
|
+
import { getData } from './getData.js';
|
|
4
|
+
|
|
5
|
+
const getClass = (props)=>{
|
|
6
|
+
const DEVICES = [
|
|
7
|
+
'mobile',
|
|
8
|
+
'tablet',
|
|
9
|
+
'desktop'
|
|
10
|
+
];
|
|
11
|
+
const { setting, builderProps, wrapperClass, rootClass, advanced, fullHeight, slidesClass } = props;
|
|
12
|
+
const { sliderSelector } = getData(props);
|
|
13
|
+
const getDisplayOfWrapper = ()=>{
|
|
14
|
+
let result = {};
|
|
15
|
+
DEVICES.forEach((device)=>{
|
|
16
|
+
const devicePrefix = device === 'desktop' ? '' : `${device}:`;
|
|
17
|
+
result = {
|
|
18
|
+
...result,
|
|
19
|
+
[`${devicePrefix}gp-flex`]: setting?.vertical?.[device],
|
|
20
|
+
[`${devicePrefix}gp-block`]: !setting?.vertical?.[device]
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
const getWrapperInnerHeight = ()=>{
|
|
26
|
+
let result = {};
|
|
27
|
+
DEVICES.forEach((device)=>{
|
|
28
|
+
const devicePrefix = device === 'desktop' ? '' : `${device}:`;
|
|
29
|
+
result = {
|
|
30
|
+
...result,
|
|
31
|
+
[`${devicePrefix}gp-h-full`]: setting?.vertical?.[device],
|
|
32
|
+
[`${devicePrefix}gp-flex-1`]: setting?.vertical?.[device]
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
const makeFlexColClass = ()=>{
|
|
38
|
+
let result = {};
|
|
39
|
+
DEVICES.forEach((device)=>{
|
|
40
|
+
const devicePrefix = device === 'desktop' ? '' : `${device}:`;
|
|
41
|
+
result = {
|
|
42
|
+
...result,
|
|
43
|
+
[`${devicePrefix}!gp-flex-col`]: setting?.vertical?.[device],
|
|
44
|
+
[`${devicePrefix}!gp-flex-row`]: !setting?.vertical?.[device]
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
const makeVerticalWrapClass = ()=>{
|
|
50
|
+
let result = {};
|
|
51
|
+
DEVICES.forEach((device)=>{
|
|
52
|
+
const devicePrefix = device === 'desktop' ? '' : `${device}:`;
|
|
53
|
+
if (setting?.vertical?.[device]) {
|
|
54
|
+
result = {
|
|
55
|
+
...result,
|
|
56
|
+
[`${devicePrefix}!gp-flex-wrap`]: setting?.vertical?.[device]
|
|
57
|
+
};
|
|
58
|
+
} else {
|
|
59
|
+
result = {
|
|
60
|
+
...result,
|
|
61
|
+
[`${devicePrefix}!gp-flex-nowrap`]: !setting?.vertical?.[device]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
const makeVerticalMinHeightClass = ()=>{
|
|
68
|
+
let result = {};
|
|
69
|
+
DEVICES.forEach((device)=>{
|
|
70
|
+
const devicePrefix = device === 'desktop' ? '' : `${device}:`;
|
|
71
|
+
if (setting?.vertical?.[device]) {
|
|
72
|
+
result = {
|
|
73
|
+
...result,
|
|
74
|
+
[`${devicePrefix}!gp-min-h-0`]: setting?.vertical?.[device]
|
|
75
|
+
};
|
|
76
|
+
} else {
|
|
77
|
+
result = {
|
|
78
|
+
...result,
|
|
79
|
+
[`${devicePrefix}!gp-min-h-full`]: !setting?.vertical?.[device]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return result;
|
|
84
|
+
};
|
|
85
|
+
const wrapperClassRender = createClass({
|
|
86
|
+
...builderProps?.uid && {
|
|
87
|
+
[builderProps.uid]: true
|
|
88
|
+
},
|
|
89
|
+
...wrapperClass && {
|
|
90
|
+
[wrapperClass]: true
|
|
91
|
+
},
|
|
92
|
+
'gp-relative gp-my-0 tablet:gp-px-0 gp-max-w-full mobile:gp-px-0 gp-carousel-wrapper': true,
|
|
93
|
+
'!gp-flex': getResponsiveValueByScreen(setting?.vertical, 'desktop'),
|
|
94
|
+
'tablet:!gp-flex': getResponsiveValueByScreen(setting?.vertical, 'tablet'),
|
|
95
|
+
'mobile:!gp-flex': getResponsiveValueByScreen(setting?.vertical, 'mobile'),
|
|
96
|
+
...getDisplayOfWrapper()
|
|
97
|
+
});
|
|
98
|
+
const wrapperInnerClass = createClass({
|
|
99
|
+
'gp-relative gp-overflow-hidden gp-flex gp-items-center gp-justify-between': true,
|
|
100
|
+
'!gp-h-full': fullHeight,
|
|
101
|
+
...getWrapperInnerHeight(),
|
|
102
|
+
...makeFlexColClass()
|
|
103
|
+
});
|
|
104
|
+
const rootClassRender = createClass({
|
|
105
|
+
'gp-group/carousel gp-w-full gp-flex': true,
|
|
106
|
+
'!gp-flex-col': getResponsiveValueByScreen(setting?.vertical, 'desktop'),
|
|
107
|
+
'tablet:!flex-col': getResponsiveValueByScreen(setting?.vertical, 'tablet'),
|
|
108
|
+
'mobile:!flex-col': getResponsiveValueByScreen(setting?.vertical, 'mobile'),
|
|
109
|
+
...rootClass && {
|
|
110
|
+
[rootClass]: true
|
|
111
|
+
},
|
|
112
|
+
...advanced?.cssClass && {
|
|
113
|
+
[advanced.cssClass]: true
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const sliderClass = createClass({
|
|
117
|
+
'gp-swiper-wrapper gp-flex gp-h-full gp-select-none': true,
|
|
118
|
+
[sliderSelector]: true,
|
|
119
|
+
...slidesClass && {
|
|
120
|
+
[slidesClass]: true
|
|
121
|
+
},
|
|
122
|
+
...makeVerticalWrapClass(),
|
|
123
|
+
...makeVerticalMinHeightClass()
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
rootClassRender,
|
|
127
|
+
wrapperClassRender,
|
|
128
|
+
wrapperInnerClass,
|
|
129
|
+
sliderClass
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { getClass };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
+
import { createStateOrContext } from '@gem-sdk/system';
|
|
3
|
+
|
|
4
|
+
const getData = (props)=>{
|
|
5
|
+
const DEVICES = [
|
|
6
|
+
'mobile',
|
|
7
|
+
'tablet',
|
|
8
|
+
'desktop'
|
|
9
|
+
];
|
|
10
|
+
const { setting, rootId, builderProps, styles, moveToIdx, isHiddenArrowWhenDisabled } = props;
|
|
11
|
+
const uniqueComponentId = rootId ?? builderProps?.uid;
|
|
12
|
+
const sliderSelector = `gp-carousel-slider-${builderProps?.uid}`;
|
|
13
|
+
const { enableAction = {
|
|
14
|
+
desktop: true
|
|
15
|
+
}, navigationStyle, navigationEnable = {
|
|
16
|
+
desktop: true
|
|
17
|
+
} } = setting ?? {};
|
|
18
|
+
const getLoopSetting = ()=>{
|
|
19
|
+
let result = setting?.loop;
|
|
20
|
+
DEVICES.forEach((device)=>{
|
|
21
|
+
result = {
|
|
22
|
+
...result,
|
|
23
|
+
[device]: getResponsiveValueByScreen(enableAction) ? result?.[device] : false
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
const getArrowType = ()=>{
|
|
29
|
+
let result = navigationStyle;
|
|
30
|
+
DEVICES.forEach((device)=>{
|
|
31
|
+
result = {
|
|
32
|
+
...result,
|
|
33
|
+
[device]: getResponsiveValueByScreen(navigationEnable, device) ? result?.[device] : 'none'
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
const stateData = createStateOrContext({
|
|
39
|
+
id: uniqueComponentId,
|
|
40
|
+
moveToIdx,
|
|
41
|
+
isHiddenArrowWhenDisabled,
|
|
42
|
+
setting,
|
|
43
|
+
styles
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
loopConfig: getLoopSetting(),
|
|
47
|
+
stateData: JSON.stringify(stateData).replaceAll("'", '''),
|
|
48
|
+
uniqueComponentId,
|
|
49
|
+
arrowShowConfig: getArrowType(),
|
|
50
|
+
sliderSelector
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getData };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { makeStyleResponsive, getHeightByShapeGlobalSize, makeStyleWithDefault, getWidthByShapeGlobalSize, getBgByDevice, makeContainerWidthOrHeight, getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
+
import { createStyle } from '@gem-sdk/system';
|
|
3
|
+
|
|
4
|
+
const getStyle = (props)=>{
|
|
5
|
+
const DEVICES = [
|
|
6
|
+
'mobile',
|
|
7
|
+
'tablet',
|
|
8
|
+
'desktop'
|
|
9
|
+
];
|
|
10
|
+
const { styles, setting, style, rootStyles } = props;
|
|
11
|
+
const { arrowGapToEachSide = '16' } = setting ?? {};
|
|
12
|
+
const styleHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(styles?.sizeSetting));
|
|
13
|
+
const styleWidth = makeStyleWithDefault('w', getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
|
|
14
|
+
desktop: '--g-ct-w',
|
|
15
|
+
tablet: '--g-ct-w',
|
|
16
|
+
mobile: '--g-ct-w'
|
|
17
|
+
});
|
|
18
|
+
const makeSpacing = ()=>{
|
|
19
|
+
let result = {};
|
|
20
|
+
DEVICES.forEach((device)=>{
|
|
21
|
+
const isVertical = getResponsiveValueByScreen(setting?.vertical, device);
|
|
22
|
+
const spacing = getResponsiveValueByScreen(styles?.spacing, device);
|
|
23
|
+
const key = isVertical ? `--rg${device !== 'desktop' ? `-${device}` : ''}` : `--cg${device !== 'desktop' ? `-${device}` : ''}`;
|
|
24
|
+
result = {
|
|
25
|
+
...result,
|
|
26
|
+
[key]: `${spacing ?? 0}px`
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
const wrapperStyleRender = createStyle({
|
|
32
|
+
...style,
|
|
33
|
+
...styleHeight,
|
|
34
|
+
...styleWidth,
|
|
35
|
+
...getBgByDevice({
|
|
36
|
+
backgroundColor: styles?.backgroundColor,
|
|
37
|
+
backgroundImage: styles?.backgroundImage
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const wrapperInnerStyle = createStyle({
|
|
41
|
+
...makeContainerWidthOrHeight({
|
|
42
|
+
vertical: setting?.vertical,
|
|
43
|
+
dotStyle: setting?.dotStyle
|
|
44
|
+
}),
|
|
45
|
+
gap: arrowGapToEachSide + 'px'
|
|
46
|
+
});
|
|
47
|
+
const rootStyleRender = createStyle({
|
|
48
|
+
...makeStyleResponsive('jc', styles?.align),
|
|
49
|
+
...rootStyles
|
|
50
|
+
});
|
|
51
|
+
const sliderStyle = createStyle({
|
|
52
|
+
...makeSpacing()
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
rootStyleRender,
|
|
56
|
+
wrapperStyleRender,
|
|
57
|
+
wrapperInnerStyle,
|
|
58
|
+
sliderStyle
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { getStyle };
|