@gem-sdk/components 2.0.0-dev.369 → 2.0.0-dev.371
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/article/components/ArticleDate.js +0 -1
- package/dist/cjs/article/components/ArticleReadMore.liquid.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleContent/settings.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleContent/uiV2.js +11 -1
- package/dist/cjs/article/setting/configs/ArticleExcerpt/settings.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleImage/settings.js +5 -4
- package/dist/cjs/article/setting/configs/ArticleImage/uiV2.js +48 -4
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +96 -64
- package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +380 -97
- 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/components/ArticleDate.js +0 -1
- package/dist/esm/article/components/ArticleReadMore.liquid.js +1 -1
- package/dist/esm/article/setting/configs/ArticleContent/settings.js +1 -1
- package/dist/esm/article/setting/configs/ArticleContent/uiV2.js +11 -1
- package/dist/esm/article/setting/configs/ArticleExcerpt/settings.js +1 -1
- package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -4
- package/dist/esm/article/setting/configs/ArticleImage/uiV2.js +48 -4
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +96 -64
- package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +380 -97
- 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 +165 -68
- 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
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@gem-sdk/core');
|
|
6
|
-
var Arrow_liquid = require('./Arrow.liquid.js');
|
|
7
|
-
var Dots_liquid = require('./Dots.liquid.js');
|
|
8
|
-
var arrow = require('./common/arrow.js');
|
|
9
|
-
var helpers = require('../../helpers.js');
|
|
10
|
-
|
|
11
|
-
const DEVICES = [
|
|
12
|
-
'mobile',
|
|
13
|
-
'tablet',
|
|
14
|
-
'desktop'
|
|
15
|
-
];
|
|
16
|
-
const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ...props })=>{
|
|
17
|
-
const setting = arrow.mappingNavigationCarousel(props.setting);
|
|
18
|
-
const styleHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(styles?.sizeSetting));
|
|
19
|
-
const styleWidth = core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
|
|
20
|
-
desktop: '--g-ct-w',
|
|
21
|
-
tablet: '--g-ct-w',
|
|
22
|
-
mobile: '--g-ct-w'
|
|
23
|
-
});
|
|
24
|
-
const getDisplayOfWrapper = ()=>{
|
|
25
|
-
let result = {};
|
|
26
|
-
DEVICES.forEach((device)=>{
|
|
27
|
-
result = {
|
|
28
|
-
...result,
|
|
29
|
-
[`${device === 'desktop' ? '' : `${device}:`}gp-flex`]: setting?.vertical?.[device],
|
|
30
|
-
[`${device === 'desktop' ? '' : `${device}:`}gp-block`]: !setting?.vertical?.[device]
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
const { navigationStyle, navigationEnable = {
|
|
36
|
-
desktop: true
|
|
37
|
-
}, arrowButtonSize, arrowBackgroundColor, arrowGapToEachSide = '16', arrowBorder, roundedArrow, arrowIconSize, arrowCustomColor, showWhenHover, enableAction = {
|
|
38
|
-
desktop: true
|
|
39
|
-
} } = setting ?? {};
|
|
40
|
-
const getLoopSetting = ()=>{
|
|
41
|
-
let result = setting?.loop;
|
|
42
|
-
DEVICES.forEach((device)=>{
|
|
43
|
-
result = {
|
|
44
|
-
...result,
|
|
45
|
-
[device]: core.getResponsiveValueByScreen(enableAction) ? result?.[device] : false
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
const getHeight = ()=>{
|
|
51
|
-
let result = {};
|
|
52
|
-
DEVICES.forEach((device)=>{
|
|
53
|
-
result = {
|
|
54
|
-
...result,
|
|
55
|
-
[`${device === 'desktop' ? '' : `${device}:`}gp-h-full`]: setting?.vertical?.[device],
|
|
56
|
-
[`${device === 'desktop' ? '' : `${device}:`}gp-flex-1`]: setting?.vertical?.[device]
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
return result;
|
|
60
|
-
};
|
|
61
|
-
const getArrowType = ()=>{
|
|
62
|
-
let result = navigationStyle;
|
|
63
|
-
DEVICES.forEach((device)=>{
|
|
64
|
-
result = {
|
|
65
|
-
...result,
|
|
66
|
-
[device]: core.getResponsiveValueByScreen(navigationEnable, device) ? result?.[device] : 'none'
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
return result;
|
|
70
|
-
};
|
|
71
|
-
const uniqueComponentId = `${rootId || builderProps?.uid}-{{section.id}}`;
|
|
72
|
-
const makeVerticalWrapClass = ()=>{
|
|
73
|
-
let result = {};
|
|
74
|
-
DEVICES.forEach((device)=>{
|
|
75
|
-
if (setting?.vertical?.[device]) {
|
|
76
|
-
result = {
|
|
77
|
-
...result,
|
|
78
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-flex-wrap`]: setting?.vertical?.[device]
|
|
79
|
-
};
|
|
80
|
-
} else {
|
|
81
|
-
result = {
|
|
82
|
-
...result,
|
|
83
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-flex-nowrap`]: !setting?.vertical?.[device]
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
return result;
|
|
88
|
-
};
|
|
89
|
-
const makeVerticalMinHeightClass = ()=>{
|
|
90
|
-
let result = {};
|
|
91
|
-
DEVICES.forEach((device)=>{
|
|
92
|
-
if (setting?.vertical?.[device]) {
|
|
93
|
-
result = {
|
|
94
|
-
...result,
|
|
95
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-min-h-0`]: setting?.vertical?.[device]
|
|
96
|
-
};
|
|
97
|
-
} else {
|
|
98
|
-
result = {
|
|
99
|
-
...result,
|
|
100
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-min-h-full`]: !setting?.vertical?.[device]
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return result;
|
|
105
|
-
};
|
|
106
|
-
const makeFlexColClass = ()=>{
|
|
107
|
-
let result = {};
|
|
108
|
-
DEVICES.forEach((device)=>{
|
|
109
|
-
result = {
|
|
110
|
-
...result,
|
|
111
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-flex-col`]: setting?.vertical?.[device],
|
|
112
|
-
[`${device === 'desktop' ? '' : `${device}:`}!gp-flex-row`]: !setting?.vertical?.[device]
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
return result;
|
|
116
|
-
};
|
|
117
|
-
const makeSpacing = ()=>{
|
|
118
|
-
let result = {};
|
|
119
|
-
DEVICES.forEach((device)=>{
|
|
120
|
-
const isVertical = core.getResponsiveValueByScreen(setting?.vertical, device);
|
|
121
|
-
const spacing = core.getResponsiveValueByScreen(styles?.spacing, device);
|
|
122
|
-
const key = isVertical ? `--rg${device !== 'desktop' ? `-${device}` : ''}` : `--cg${device !== 'desktop' ? `-${device}` : ''}`;
|
|
123
|
-
result = {
|
|
124
|
-
...result,
|
|
125
|
-
[key]: `${spacing}px`
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
return result;
|
|
129
|
-
};
|
|
130
|
-
const renderJS = ()=>{
|
|
131
|
-
return core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-carousel-v2.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-carousel-v2.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);
|
|
132
|
-
};
|
|
133
|
-
return core.template /* liquid */ `
|
|
134
|
-
<gp-carousel data-id="${builderProps?.uid}" ${rootAttr} id="gp-root-carousel-${uniqueComponentId}" class="${rootClass} ${advanced?.cssClass} gp-group/carousel gp-flex" gp-data='${JSON.stringify({
|
|
135
|
-
id: uniqueComponentId,
|
|
136
|
-
setting,
|
|
137
|
-
styles,
|
|
138
|
-
moveToIdx,
|
|
139
|
-
isHiddenArrowWhenDisabled
|
|
140
|
-
}).replaceAll("'", ''')}' style="${{
|
|
141
|
-
...core.makeStyleResponsive('jc', styles?.align),
|
|
142
|
-
...rootStyles
|
|
143
|
-
}}">
|
|
144
|
-
<div class="gp-hidden gp-aspect-square gp-w-[12px] gp-rounded-full gp-shadow-md"></div>
|
|
145
|
-
<div
|
|
146
|
-
${{
|
|
147
|
-
...builderAttrs
|
|
148
|
-
}}
|
|
149
|
-
class="${core.cls('gp-relative gp-my-0 tablet:gp-px-0 gp-max-w-full mobile:gp-px-0 gp-carousel-wrapper', {
|
|
150
|
-
...getDisplayOfWrapper(),
|
|
151
|
-
'!gp-flex': core.getResponsiveValueByScreen(setting?.vertical, 'desktop'),
|
|
152
|
-
'tablet:!gp-flex': core.getResponsiveValueByScreen(setting?.vertical, 'tablet'),
|
|
153
|
-
'mobile:!gp-flex': core.getResponsiveValueByScreen(setting?.vertical, 'mobile')
|
|
154
|
-
}, builderProps?.uid, wrapperClass)}"
|
|
155
|
-
style="${{
|
|
156
|
-
...style,
|
|
157
|
-
...styleWidth,
|
|
158
|
-
...styleHeight
|
|
159
|
-
}}"
|
|
160
|
-
>
|
|
161
|
-
<div
|
|
162
|
-
class="${core.cls('gp-h-full gp-relative gp-mx-auto gp-flex gp-items-center gp-justify-between', {
|
|
163
|
-
...getHeight(),
|
|
164
|
-
...makeFlexColClass()
|
|
165
|
-
})}"
|
|
166
|
-
style="${{
|
|
167
|
-
...core.makeContainerWidthOrHeight({
|
|
168
|
-
vertical: setting?.vertical,
|
|
169
|
-
dotStyle: setting?.dotStyle
|
|
170
|
-
}),
|
|
171
|
-
gap: arrowGapToEachSide + 'px'
|
|
172
|
-
}}"
|
|
173
|
-
>
|
|
174
|
-
${Arrow_liquid.default({
|
|
175
|
-
uid: builderProps?.uid,
|
|
176
|
-
componentId: uniqueComponentId,
|
|
177
|
-
custom: setting?.arrowCustom || '',
|
|
178
|
-
showArrow: getArrowType(),
|
|
179
|
-
arrowButtonSize: arrowButtonSize || {},
|
|
180
|
-
arrowIconSize: arrowIconSize || {},
|
|
181
|
-
arrowBackgroundColor: arrowBackgroundColor || '',
|
|
182
|
-
arrowCustomColor: arrowCustomColor,
|
|
183
|
-
gapToEachSize: arrowGapToEachSide,
|
|
184
|
-
showWhenHover: showWhenHover,
|
|
185
|
-
arrowBorder: arrowBorder || {},
|
|
186
|
-
arrowCorner: roundedArrow || {},
|
|
187
|
-
left: true,
|
|
188
|
-
onClick: (e)=>{
|
|
189
|
-
e.stopPropagation();
|
|
190
|
-
},
|
|
191
|
-
vertical: setting?.vertical,
|
|
192
|
-
isHiddenWhenDisabled: isHiddenArrowWhenDisabled,
|
|
193
|
-
rootId: rootId
|
|
194
|
-
})}
|
|
195
|
-
<div ${(builderProps?.uid || rootId) && `id="gp-carousel-${uniqueComponentId}"`} class="${core.cls('gem-slider gp-h-full gp-overflow-hidden gp-select-none', {
|
|
196
|
-
...makeVerticalWrapClass(),
|
|
197
|
-
...makeVerticalMinHeightClass()
|
|
198
|
-
})}"
|
|
199
|
-
style="${{
|
|
200
|
-
...makeSpacing()
|
|
201
|
-
}}">
|
|
202
|
-
${rawChildren?.length ? core.WrapRenderChildren({
|
|
203
|
-
uid: builderProps?.uid || '',
|
|
204
|
-
customProps: rawChildren[0]?.customProps
|
|
205
|
-
}, rawChildren.map((child, index)=>{
|
|
206
|
-
if (child) {
|
|
207
|
-
return core.template`${core.RenderChildren({
|
|
208
|
-
...child,
|
|
209
|
-
index,
|
|
210
|
-
parentSettings: setting,
|
|
211
|
-
parentStyle: styles,
|
|
212
|
-
background: setting?.background,
|
|
213
|
-
parentUid: builderProps?.uid
|
|
214
|
-
})}`;
|
|
215
|
-
}
|
|
216
|
-
})) : children ?? `<div>${helpers.getStaticLocale('Carousel', 'no_slider')}</div>`}
|
|
217
|
-
</div>
|
|
218
|
-
${Arrow_liquid.default({
|
|
219
|
-
uid: builderProps?.uid,
|
|
220
|
-
componentId: uniqueComponentId,
|
|
221
|
-
custom: setting?.arrowCustom || '',
|
|
222
|
-
showArrow: getArrowType(),
|
|
223
|
-
arrowButtonSize: arrowButtonSize || {},
|
|
224
|
-
arrowIconSize: arrowIconSize || {},
|
|
225
|
-
arrowBackgroundColor: arrowBackgroundColor || '',
|
|
226
|
-
arrowCustomColor: arrowCustomColor,
|
|
227
|
-
gapToEachSize: arrowGapToEachSide,
|
|
228
|
-
showWhenHover: showWhenHover,
|
|
229
|
-
arrowBorder: arrowBorder || {},
|
|
230
|
-
arrowCorner: roundedArrow || {},
|
|
231
|
-
left: false,
|
|
232
|
-
onClick: (e)=>{
|
|
233
|
-
e.stopPropagation();
|
|
234
|
-
},
|
|
235
|
-
vertical: setting?.vertical,
|
|
236
|
-
isHiddenWhenDisabled: isHiddenArrowWhenDisabled,
|
|
237
|
-
rootId: rootId
|
|
238
|
-
})}
|
|
239
|
-
</div>
|
|
240
|
-
${Dots_liquid.default({
|
|
241
|
-
loop: getLoopSetting(),
|
|
242
|
-
showDots: setting?.dot,
|
|
243
|
-
dotStyle: setting?.dotStyle,
|
|
244
|
-
dotGapToCarousel: setting?.dotGapToCarousel,
|
|
245
|
-
dotSize: setting?.dotSize,
|
|
246
|
-
vertical: setting?.vertical,
|
|
247
|
-
className: `gp-carousel-dot-container gp-carousel-dot-container-${uniqueComponentId}`
|
|
248
|
-
})}
|
|
249
|
-
</div>
|
|
250
|
-
</gp-carousel>
|
|
251
|
-
${conditionAppendJs ? `{% if ${conditionAppendJs} %} ${renderJS()} {% endif %}` : renderJS()}
|
|
252
|
-
|
|
253
|
-
`;
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
exports.default = Carousel;
|
|
@@ -1,88 +0,0 @@
|
|
|
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 React = require('react');
|
|
10
|
-
var carousel = require('./common/carousel.js');
|
|
11
|
-
|
|
12
|
-
const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, parentStyle, parentSettings, background, contentType = 'normalItem', index = 0, onClickItem, dispatchEventSelectSlide, ...passProps })=>{
|
|
13
|
-
const itemPadding = core.makeGlobalSize(parentStyle?.itemPadding);
|
|
14
|
-
const styleByContentType = React.useMemo(()=>{
|
|
15
|
-
const delList = [
|
|
16
|
-
'--radius'
|
|
17
|
-
];
|
|
18
|
-
const filterStyles = {
|
|
19
|
-
...passProps.style
|
|
20
|
-
};
|
|
21
|
-
delList.forEach((element)=>{
|
|
22
|
-
delete filterStyles?.[element];
|
|
23
|
-
});
|
|
24
|
-
if (contentType === 'productImage') return filterStyles;
|
|
25
|
-
return {
|
|
26
|
-
...filterStyles,
|
|
27
|
-
...core.makeStyle({
|
|
28
|
-
bs: parentStyle?.borderContent?.border,
|
|
29
|
-
bw: parentStyle?.borderContent?.width,
|
|
30
|
-
bc: core.getSingleColorVariable(parentStyle?.borderContent?.color)
|
|
31
|
-
}),
|
|
32
|
-
...core.getRadiusStyleActiveState({
|
|
33
|
-
...parentStyle?.roundedContent,
|
|
34
|
-
active: {
|
|
35
|
-
...parentStyle?.roundedContent || {},
|
|
36
|
-
radiusType: 'custom'
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
};
|
|
40
|
-
}, [
|
|
41
|
-
contentType,
|
|
42
|
-
parentStyle,
|
|
43
|
-
passProps.style
|
|
44
|
-
]);
|
|
45
|
-
const itemShadowStyle = core.getStyleShadow({
|
|
46
|
-
value: parentStyle?.carouselShadow,
|
|
47
|
-
styleAppliedFor: 'box-shadow',
|
|
48
|
-
isEnableShadow: parentStyle?.hasActiveShadow
|
|
49
|
-
});
|
|
50
|
-
const handleClick = (e)=>{
|
|
51
|
-
onClickItem && onClickItem(e);
|
|
52
|
-
dispatchEventSelectSlide && dispatchEventSelectSlide(index);
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
55
|
-
...builderAttrs,
|
|
56
|
-
...passProps,
|
|
57
|
-
className: core.cls(builderProps?.uid, passProps.className),
|
|
58
|
-
style: {
|
|
59
|
-
...carousel.getInitialWidthForCarouselItem({
|
|
60
|
-
spacing: parentStyle?.spacing,
|
|
61
|
-
slidesToShow: parentSettings?.itemNumber ?? parentSettings?.slidesToShow,
|
|
62
|
-
sneakPeak: parentSettings?.sneakPeak,
|
|
63
|
-
sneakPeakType: parentSettings?.sneakPeakType,
|
|
64
|
-
sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
|
|
65
|
-
sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward,
|
|
66
|
-
vertical: parentSettings?.vertical
|
|
67
|
-
}),
|
|
68
|
-
...styleByContentType,
|
|
69
|
-
...core.getStyleBackgroundByDevice(background, {
|
|
70
|
-
ignoreBackgroundImage: true,
|
|
71
|
-
ignoreBackgroundImageProperties: true,
|
|
72
|
-
ignoreBgAttachment: true
|
|
73
|
-
}),
|
|
74
|
-
...itemPadding && itemPadding.padding
|
|
75
|
-
},
|
|
76
|
-
onClick: handleClick,
|
|
77
|
-
"aria-hidden": true,
|
|
78
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
79
|
-
className: "gp-h-full gp-w-full",
|
|
80
|
-
style: {
|
|
81
|
-
...itemShadowStyle
|
|
82
|
-
},
|
|
83
|
-
children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
exports.default = CarouselItem;
|
|
@@ -1,69 +0,0 @@
|
|
|
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 React = require('react');
|
|
9
|
-
var dots = require('./common/dots.js');
|
|
10
|
-
|
|
11
|
-
const Dots = ({ onHandleClick, totalSlideItem, slideItemsPerPage, currentSlide, className, loop, showDots, dotStyle, dotGapToCarousel, dotSize, controlOverContent, vertical, dotActiveColor, dotColor, hiddenWhenOnlyOne, enabledSneakPeak, sneakPeakType, numberOfFullWidthShow, ...passProps })=>{
|
|
12
|
-
const currentDevice = core.useCurrentDevice();
|
|
13
|
-
const isLoop = core.getResponsiveValueByScreen(loop, currentDevice, false);
|
|
14
|
-
const dotItems = React.useMemo(()=>{
|
|
15
|
-
if (enabledSneakPeak) {
|
|
16
|
-
return Array.from({
|
|
17
|
-
length: isLoop ? totalSlideItem : totalSlideItem - (numberOfFullWidthShow || 0) + 1
|
|
18
|
-
}, (_, i)=>i);
|
|
19
|
-
} else {
|
|
20
|
-
return Array.from({
|
|
21
|
-
length: isLoop ? totalSlideItem : Math.ceil(totalSlideItem / slideItemsPerPage)
|
|
22
|
-
}, (_, i)=>i);
|
|
23
|
-
}
|
|
24
|
-
}, [
|
|
25
|
-
isLoop,
|
|
26
|
-
totalSlideItem,
|
|
27
|
-
slideItemsPerPage,
|
|
28
|
-
enabledSneakPeak,
|
|
29
|
-
numberOfFullWidthShow
|
|
30
|
-
]);
|
|
31
|
-
const getClass = ()=>{
|
|
32
|
-
return {
|
|
33
|
-
...dots.getDotDisplay(dotStyle, vertical)
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
const getActive = (idx)=>{
|
|
37
|
-
if (enabledSneakPeak) {
|
|
38
|
-
return idx === currentSlide;
|
|
39
|
-
}
|
|
40
|
-
return idx === (isLoop ? currentSlide : Math.ceil(currentSlide / slideItemsPerPage));
|
|
41
|
-
};
|
|
42
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
43
|
-
className: core.cls(`gp-z-2 gp-flex-1 gp-items-center gp-justify-center gp-gap-2 gp-text-center`, className, getClass()),
|
|
44
|
-
...passProps,
|
|
45
|
-
style: {
|
|
46
|
-
...core.makeStyle(dots.getStyleDots(dotStyle)),
|
|
47
|
-
...core.makeDotGapToCarouselStyle(dotStyle, dotGapToCarousel, vertical)
|
|
48
|
-
},
|
|
49
|
-
children: (!hiddenWhenOnlyOne || dotItems?.length > 1) && dotItems?.map((idx)=>{
|
|
50
|
-
const isActive = getActive(idx);
|
|
51
|
-
return /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
52
|
-
"aria-label": "Dot",
|
|
53
|
-
onClick: ()=>{
|
|
54
|
-
onHandleClick(idx, isLoop);
|
|
55
|
-
},
|
|
56
|
-
style: {
|
|
57
|
-
...core.makeStyleResponsiveByScreen('w', dotSize, 'px'),
|
|
58
|
-
...isActive ? core.getGlobalColorResponsiveStyle('bg', dotActiveColor) : core.getGlobalColorResponsiveStyle('bg', dotColor)
|
|
59
|
-
},
|
|
60
|
-
className: core.cls('gp-aspect-square gp-w-3 gp-rounded-full gp-shadow-md', {
|
|
61
|
-
'gem-slider-dot-active': isActive,
|
|
62
|
-
'gem-slider-dot-inactive': !isActive
|
|
63
|
-
})
|
|
64
|
-
}, idx);
|
|
65
|
-
})
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
exports.default = Dots;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@gem-sdk/core');
|
|
6
|
-
var dots = require('./common/dots.js');
|
|
7
|
-
|
|
8
|
-
const Dots = ({ className, loop, showDots, dotStyle, dotGapToCarousel, dotSize, controlOverContent, vertical, ...passProps })=>{
|
|
9
|
-
const getClass = ()=>{
|
|
10
|
-
return {
|
|
11
|
-
...dots.getDotDisplay(dotStyle, vertical)
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
return core.template`<div
|
|
15
|
-
class="${core.cls('gp-items-center gp-justify-center gp-gap-2 gp-text-center', className, getClass())}"
|
|
16
|
-
style="${{
|
|
17
|
-
...core.makeDotGapToCarouselStyle(dotStyle, dotGapToCarousel, vertical),
|
|
18
|
-
...core.makeStyle(dots.getStyleDots(dotStyle))
|
|
19
|
-
}}"
|
|
20
|
-
${passProps}></div>`;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
exports.default = Dots;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@gem-sdk/core');
|
|
4
|
-
|
|
5
|
-
const getUpdatedDotStyle = (dot, dotStyle)=>{
|
|
6
|
-
const devices = [
|
|
7
|
-
'desktop',
|
|
8
|
-
'tablet',
|
|
9
|
-
'mobile'
|
|
10
|
-
];
|
|
11
|
-
let result = {};
|
|
12
|
-
devices.forEach((device)=>{
|
|
13
|
-
const dotSetting = core.getResponsiveValueByScreen(dot, device);
|
|
14
|
-
const dotStyleSetting = core.getResponsiveValueByScreen(dotStyle, device);
|
|
15
|
-
result = {
|
|
16
|
-
...result,
|
|
17
|
-
[device]: dotSetting ? dotStyleSetting : 'none'
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
};
|
|
22
|
-
const getDotDisplay = (dotStyle, vertical)=>{
|
|
23
|
-
const devices = [
|
|
24
|
-
'desktop',
|
|
25
|
-
'tablet',
|
|
26
|
-
'mobile'
|
|
27
|
-
];
|
|
28
|
-
const result = {};
|
|
29
|
-
devices.forEach((device)=>{
|
|
30
|
-
const dotStyleSetting = core.getResponsiveValueByScreen(dotStyle, device);
|
|
31
|
-
const verticalSetting = core.getResponsiveValueByScreen(vertical, device);
|
|
32
|
-
const deviceType = device === 'desktop' ? '' : `${device}:`;
|
|
33
|
-
result[`${deviceType}gp-absolute`] = dotStyleSetting === 'inside';
|
|
34
|
-
result[`${deviceType}gp-static`] = dotStyleSetting !== 'inside';
|
|
35
|
-
result[`${deviceType}gp-flex-row ${deviceType}gp-left-0 ${deviceType}gp-right-0`] = !verticalSetting;
|
|
36
|
-
result[`${deviceType}gp-flex-col ${deviceType}gp-ml-2 ${deviceType}gp-w-fit ${deviceType}gp-h-full`] = !!verticalSetting;
|
|
37
|
-
});
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
const getStyleDots = (dotStyle)=>{
|
|
41
|
-
const devices = [
|
|
42
|
-
'desktop',
|
|
43
|
-
'tablet',
|
|
44
|
-
'mobile'
|
|
45
|
-
];
|
|
46
|
-
const result = {};
|
|
47
|
-
devices.forEach((device)=>{
|
|
48
|
-
const dotStyleSetting = core.getResponsiveValueByScreen(dotStyle, device);
|
|
49
|
-
const deviceType = device === 'desktop' ? '' : `${device}`;
|
|
50
|
-
result[`d${deviceType.length === 0 ? '' : '-' + deviceType}`] = dotStyleSetting && dotStyleSetting !== 'none' ? 'flex' : 'none';
|
|
51
|
-
});
|
|
52
|
-
return result;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
exports.getDotDisplay = getDotDisplay;
|
|
56
|
-
exports.getStyleDots = getStyleDots;
|
|
57
|
-
exports.getUpdatedDotStyle = getUpdatedDotStyle;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useCurrentDevice, composeCornerCss, composeBorderCss, cls, makeStyle } from '@gem-sdk/core';
|
|
4
|
-
import { getClassArrowPosition, getArrowRotate, getResponsiveSetting } from './common/arrow.js';
|
|
5
|
-
|
|
6
|
-
const Arrow = ({ showArrow, left, vertical, disabled, controlOverContent, custom, onClick, className, isHiddenWhenDisabled, arrowCustomColor, arrowButtonSize, arrowIconSize, arrowBackgroundColor, gapToEachSize, showWhenHover, arrowBorder, arrowCorner, uid, rootId, ...passProps })=>{
|
|
7
|
-
const currentDevice = useCurrentDevice();
|
|
8
|
-
const iconSize = getResponsiveSetting(arrowIconSize || {});
|
|
9
|
-
const buttonSize = getResponsiveSetting(arrowButtonSize || {});
|
|
10
|
-
const arrowType = getResponsiveSetting(showArrow || {});
|
|
11
|
-
const arrowBorderStyle = getResponsiveSetting(arrowBorder || {});
|
|
12
|
-
const arrowCornerStyle = getResponsiveSetting(arrowCorner || {});
|
|
13
|
-
const padding = {
|
|
14
|
-
'--pt': buttonSize[currentDevice]?.padding?.top || '0px',
|
|
15
|
-
'--pb': buttonSize[currentDevice]?.padding?.bottom || '0px',
|
|
16
|
-
'--pl': buttonSize[currentDevice]?.padding?.left || '0px',
|
|
17
|
-
'--pr': buttonSize[currentDevice]?.padding?.right || '0px'
|
|
18
|
-
};
|
|
19
|
-
const innerBorderCss = `
|
|
20
|
-
${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
|
|
21
|
-
${composeCornerCss(arrowCornerStyle[currentDevice])}
|
|
22
|
-
}
|
|
23
|
-
${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
|
|
24
|
-
content: "";
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
27
|
-
position: absolute;
|
|
28
|
-
pointer-events: none;
|
|
29
|
-
z-index:10;
|
|
30
|
-
${composeBorderCss(arrowBorderStyle[currentDevice])}
|
|
31
|
-
${composeCornerCss(arrowCornerStyle[currentDevice])}
|
|
32
|
-
}
|
|
33
|
-
${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}:hover::before {
|
|
34
|
-
${composeBorderCss(arrowBorderStyle[currentDevice])}
|
|
35
|
-
${composeCornerCss(arrowCornerStyle[currentDevice])}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
return /*#__PURE__*/ jsxs("button", {
|
|
40
|
-
className: cls(`${rootId ? rootId : ''} gp-carousel-arrow-${uid} gp-relative gp-flex gp-shrink-0 gp-items-center gp-justify-center gp-overflow-hidden ${className}`, {
|
|
41
|
-
'!gp-absolute gp-z-2': arrowType[currentDevice] === 'inside',
|
|
42
|
-
'gp-hidden': isHiddenWhenDisabled && disabled && arrowType[currentDevice] !== 'outside',
|
|
43
|
-
'gp-invisible': isHiddenWhenDisabled && disabled && arrowType[currentDevice] === 'outside',
|
|
44
|
-
'gp-cursor-default gp-text-gray-300': disabled,
|
|
45
|
-
'gp-cursor-pointer gp-text-gray-500': !disabled,
|
|
46
|
-
'gp-invisible group-hover/carousel:gp-visible': showWhenHover
|
|
47
|
-
}),
|
|
48
|
-
style: {
|
|
49
|
-
...makeStyle({
|
|
50
|
-
h: buttonSize[currentDevice]?.height || '32px',
|
|
51
|
-
w: buttonSize[currentDevice]?.width || '32px',
|
|
52
|
-
...getClassArrowPosition({
|
|
53
|
-
vertical,
|
|
54
|
-
arrowType,
|
|
55
|
-
gapToEachSize: gapToEachSize || '',
|
|
56
|
-
left: !!left
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
59
|
-
backgroundColor: arrowBackgroundColor,
|
|
60
|
-
...padding
|
|
61
|
-
},
|
|
62
|
-
onClick: onClick,
|
|
63
|
-
...passProps,
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ jsx("style", {
|
|
66
|
-
type: "text/css",
|
|
67
|
-
dangerouslySetInnerHTML: {
|
|
68
|
-
__html: innerBorderCss
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
/*#__PURE__*/ jsx("div", {
|
|
72
|
-
className: "gp-z-1 gp-flex gp-h-full gp-items-center",
|
|
73
|
-
children: custom ? /*#__PURE__*/ jsx("div", {
|
|
74
|
-
className: cls('gp-flex gp-items-center gp-justify-center [&>svg]:gp-h-full [&>svg]:gp-w-full', getArrowRotate(!!left, vertical?.[currentDevice])),
|
|
75
|
-
style: {
|
|
76
|
-
...makeStyle({
|
|
77
|
-
c: arrowCustomColor,
|
|
78
|
-
h: iconSize[currentDevice] + 'px',
|
|
79
|
-
w: iconSize[currentDevice] + 'px'
|
|
80
|
-
})
|
|
81
|
-
},
|
|
82
|
-
dangerouslySetInnerHTML: {
|
|
83
|
-
__html: custom ?? ''
|
|
84
|
-
}
|
|
85
|
-
}) : /*#__PURE__*/ jsxs("div", {
|
|
86
|
-
className: cls('gp-flex gp-items-center gp-justify-center [&>svg]:gp-h-full [&>svg]:gp-w-full', getArrowRotate(!!left, vertical?.[currentDevice])),
|
|
87
|
-
children: [
|
|
88
|
-
"`",
|
|
89
|
-
/*#__PURE__*/ jsx("svg", {
|
|
90
|
-
height: "100%",
|
|
91
|
-
width: "100%",
|
|
92
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
-
viewBox: "0 0 24 24",
|
|
94
|
-
fill: "currentColor",
|
|
95
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
96
|
-
d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
]
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export { Arrow as default };
|