@gem-sdk/components 2.0.0-dev.693 → 2.0.0-dev.694
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/builder.js +6 -12
- package/dist/cjs/index.js +32 -34
- package/dist/cjs/index.liquid.js +10 -16
- package/dist/cjs/next.js +1 -3
- package/dist/cjs/product/components/ProductImagesV2/common/common.js +2 -1
- package/dist/cjs/product/index.js +4 -6
- package/dist/cjs/product/next.js +0 -4
- package/dist/cjs/setting.js +76 -78
- package/dist/esm/builder.js +0 -6
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.liquid.js +0 -3
- package/dist/esm/next.js +1 -3
- package/dist/esm/product/components/ProductImagesV2/common/common.js +2 -1
- package/dist/esm/product/index.js +24 -26
- package/dist/esm/product/next.js +0 -4
- package/dist/esm/setting.js +0 -2
- package/dist/types/index.d.ts +116 -551
- package/package.json +1 -1
- package/dist/cjs/product/components/ProductImagesV3/common/common.js +0 -360
- package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +0 -192
- package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -26
- package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +0 -94
- package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +0 -303
- package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +0 -95
- package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -59
- package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +0 -266
- package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -63
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -36
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -109
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -139
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -100
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -77
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -300
- package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -44
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -83
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -182
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -30
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -239
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -28
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -144
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -14
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -54
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -53
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -55
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -41
- package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -134
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -203
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -87
- package/dist/cjs/product/components/ProductImagesV3/index.js +0 -291
- package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +0 -153
- package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +0 -252
- package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +0 -251
- package/dist/cjs/product/setting/product-image-v3/ProductImages.js +0 -74
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -388
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -519
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +0 -337
- package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -118
- package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -119
- package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +0 -237
- package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +0 -491
- package/dist/cjs/swiper-carousel/arrow/Arrow.js +0 -52
- package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +0 -46
- package/dist/cjs/swiper-carousel/arrow/common/common.js +0 -119
- package/dist/cjs/swiper-carousel/arrow/common/getClass.js +0 -50
- package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +0 -84
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +0 -34
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -38
- package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +0 -29
- package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +0 -79
- package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -22
- package/dist/cjs/swiper-carousel/components/common/carousel.js +0 -98
- package/dist/cjs/swiper-carousel/components/const/index.js +0 -5
- package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -34
- package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +0 -42
- package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -105
- package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -15
- package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +0 -45
- package/dist/cjs/swiper-carousel/dots/Dots.js +0 -51
- package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +0 -26
- package/dist/cjs/swiper-carousel/dots/common/common.js +0 -28
- package/dist/cjs/swiper-carousel/dots/common/getClass.js +0 -40
- package/dist/cjs/swiper-carousel/dots/common/getStyle.js +0 -33
- package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +0 -21
- package/dist/cjs/swiper-carousel/index.js +0 -17
- package/dist/cjs/swiper-carousel/next.js +0 -22
- package/dist/cjs/swiper-carousel/root/Swiper.js +0 -128
- package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +0 -104
- package/dist/cjs/swiper-carousel/root/common/getAttr.js +0 -25
- package/dist/cjs/swiper-carousel/root/common/getClass.js +0 -135
- package/dist/cjs/swiper-carousel/root/common/getData.js +0 -56
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +0 -66
- package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +0 -482
- package/dist/cjs/swiper-carousel/setting/Swiper.js +0 -42
- package/dist/cjs/swiper-carousel/setting/SwiperItem.js +0 -40
- package/dist/cjs/swiper-carousel/setting/configs/presets.js +0 -87
- package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +0 -822
- package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +0 -718
- package/dist/esm/product/components/ProductImagesV3/common/common.js +0 -344
- package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +0 -189
- package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -24
- package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +0 -83
- package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +0 -292
- package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +0 -92
- package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -53
- package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +0 -251
- package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -59
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -32
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -105
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -135
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -96
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -73
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -296
- package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -40
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -79
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -178
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -26
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -235
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -24
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -140
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -12
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -52
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -51
- package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -53
- package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -39
- package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -132
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -201
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -85
- package/dist/esm/product/components/ProductImagesV3/index.js +0 -287
- package/dist/esm/product/components/ProductImagesV3/index.liquid.js +0 -149
- package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +0 -248
- package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +0 -248
- package/dist/esm/product/setting/product-image-v3/ProductImages.js +0 -70
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -384
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -516
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +0 -335
- package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -116
- package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -117
- package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +0 -235
- package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +0 -489
- package/dist/esm/swiper-carousel/arrow/Arrow.js +0 -48
- package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +0 -42
- package/dist/esm/swiper-carousel/arrow/common/common.js +0 -111
- package/dist/esm/swiper-carousel/arrow/common/getClass.js +0 -48
- package/dist/esm/swiper-carousel/arrow/common/getStyle.js +0 -82
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +0 -30
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -34
- package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +0 -27
- package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +0 -77
- package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -20
- package/dist/esm/swiper-carousel/components/common/carousel.js +0 -93
- package/dist/esm/swiper-carousel/components/const/index.js +0 -3
- package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -30
- package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +0 -35
- package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -103
- package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -13
- package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +0 -43
- package/dist/esm/swiper-carousel/dots/Dots.js +0 -47
- package/dist/esm/swiper-carousel/dots/Dots.liquid.js +0 -22
- package/dist/esm/swiper-carousel/dots/common/common.js +0 -26
- package/dist/esm/swiper-carousel/dots/common/getClass.js +0 -38
- package/dist/esm/swiper-carousel/dots/common/getStyle.js +0 -31
- package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +0 -19
- package/dist/esm/swiper-carousel/index.js +0 -15
- package/dist/esm/swiper-carousel/next.js +0 -18
- package/dist/esm/swiper-carousel/root/Swiper.js +0 -124
- package/dist/esm/swiper-carousel/root/Swiper.liquid.js +0 -100
- package/dist/esm/swiper-carousel/root/common/getAttr.js +0 -23
- package/dist/esm/swiper-carousel/root/common/getClass.js +0 -133
- package/dist/esm/swiper-carousel/root/common/getData.js +0 -54
- package/dist/esm/swiper-carousel/root/common/getStyle.js +0 -64
- package/dist/esm/swiper-carousel/root/hook/useCarousel.js +0 -480
- package/dist/esm/swiper-carousel/setting/Swiper.js +0 -38
- package/dist/esm/swiper-carousel/setting/SwiperItem.js +0 -36
- package/dist/esm/swiper-carousel/setting/configs/presets.js +0 -85
- package/dist/esm/swiper-carousel/setting/configs/settingV2.js +0 -818
- package/dist/esm/swiper-carousel/setting/configs/uiV2.js +0 -713
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import { getResponsiveValueByScreen, makeAspectRatio, makeStyleResponsive, removeNullUndefined } from '@gem-sdk/core';
|
|
2
|
-
|
|
3
|
-
const getTypeWidthDevice = (typeWithDevice)=>{
|
|
4
|
-
const desktopType = typeWithDevice?.desktop;
|
|
5
|
-
const tabletType = typeWithDevice?.tablet === undefined ? desktopType : typeWithDevice?.tablet;
|
|
6
|
-
const mobileType = typeWithDevice?.mobile === undefined ? tabletType : typeWithDevice?.mobile;
|
|
7
|
-
return {
|
|
8
|
-
desktop: desktopType,
|
|
9
|
-
tablet: tabletType,
|
|
10
|
-
mobile: mobileType
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
const convertUnitToNumber = (value, defaultValue)=>{
|
|
14
|
-
if (!value) {
|
|
15
|
-
return defaultValue;
|
|
16
|
-
}
|
|
17
|
-
if (typeof value === 'number') {
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
const data = value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '');
|
|
21
|
-
return !isNaN(Number(data)) ? Number(data) : defaultValue;
|
|
22
|
-
};
|
|
23
|
-
const convertSpacing = (spacing)=>{
|
|
24
|
-
if (!spacing) {
|
|
25
|
-
return {
|
|
26
|
-
desktop: 5
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
desktop: convertUnitToNumber(spacing.desktop, 5),
|
|
31
|
-
tablet: convertUnitToNumber(spacing.tablet, 5),
|
|
32
|
-
mobile: convertUnitToNumber(spacing.mobile, 5)
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const getDisplayStyle = (fnCondition, defaultValue)=>{
|
|
36
|
-
let result = {};
|
|
37
|
-
const devices = [
|
|
38
|
-
'desktop',
|
|
39
|
-
'mobile',
|
|
40
|
-
'tablet'
|
|
41
|
-
];
|
|
42
|
-
devices.forEach((device)=>{
|
|
43
|
-
result = {
|
|
44
|
-
...result,
|
|
45
|
-
[`--d${device === 'desktop' ? '' : `-${device}`}`]: `${fnCondition(device) ? 'none' : defaultValue}`
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
const checkAddOverFlowClass = (style)=>{
|
|
51
|
-
const radius = style?.['--radius'];
|
|
52
|
-
const bblr = style?.['--bblr'] || '0px';
|
|
53
|
-
const bbrr = style?.['--bbrr'] || '0px';
|
|
54
|
-
const btlr = style?.['--btlr'] || '0px';
|
|
55
|
-
const btrr = style?.['--btrr'] || '0px';
|
|
56
|
-
return radius && !radius.toString().includes('none') && radius.toString() !== '0' || bblr !== '0px' || bbrr !== '0px' || btlr !== '0px' || btrr !== '0px';
|
|
57
|
-
};
|
|
58
|
-
const getAspectRatio = (shape)=>{
|
|
59
|
-
let result = {};
|
|
60
|
-
const DEVICES = [
|
|
61
|
-
'desktop',
|
|
62
|
-
'mobile',
|
|
63
|
-
'tablet'
|
|
64
|
-
];
|
|
65
|
-
DEVICES.forEach((device)=>{
|
|
66
|
-
const shapeValue = getResponsiveValueByScreen(shape, device)?.shapeValue;
|
|
67
|
-
if (shapeValue) {
|
|
68
|
-
result = {
|
|
69
|
-
...result,
|
|
70
|
-
[device]: shapeValue
|
|
71
|
-
};
|
|
72
|
-
} else {
|
|
73
|
-
const shapeConfig = getResponsiveValueByScreen(shape, device)?.shape;
|
|
74
|
-
switch(shapeConfig){
|
|
75
|
-
case 'square':
|
|
76
|
-
result = {
|
|
77
|
-
...result,
|
|
78
|
-
[device]: '1/1'
|
|
79
|
-
};
|
|
80
|
-
break;
|
|
81
|
-
case 'vertical':
|
|
82
|
-
result = {
|
|
83
|
-
...result,
|
|
84
|
-
[device]: '3/4'
|
|
85
|
-
};
|
|
86
|
-
break;
|
|
87
|
-
case 'horizontal':
|
|
88
|
-
result = {
|
|
89
|
-
...result,
|
|
90
|
-
[device]: '4/3'
|
|
91
|
-
};
|
|
92
|
-
break;
|
|
93
|
-
case 'original':
|
|
94
|
-
result = {
|
|
95
|
-
...result,
|
|
96
|
-
[device]: ''
|
|
97
|
-
};
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return makeAspectRatio(result);
|
|
103
|
-
};
|
|
104
|
-
const getStyleGridLayout = (settings)=>{
|
|
105
|
-
const DEVICES = [
|
|
106
|
-
'desktop',
|
|
107
|
-
'tablet',
|
|
108
|
-
'mobile'
|
|
109
|
-
];
|
|
110
|
-
let result = {
|
|
111
|
-
[`--gtc`]: 'minmax(0, 12fr)',
|
|
112
|
-
[`--gtc-tablet`]: 'minmax(0, 12fr)',
|
|
113
|
-
[`--gtc-mobile`]: 'minmax(0, 12fr)'
|
|
114
|
-
};
|
|
115
|
-
if (!settings.isHiddenGalleryImages) {
|
|
116
|
-
let hasHorizontalLayout = false;
|
|
117
|
-
DEVICES.forEach((device)=>{
|
|
118
|
-
const positionDevice = getResponsiveValueByScreen(settings.position, device);
|
|
119
|
-
const ratioLayoutDevice = getResponsiveValueByScreen(settings.ratioLayout, device);
|
|
120
|
-
const ratioLayoutRightDevice = getResponsiveValueByScreen(settings.ratioLayoutRight, device);
|
|
121
|
-
const key = device === 'desktop' ? '--gtc' : `--gtc-${device}`;
|
|
122
|
-
const rowKey = device === 'desktop' ? '--gtr' : `--gtr-${device}`;
|
|
123
|
-
const ratioLayout = positionDevice === 'left' ? ratioLayoutDevice : ratioLayoutRightDevice;
|
|
124
|
-
const isHorizontalLayout = [
|
|
125
|
-
'left',
|
|
126
|
-
'right'
|
|
127
|
-
].includes(positionDevice || '');
|
|
128
|
-
if (isHorizontalLayout && ratioLayout) {
|
|
129
|
-
hasHorizontalLayout = true;
|
|
130
|
-
result = {
|
|
131
|
-
...result,
|
|
132
|
-
[key]: `minmax(0, ${ratioLayout[0]}fr) minmax(0, ${ratioLayout[1]}fr)`
|
|
133
|
-
};
|
|
134
|
-
Object.assign(result, {
|
|
135
|
-
[rowKey]: 'fit-content(0)'
|
|
136
|
-
});
|
|
137
|
-
} else if (hasHorizontalLayout) {
|
|
138
|
-
Object.assign(result, {
|
|
139
|
-
[rowKey]: 'unset'
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return result;
|
|
145
|
-
};
|
|
146
|
-
const getStyleGridOrderForFeature = (settings)=>{
|
|
147
|
-
let result = {
|
|
148
|
-
[`--o`]: '0',
|
|
149
|
-
[`--o-tablet`]: '0',
|
|
150
|
-
[`--o-mobile`]: '0'
|
|
151
|
-
};
|
|
152
|
-
const DEVICES = [
|
|
153
|
-
'desktop',
|
|
154
|
-
'mobile',
|
|
155
|
-
'tablet'
|
|
156
|
-
];
|
|
157
|
-
DEVICES.forEach((device)=>{
|
|
158
|
-
const positionDevice = getResponsiveValueByScreen(settings.position, device);
|
|
159
|
-
const key = device === 'desktop' ? '--o' : `--o-${device}`;
|
|
160
|
-
result = {
|
|
161
|
-
...result,
|
|
162
|
-
[key]: positionDevice === 'left' ? `1` : '0'
|
|
163
|
-
};
|
|
164
|
-
});
|
|
165
|
-
return result;
|
|
166
|
-
};
|
|
167
|
-
const getStyleGridOrderForGallery = (settings)=>{
|
|
168
|
-
let result = {
|
|
169
|
-
[`--o`]: '1',
|
|
170
|
-
[`--o-tablet`]: '1',
|
|
171
|
-
[`--o-mobile`]: '1'
|
|
172
|
-
};
|
|
173
|
-
const DEVICES = [
|
|
174
|
-
'desktop',
|
|
175
|
-
'mobile',
|
|
176
|
-
'tablet'
|
|
177
|
-
];
|
|
178
|
-
DEVICES.forEach((device)=>{
|
|
179
|
-
const positionDevice = getResponsiveValueByScreen(settings.position, device);
|
|
180
|
-
const key = device === 'desktop' ? '--o' : `--o-${device}`;
|
|
181
|
-
result = {
|
|
182
|
-
...result,
|
|
183
|
-
[key]: positionDevice === 'left' ? `0` : '1'
|
|
184
|
-
};
|
|
185
|
-
});
|
|
186
|
-
return result;
|
|
187
|
-
};
|
|
188
|
-
const getSrcImage = (liquidSrc)=>{
|
|
189
|
-
return `{{${liquidSrc} | img_url: '480x480'}} 480w, {{${liquidSrc} | img_url: '768x768'}} 768w,{{${liquidSrc} | img_url: '1024x1024'}} 1024w,{{${liquidSrc} | img_url: '1440x1440'}} 1440w`;
|
|
190
|
-
};
|
|
191
|
-
const convertSpacingForIndisdeLayout = (spacing)=>{
|
|
192
|
-
const spacingVal = parseInt(spacing) ? `${parseInt(spacing) * 2}px` : `${spacing} * 2`;
|
|
193
|
-
return spacingVal;
|
|
194
|
-
};
|
|
195
|
-
const getStyleInsideLayout = (position, shape, spacing)=>{
|
|
196
|
-
const DEVICES = [
|
|
197
|
-
'desktop',
|
|
198
|
-
'mobile',
|
|
199
|
-
'tablet'
|
|
200
|
-
];
|
|
201
|
-
let posResponsive = {};
|
|
202
|
-
let width = {};
|
|
203
|
-
let bottom = {};
|
|
204
|
-
let top = {};
|
|
205
|
-
let right = {};
|
|
206
|
-
let left = {};
|
|
207
|
-
DEVICES.forEach((device)=>{
|
|
208
|
-
const positionDevice = getResponsiveValueByScreen(position, device);
|
|
209
|
-
let widthDevice = getResponsiveValueByScreen(shape, device)?.width;
|
|
210
|
-
const spacingDevice = getResponsiveValueByScreen(spacing, device);
|
|
211
|
-
posResponsive = {
|
|
212
|
-
...posResponsive,
|
|
213
|
-
[device]: [
|
|
214
|
-
'inside-bottom',
|
|
215
|
-
'inside-left',
|
|
216
|
-
'inside-right'
|
|
217
|
-
].includes(positionDevice) ? 'absolute' : 'static'
|
|
218
|
-
};
|
|
219
|
-
if ([
|
|
220
|
-
'inside-bottom'
|
|
221
|
-
].includes(positionDevice)) {
|
|
222
|
-
const spacingVal = convertSpacingForIndisdeLayout(spacingDevice);
|
|
223
|
-
widthDevice = `calc(100% - ${spacingVal})`;
|
|
224
|
-
}
|
|
225
|
-
if ([
|
|
226
|
-
'bottom-center',
|
|
227
|
-
'two-col',
|
|
228
|
-
'one-col'
|
|
229
|
-
].includes(positionDevice)) {
|
|
230
|
-
widthDevice = '100%';
|
|
231
|
-
}
|
|
232
|
-
bottom = {
|
|
233
|
-
...bottom,
|
|
234
|
-
[device]: positionDevice === 'inside-bottom' ? `${spacingDevice}` : 'auto'
|
|
235
|
-
};
|
|
236
|
-
top = {
|
|
237
|
-
...top,
|
|
238
|
-
[device]: [
|
|
239
|
-
'inside-left',
|
|
240
|
-
'inside-right'
|
|
241
|
-
].includes(positionDevice) ? `${spacingDevice}` : 'auto'
|
|
242
|
-
};
|
|
243
|
-
left = {
|
|
244
|
-
...left,
|
|
245
|
-
[device]: [
|
|
246
|
-
'inside-bottom',
|
|
247
|
-
'inside-left'
|
|
248
|
-
].includes(positionDevice) ? `${spacingDevice}` : 'auto'
|
|
249
|
-
};
|
|
250
|
-
right = {
|
|
251
|
-
...right,
|
|
252
|
-
[device]: positionDevice === 'inside-right' ? `${spacingDevice}` : 'auto'
|
|
253
|
-
};
|
|
254
|
-
width = {
|
|
255
|
-
...width,
|
|
256
|
-
[device]: widthDevice
|
|
257
|
-
};
|
|
258
|
-
});
|
|
259
|
-
return {
|
|
260
|
-
...makeStyleResponsive('pos', posResponsive),
|
|
261
|
-
...makeStyleResponsive('w', removeNullUndefined(width)),
|
|
262
|
-
...makeStyleResponsive('bottom', removeNullUndefined(bottom)),
|
|
263
|
-
...makeStyleResponsive('top', removeNullUndefined(top)),
|
|
264
|
-
...makeStyleResponsive('left', removeNullUndefined(left)),
|
|
265
|
-
...makeStyleResponsive('right', removeNullUndefined(right))
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
const getConditionRenderGalleryImages = (position)=>{
|
|
269
|
-
const DEVICES = [
|
|
270
|
-
'desktop',
|
|
271
|
-
'mobile',
|
|
272
|
-
'tablet'
|
|
273
|
-
];
|
|
274
|
-
let isOnlyFeatureAllDevices = true;
|
|
275
|
-
let isRenderGalleryGrid = false;
|
|
276
|
-
DEVICES.forEach((device)=>{
|
|
277
|
-
const positionDevice = getResponsiveValueByScreen(position, device);
|
|
278
|
-
if (positionDevice && positionDevice !== 'only-feature') isOnlyFeatureAllDevices = false;
|
|
279
|
-
if ([
|
|
280
|
-
'two-col',
|
|
281
|
-
'one-col'
|
|
282
|
-
].includes(positionDevice)) {
|
|
283
|
-
isRenderGalleryGrid = true;
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
return {
|
|
287
|
-
isOnlyFeatureAllDevices,
|
|
288
|
-
isRenderGalleryGrid
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
const setDefaultWhenUndefineSetting = (props)=>{
|
|
292
|
-
return {
|
|
293
|
-
...props,
|
|
294
|
-
setting: {
|
|
295
|
-
...props.setting
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
};
|
|
299
|
-
const getValueFromValueContainUnit = (value)=>{
|
|
300
|
-
const result = value.match(/\d+/g);
|
|
301
|
-
return result ? result[0] : value;
|
|
302
|
-
};
|
|
303
|
-
const getPaddingBottomByShapeSetting = (shapeSetting)=>{
|
|
304
|
-
const aspectRatio = getAspectRatio(shapeSetting);
|
|
305
|
-
let result = {
|
|
306
|
-
desktop: 'auto',
|
|
307
|
-
mobile: 'auto',
|
|
308
|
-
tablet: 'auto'
|
|
309
|
-
};
|
|
310
|
-
const DEVICES = [
|
|
311
|
-
'desktop',
|
|
312
|
-
'mobile',
|
|
313
|
-
'tablet'
|
|
314
|
-
];
|
|
315
|
-
DEVICES.forEach((device)=>{
|
|
316
|
-
const shapeByDevice = getResponsiveValueByScreen(shapeSetting, device);
|
|
317
|
-
const height = shapeByDevice?.height;
|
|
318
|
-
const width = shapeByDevice?.width || '';
|
|
319
|
-
const heightNotUnit = getValueFromValueContainUnit(height || '');
|
|
320
|
-
const widthNotUnit = width.match(/px/g) ? getValueFromValueContainUnit(width) : width;
|
|
321
|
-
if (height && width && !isNaN(Number(heightNotUnit)) && !isNaN(Number(widthNotUnit))) {
|
|
322
|
-
result = {
|
|
323
|
-
...result,
|
|
324
|
-
[device]: `${Number(heightNotUnit) / Number(widthNotUnit) * 100}%`
|
|
325
|
-
};
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
if (height && !isNaN(Number(heightNotUnit))) {
|
|
329
|
-
result = {
|
|
330
|
-
...result,
|
|
331
|
-
[device]: height
|
|
332
|
-
};
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
336
|
-
result = {
|
|
337
|
-
...result,
|
|
338
|
-
[device]: `calc((${value})*100%)`
|
|
339
|
-
};
|
|
340
|
-
});
|
|
341
|
-
return result;
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
export { checkAddOverFlowClass, convertSpacing, convertSpacingForIndisdeLayout, convertUnitToNumber, getAspectRatio, getConditionRenderGalleryImages, getDisplayStyle, getPaddingBottomByShapeSetting, getSrcImage, getStyleGridLayout, getStyleGridOrderForFeature, getStyleGridOrderForGallery, getStyleInsideLayout, getTypeWidthDevice, setDefaultWhenUndefineSetting };
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
-
import { getShapeByLayout, getSliderPerShowConfig, getAllowDotConfig, getDotStyleConfig, getCarouselVerticalConfigByPosition } from './productGallery.js';
|
|
3
|
-
import { getDotStyleForOnlyFeaturedImage } from './productFeaturedImage.js';
|
|
4
|
-
|
|
5
|
-
const DEVICES = [
|
|
6
|
-
'desktop',
|
|
7
|
-
'mobile',
|
|
8
|
-
'tablet'
|
|
9
|
-
];
|
|
10
|
-
const getGalleryCarouselSettingAttr = (setting)=>{
|
|
11
|
-
const shapeByLayout = getShapeByLayout({
|
|
12
|
-
shape: setting.shape,
|
|
13
|
-
shapeForBottom: setting.shapeForBottom,
|
|
14
|
-
shapeFor1Col: setting.shapeFor1Col,
|
|
15
|
-
shapeFor2Col: setting.shapeFor2Col,
|
|
16
|
-
shapeForFtOnly: setting.shapeForFtOnly,
|
|
17
|
-
shapeForInsideBottom: setting.shapeForInsideBottom,
|
|
18
|
-
shapeForInside: setting.shapeForInside
|
|
19
|
-
}, setting.position);
|
|
20
|
-
const slidePerShow = getSliderPerShowConfig(shapeByLayout, setting.position);
|
|
21
|
-
const controlOverContent = {
|
|
22
|
-
desktop: getResponsiveValueByScreen(setting.navigationPosition, 'desktop') === 'inside',
|
|
23
|
-
tablet: getResponsiveValueByScreen(setting.navigationPosition, 'tablet') === 'inside',
|
|
24
|
-
mobile: getResponsiveValueByScreen(setting.navigationPosition, 'mobile') === 'inside'
|
|
25
|
-
};
|
|
26
|
-
const mappingNavigationEnable = DEVICES.reduce((acc, device)=>{
|
|
27
|
-
if (setting.navigationPosition?.[device]) {
|
|
28
|
-
acc[device] = setting.navigationPosition[device] !== 'none';
|
|
29
|
-
}
|
|
30
|
-
return acc;
|
|
31
|
-
}, {});
|
|
32
|
-
return {
|
|
33
|
-
...setting?.loop && {
|
|
34
|
-
loop: setting.loop
|
|
35
|
-
},
|
|
36
|
-
itemNumber: slidePerShow,
|
|
37
|
-
dot: getAllowDotConfig(),
|
|
38
|
-
dotStyle: getDotStyleConfig(),
|
|
39
|
-
controlOverContent: controlOverContent,
|
|
40
|
-
...setting?.dragToScroll && {
|
|
41
|
-
enableDrag: {
|
|
42
|
-
desktop: setting.dragToScroll,
|
|
43
|
-
tablet: setting.dragToScroll,
|
|
44
|
-
mobile: setting.dragToScroll
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
vertical: getCarouselVerticalConfigByPosition(setting.position),
|
|
48
|
-
...setting?.arrowIcon && {
|
|
49
|
-
arrowCustom: setting.arrowIcon
|
|
50
|
-
},
|
|
51
|
-
...{
|
|
52
|
-
arrowIconSize: setting.arrowIconSize || {
|
|
53
|
-
desktop: 24
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
...setting?.arrowIconColor && {
|
|
57
|
-
arrowCustomColor: setting.arrowIconColor
|
|
58
|
-
},
|
|
59
|
-
...setting?.arrowNavColor && {
|
|
60
|
-
arrowBackgroundColor: setting.arrowNavColor
|
|
61
|
-
},
|
|
62
|
-
...setting?.arrowNavBorder && {
|
|
63
|
-
arrowBorder: {
|
|
64
|
-
desktop: setting.arrowNavBorder
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
...setting?.arrowNavRadius && {
|
|
68
|
-
roundedArrow: {
|
|
69
|
-
desktop: setting.arrowNavRadius
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
...setting?.arrowNavShadow && {
|
|
73
|
-
arrowShadow: {
|
|
74
|
-
desktop: setting.arrowNavShadow
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
sneakPeakType: {
|
|
78
|
-
desktop: 'center'
|
|
79
|
-
},
|
|
80
|
-
arrowGapToEachSide: '16',
|
|
81
|
-
navigationStyle: setting.navigationPosition,
|
|
82
|
-
navigationEnable: mappingNavigationEnable,
|
|
83
|
-
arrowButtonSize: {
|
|
84
|
-
desktop: {
|
|
85
|
-
width: undefined,
|
|
86
|
-
height: undefined
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
animationMode: setting?.ftAnimationMode,
|
|
90
|
-
enableAction: {
|
|
91
|
-
desktop: true
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
const getFeaturedCarouselSettingAttr = (setting)=>{
|
|
96
|
-
const controlOverContent = {
|
|
97
|
-
desktop: getResponsiveValueByScreen(setting.ftNavigationPosition, 'desktop') === 'inside',
|
|
98
|
-
tablet: getResponsiveValueByScreen(setting.ftNavigationPosition, 'tablet') === 'inside',
|
|
99
|
-
mobile: getResponsiveValueByScreen(setting.ftNavigationPosition, 'mobile') === 'inside'
|
|
100
|
-
};
|
|
101
|
-
const mappingNavigationEnable = DEVICES.reduce((acc, device)=>{
|
|
102
|
-
if (setting.ftNavigationPosition?.[device]) {
|
|
103
|
-
acc[device] = setting.ftNavigationPosition[device] !== 'none';
|
|
104
|
-
}
|
|
105
|
-
return acc;
|
|
106
|
-
}, {});
|
|
107
|
-
return {
|
|
108
|
-
...setting?.ftLoop && {
|
|
109
|
-
loop: setting.ftLoop
|
|
110
|
-
},
|
|
111
|
-
itemNumber: {
|
|
112
|
-
desktop: 1
|
|
113
|
-
},
|
|
114
|
-
dot: getAllowDotConfig(),
|
|
115
|
-
dotStyle: getDotStyleForOnlyFeaturedImage({
|
|
116
|
-
position: setting.position,
|
|
117
|
-
dotStyle: setting.ftDotStyle
|
|
118
|
-
}),
|
|
119
|
-
dotSize: setting.ftDotSize ?? {
|
|
120
|
-
desktop: 12
|
|
121
|
-
},
|
|
122
|
-
dotGapToCarousel: setting.ftDotGapToCarousel ?? {
|
|
123
|
-
desktop: 16
|
|
124
|
-
},
|
|
125
|
-
dotColor: setting.ftDotColor ?? {
|
|
126
|
-
desktop: 'bg-1'
|
|
127
|
-
},
|
|
128
|
-
dotActiveColor: setting.ftDotActiveColor ?? {
|
|
129
|
-
desktop: 'line-3'
|
|
130
|
-
},
|
|
131
|
-
controlOverContent: controlOverContent,
|
|
132
|
-
...setting?.ftDragToScroll && {
|
|
133
|
-
enableDrag: {
|
|
134
|
-
desktop: setting.ftDragToScroll,
|
|
135
|
-
tablet: setting.ftDragToScroll,
|
|
136
|
-
mobile: setting.ftDragToScroll
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
...setting?.ftArrowIcon && {
|
|
140
|
-
arrowCustom: setting.ftArrowIcon
|
|
141
|
-
},
|
|
142
|
-
...{
|
|
143
|
-
arrowIconSize: setting.ftArrowIconSize || {
|
|
144
|
-
desktop: 24
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
...setting?.ftArrowIconColor && {
|
|
148
|
-
arrowCustomColor: setting.ftArrowIconColor
|
|
149
|
-
},
|
|
150
|
-
...setting?.ftArrowNavColor && {
|
|
151
|
-
arrowBackgroundColor: setting.ftArrowNavColor
|
|
152
|
-
},
|
|
153
|
-
...setting?.ftArrowNavBorder && {
|
|
154
|
-
arrowBorder: {
|
|
155
|
-
desktop: setting.ftArrowNavBorder
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
...setting?.ftArrowNavRadius && {
|
|
159
|
-
roundedArrow: {
|
|
160
|
-
desktop: setting.ftArrowNavRadius
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
...setting?.ftArrowNavShadow && {
|
|
164
|
-
arrowShadow: {
|
|
165
|
-
desktop: setting.ftArrowNavShadow
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
sneakPeakType: {
|
|
169
|
-
desktop: 'center'
|
|
170
|
-
},
|
|
171
|
-
arrowGapToEachSide: '16',
|
|
172
|
-
animationMode: setting?.ftAnimationMode,
|
|
173
|
-
...setting?.ftNavigationPosition && {
|
|
174
|
-
navigationStyle: setting.ftNavigationPosition
|
|
175
|
-
},
|
|
176
|
-
navigationEnable: mappingNavigationEnable,
|
|
177
|
-
arrowButtonSize: {
|
|
178
|
-
desktop: {
|
|
179
|
-
width: undefined,
|
|
180
|
-
height: undefined
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
enableAction: {
|
|
184
|
-
desktop: true
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export { getFeaturedCarouselSettingAttr, getGalleryCarouselSettingAttr };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { composeBorderCss, composeCornerCss } from '@gem-sdk/core';
|
|
2
|
-
|
|
3
|
-
const getBorderActiveCss = ({ settings, uid, type })=>{
|
|
4
|
-
// const suffix = type === 'Liquid' ? '-{{product.id}}' : '';
|
|
5
|
-
const selector = type === 'Liquid' ? `.gem-slider-item-${uid}-{{product.id}}.gp-gallery-image-item::after, .gem-slider-item-gp-gallery-${uid}-{{product.id}}.gp-gallery-image-item::after` : `.gem-slider-item-active.gem-slider-item-${uid}.gp-gallery-image-item::after`;
|
|
6
|
-
return `
|
|
7
|
-
${selector} {
|
|
8
|
-
content: "";
|
|
9
|
-
height: 100%;
|
|
10
|
-
width: 100%;
|
|
11
|
-
position: absolute;
|
|
12
|
-
z-index: 999;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
${composeBorderCss(settings?.borderActive)}
|
|
16
|
-
${composeCornerCss(settings?.corner)}
|
|
17
|
-
}
|
|
18
|
-
.gem-slider-item-${uid}-{{product.id}}.gp-gallery-image-item[data-outline=active]:after, .gem-slider-item-gp-gallery-${uid}-{{product.id}}.gp-gallery-image-item[data-outline=active]:after {
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { getBorderActiveCss };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
-
|
|
3
|
-
function composeClasses(classList) {
|
|
4
|
-
return classList.split(' ').reduce((acc, item)=>{
|
|
5
|
-
acc[item] = true;
|
|
6
|
-
return acc;
|
|
7
|
-
}, {});
|
|
8
|
-
}
|
|
9
|
-
const getWrapperClasses = ({ extraClass, isAddOverFlowClass = false })=>{
|
|
10
|
-
let classList = 'gp-relative gp-w-full';
|
|
11
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
12
|
-
if (isAddOverFlowClass) classList += ` gp-overflow-hidden`;
|
|
13
|
-
return composeClasses(classList);
|
|
14
|
-
};
|
|
15
|
-
const getGalleryWrapperClasses = ({ extraClass })=>{
|
|
16
|
-
let classList = 'gallery-wrapper gp-product-images-gallery gp-flex gp-overflow-hidden gp-max-w-full gp-max-h-full data-[only-image=true]:gp-hidden';
|
|
17
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
18
|
-
return composeClasses(classList);
|
|
19
|
-
};
|
|
20
|
-
const getGalleryGridWrapperClasses = ({ extraClass })=>{
|
|
21
|
-
let classList = 'product-feature-image grid-gallery gp-flex !gp-h-fit gp-w-full gp-flex-wrap scrollbar-track:gp-rounded-2xl scrollbar-thumb:gp-rounded-2xl scrollbar-thumb:gp-bg-gray-400';
|
|
22
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
23
|
-
return composeClasses(classList);
|
|
24
|
-
};
|
|
25
|
-
const getFtImageWithGalleryClasses = ({ extraClass })=>{
|
|
26
|
-
let classList = 'gp-flex !gp-h-fit gp-relative gp-overflow-hidden';
|
|
27
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
28
|
-
return composeClasses(classList);
|
|
29
|
-
};
|
|
30
|
-
const getImageGalleryWrapperClasses = ({ extraClass })=>{
|
|
31
|
-
let classList = 'gp-flex gp-h-fit gp-max-w-full';
|
|
32
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
33
|
-
return composeClasses(classList);
|
|
34
|
-
};
|
|
35
|
-
const getFeaturedImageCarouselClasses = ({ extraClass })=>{
|
|
36
|
-
let classList = '`gp-flex-1 gp-w-full gp-feature-image-carousel';
|
|
37
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
38
|
-
return composeClasses(classList);
|
|
39
|
-
};
|
|
40
|
-
const getFeaturedImageClasses = ({ setting, extraClass })=>{
|
|
41
|
-
let classList = extraClass ?? '';
|
|
42
|
-
const devices = [
|
|
43
|
-
'desktop',
|
|
44
|
-
'tablet',
|
|
45
|
-
'mobile'
|
|
46
|
-
];
|
|
47
|
-
devices.forEach((device)=>{
|
|
48
|
-
const navigation = getResponsiveValueByScreen(setting?.ftNavigationPosition, device);
|
|
49
|
-
const suffix = device !== 'desktop' ? `${device}:` : '';
|
|
50
|
-
navigation === 'outside' ? classList += ` ${suffix}gp-px-[16px]` : classList += ` ${suffix}gp-px-0`;
|
|
51
|
-
});
|
|
52
|
-
return composeClasses(classList);
|
|
53
|
-
};
|
|
54
|
-
const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
|
|
55
|
-
let classList = extraClass ?? 'gp-flex-1 gp-w-full carousel-gallery';
|
|
56
|
-
const devices = [
|
|
57
|
-
'desktop',
|
|
58
|
-
'tablet',
|
|
59
|
-
'mobile'
|
|
60
|
-
];
|
|
61
|
-
devices.forEach((device)=>{
|
|
62
|
-
const navigation = getResponsiveValueByScreen(settings?.navigationPosition, device);
|
|
63
|
-
const type = getResponsiveValueByScreen(settings?.type, device);
|
|
64
|
-
const position = getResponsiveValueByScreen(settings?.position, device);
|
|
65
|
-
const suffix = device !== 'desktop' ? `${device}:` : '';
|
|
66
|
-
navigation === 'outside' && type === 'slider' && [
|
|
67
|
-
'bottom-center'
|
|
68
|
-
].includes(position || '') ? classList += ` ${suffix}gp-px-[16px]` : classList += ` ${suffix}gp-px-0`;
|
|
69
|
-
});
|
|
70
|
-
return composeClasses(classList);
|
|
71
|
-
};
|
|
72
|
-
const getGalleryItemClasses = ({ extraClass })=>{
|
|
73
|
-
let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
|
|
74
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
75
|
-
return composeClasses(classList);
|
|
76
|
-
};
|
|
77
|
-
const getFeaturedCarouselItemClasses = ({ extraClass })=>{
|
|
78
|
-
let classList = `gp-group gp-z-0 gp-flex !gp-min-w-full !gp-max-w-full gp-w-full gp-relative gp-items-start gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 gp-image-item gp-ft-image-item data-[outline=active]:gp-outline`;
|
|
79
|
-
if (extraClass) classList += ` ${extraClass}`;
|
|
80
|
-
return composeClasses(classList);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export { getFeaturedCarouselItemClasses, getFeaturedImageCarouselClasses, getFeaturedImageClasses, getFeaturedImageGalleryClasses, getFtImageWithGalleryClasses, getGalleryGridWrapperClasses, getGalleryItemClasses, getGalleryWrapperClasses, getImageGalleryWrapperClasses, getWrapperClasses };
|