@gem-sdk/components 2.0.0-dev.370 → 2.0.0-dev.372
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/article/setting/configs/ArticleDate/presets.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleDate/settings.js +3 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +20 -1
- package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +10 -10
- package/dist/cjs/builder.js +2 -2
- package/dist/cjs/button/setting/configs/settings.js +0 -14
- package/dist/cjs/carousel/arrow/Arrow.js +52 -0
- package/dist/cjs/carousel/arrow/Arrow.liquid.js +46 -0
- package/dist/cjs/carousel/{components/common/arrow.js → arrow/common/common.js} +13 -11
- package/dist/cjs/carousel/arrow/common/getClass.js +50 -0
- package/dist/cjs/carousel/arrow/common/getStyle.js +84 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.js +32 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.liquid.js +38 -0
- package/dist/cjs/carousel/carousel-item/common/getClass.js +29 -0
- package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +30 -47
- package/dist/cjs/carousel/carousel-item/hook/useCarouseItem.js +14 -0
- package/dist/cjs/carousel/components/const/index.js +5 -0
- package/dist/cjs/carousel/dots/Dots.js +51 -0
- package/dist/cjs/carousel/dots/Dots.liquid.js +26 -0
- package/dist/cjs/carousel/dots/common/common.js +46 -0
- package/dist/cjs/carousel/dots/common/getClass.js +40 -0
- package/dist/cjs/carousel/dots/common/getStyle.js +33 -0
- package/dist/cjs/carousel/dots/hook/useDotsSetting.js +21 -0
- package/dist/cjs/carousel/index.js +1 -2
- package/dist/cjs/carousel/next.js +2 -2
- package/dist/cjs/carousel/root/Carousel.js +129 -0
- package/dist/cjs/carousel/root/Carousel.liquid.js +104 -0
- package/dist/cjs/carousel/root/common/getAttr.js +25 -0
- package/dist/cjs/carousel/root/common/getClass.js +135 -0
- package/dist/cjs/carousel/root/common/getData.js +56 -0
- package/dist/cjs/carousel/root/common/getStyle.js +64 -0
- package/dist/cjs/carousel/{components/Carousel.js → root/hook/useCarousel.js} +153 -321
- package/dist/cjs/carousel/setting/Carousel.js +8 -1555
- package/dist/cjs/carousel/setting/configs/presets.js +380 -0
- package/dist/cjs/carousel/setting/configs/settingV2.js +771 -0
- package/dist/cjs/carousel/setting/configs/uiV1.js +434 -0
- package/dist/cjs/carousel/setting/configs/uiV2.js +627 -0
- package/dist/cjs/common/components/NoDataState.js +5 -5
- package/dist/cjs/grid/row/commons/common.js +3 -3
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/cjs/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/cjs/product/components/ProductList/common/index.js +5 -5
- package/dist/cjs/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/cjs/text/components/Text.js +3 -3
- package/dist/esm/article/setting/configs/ArticleDate/presets.js +1 -1
- package/dist/esm/article/setting/configs/ArticleDate/settings.js +3 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +20 -1
- package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +10 -10
- package/dist/esm/builder.js +2 -2
- package/dist/esm/button/setting/configs/settings.js +0 -14
- package/dist/esm/carousel/arrow/Arrow.js +48 -0
- package/dist/esm/carousel/arrow/Arrow.liquid.js +42 -0
- package/dist/esm/carousel/{components/common/arrow.js → arrow/common/common.js} +12 -10
- package/dist/esm/carousel/arrow/common/getClass.js +48 -0
- package/dist/esm/carousel/arrow/common/getStyle.js +82 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.js +28 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.liquid.js +34 -0
- package/dist/esm/carousel/carousel-item/common/getClass.js +27 -0
- package/dist/esm/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +31 -46
- package/dist/esm/carousel/carousel-item/hook/useCarouseItem.js +12 -0
- package/dist/esm/carousel/components/const/index.js +3 -0
- package/dist/esm/carousel/dots/Dots.js +47 -0
- package/dist/esm/carousel/dots/Dots.liquid.js +22 -0
- package/dist/esm/carousel/dots/common/common.js +43 -0
- package/dist/esm/carousel/dots/common/getClass.js +38 -0
- package/dist/esm/carousel/dots/common/getStyle.js +31 -0
- package/dist/esm/carousel/dots/hook/useDotsSetting.js +19 -0
- package/dist/esm/carousel/index.js +1 -2
- package/dist/esm/carousel/next.js +2 -2
- package/dist/esm/carousel/root/Carousel.js +125 -0
- package/dist/esm/carousel/root/Carousel.liquid.js +100 -0
- package/dist/esm/carousel/root/common/getAttr.js +23 -0
- package/dist/esm/carousel/root/common/getClass.js +133 -0
- package/dist/esm/carousel/root/common/getData.js +54 -0
- package/dist/esm/carousel/root/common/getStyle.js +62 -0
- package/dist/esm/carousel/{components/Carousel.js → root/hook/useCarousel.js} +150 -316
- package/dist/esm/carousel/setting/Carousel.js +8 -1555
- package/dist/esm/carousel/setting/configs/presets.js +378 -0
- package/dist/esm/carousel/setting/configs/settingV2.js +769 -0
- package/dist/esm/carousel/setting/configs/uiV1.js +432 -0
- package/dist/esm/carousel/setting/configs/uiV2.js +625 -0
- package/dist/esm/common/components/NoDataState.js +6 -6
- package/dist/esm/grid/row/commons/common.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.liquid.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/esm/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/esm/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/esm/product/components/ProductList/common/index.js +3 -3
- package/dist/esm/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/esm/text/components/Text.js +4 -4
- package/dist/types/index.d.ts +164 -67
- package/package.json +3 -3
- package/dist/cjs/carousel/components/Arrow.js +0 -110
- package/dist/cjs/carousel/components/Arrow.liquid.js +0 -103
- package/dist/cjs/carousel/components/Carousel.liquid.js +0 -256
- package/dist/cjs/carousel/components/CarouselItem.js +0 -88
- package/dist/cjs/carousel/components/Dots.js +0 -69
- package/dist/cjs/carousel/components/Dots.liquid.js +0 -23
- package/dist/cjs/carousel/components/common/dots.js +0 -57
- package/dist/esm/carousel/components/Arrow.js +0 -106
- package/dist/esm/carousel/components/Arrow.liquid.js +0 -99
- package/dist/esm/carousel/components/Carousel.liquid.js +0 -252
- package/dist/esm/carousel/components/CarouselItem.js +0 -84
- package/dist/esm/carousel/components/Dots.js +0 -65
- package/dist/esm/carousel/components/Dots.liquid.js +0 -19
- package/dist/esm/carousel/components/common/dots.js +0 -53
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var system = require('@gem-sdk/system');
|
|
5
|
+
|
|
6
|
+
const getData = (props)=>{
|
|
7
|
+
const DEVICES = [
|
|
8
|
+
'mobile',
|
|
9
|
+
'tablet',
|
|
10
|
+
'desktop'
|
|
11
|
+
];
|
|
12
|
+
const { setting, rootId, builderProps, styles, moveToIdx, isHiddenArrowWhenDisabled } = props;
|
|
13
|
+
const uniqueComponentId = rootId ?? builderProps?.uid;
|
|
14
|
+
const sliderSelector = `gp-carousel-slider-${builderProps?.uid}`;
|
|
15
|
+
const { enableAction = {
|
|
16
|
+
desktop: true
|
|
17
|
+
}, navigationStyle, navigationEnable = {
|
|
18
|
+
desktop: true
|
|
19
|
+
} } = setting ?? {};
|
|
20
|
+
const getLoopSetting = ()=>{
|
|
21
|
+
let result = setting?.loop;
|
|
22
|
+
DEVICES.forEach((device)=>{
|
|
23
|
+
result = {
|
|
24
|
+
...result,
|
|
25
|
+
[device]: core.getResponsiveValueByScreen(enableAction) ? result?.[device] : false
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
const getArrowType = ()=>{
|
|
31
|
+
let result = navigationStyle;
|
|
32
|
+
DEVICES.forEach((device)=>{
|
|
33
|
+
result = {
|
|
34
|
+
...result,
|
|
35
|
+
[device]: core.getResponsiveValueByScreen(navigationEnable, device) ? result?.[device] : 'none'
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
const stateData = system.createStateOrContext({
|
|
41
|
+
id: uniqueComponentId,
|
|
42
|
+
setting,
|
|
43
|
+
styles,
|
|
44
|
+
moveToIdx,
|
|
45
|
+
isHiddenArrowWhenDisabled
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
loopConfig: getLoopSetting(),
|
|
49
|
+
stateData: core.dataStringify(stateData).replaceAll("'", '''),
|
|
50
|
+
uniqueComponentId,
|
|
51
|
+
arrowShowConfig: getArrowType(),
|
|
52
|
+
sliderSelector
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.getData = getData;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var system = require('@gem-sdk/system');
|
|
5
|
+
|
|
6
|
+
const getStyle = (props)=>{
|
|
7
|
+
const DEVICES = [
|
|
8
|
+
'mobile',
|
|
9
|
+
'tablet',
|
|
10
|
+
'desktop'
|
|
11
|
+
];
|
|
12
|
+
const { styles, setting, style, rootStyles } = props;
|
|
13
|
+
const { arrowGapToEachSide = '16' } = setting ?? {};
|
|
14
|
+
const styleHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(styles?.sizeSetting));
|
|
15
|
+
const styleWidth = core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
|
|
16
|
+
desktop: '--g-ct-w',
|
|
17
|
+
tablet: '--g-ct-w',
|
|
18
|
+
mobile: '--g-ct-w'
|
|
19
|
+
});
|
|
20
|
+
const makeSpacing = ()=>{
|
|
21
|
+
let result = {};
|
|
22
|
+
DEVICES.forEach((device)=>{
|
|
23
|
+
const isVertical = core.getResponsiveValueByScreen(setting?.vertical, device);
|
|
24
|
+
const spacing = core.getResponsiveValueByScreen(styles?.spacing, device);
|
|
25
|
+
const key = isVertical ? `--rg${device !== 'desktop' ? `-${device}` : ''}` : `--cg${device !== 'desktop' ? `-${device}` : ''}`;
|
|
26
|
+
result = {
|
|
27
|
+
...result,
|
|
28
|
+
[key]: `${spacing ?? 0}px`
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
const wrapperStyleRender = system.createStyle({
|
|
34
|
+
...style,
|
|
35
|
+
...styleHeight,
|
|
36
|
+
...styleWidth,
|
|
37
|
+
...core.makeStyleResponsive('bgc', styles?.backgroundColor),
|
|
38
|
+
...core.getStyleBackgroundByDevice(styles?.backgroundImage, {
|
|
39
|
+
ignoreBackgroundColor: true
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
const wrapperInnerStyle = system.createStyle({
|
|
43
|
+
...core.makeContainerWidthOrHeight({
|
|
44
|
+
vertical: setting?.vertical,
|
|
45
|
+
dotStyle: setting?.dotStyle
|
|
46
|
+
}),
|
|
47
|
+
gap: arrowGapToEachSide + 'px'
|
|
48
|
+
});
|
|
49
|
+
const rootStyleRender = system.createStyle({
|
|
50
|
+
...core.makeStyleResponsive('jc', styles?.align),
|
|
51
|
+
...rootStyles
|
|
52
|
+
});
|
|
53
|
+
const sliderStyle = system.createStyle({
|
|
54
|
+
...makeSpacing()
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
rootStyleRender,
|
|
58
|
+
wrapperStyleRender,
|
|
59
|
+
wrapperInnerStyle,
|
|
60
|
+
sliderStyle
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.getStyle = getStyle;
|