@gem-sdk/components 2.0.0-dev.592 → 2.0.0-dev.593
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/carousel/arrow/common/common.js +0 -13
- package/dist/cjs/product/components/ProductList/ProductList.liquid.js +2 -2
- package/dist/cjs/product/components/ProductList/common/index.js +16 -9
- package/dist/esm/carousel/arrow/common/common.js +1 -13
- package/dist/esm/product/components/ProductList/ProductList.liquid.js +2 -2
- package/dist/esm/product/components/ProductList/common/index.js +14 -7
- package/package.json +1 -1
|
@@ -70,18 +70,6 @@ const getArrowDisplayStyle = (arrowType)=>{
|
|
|
70
70
|
});
|
|
71
71
|
return result;
|
|
72
72
|
};
|
|
73
|
-
const getUpdatedArrowDisplay = (arrow, controlOverContent)=>{
|
|
74
|
-
let result = {};
|
|
75
|
-
devices.forEach((device)=>{
|
|
76
|
-
const arrowSetting = core.getResponsiveValueByScreen(arrow, device);
|
|
77
|
-
const controlOverContentSetting = core.getResponsiveValueByScreen(controlOverContent, device);
|
|
78
|
-
result = {
|
|
79
|
-
...result,
|
|
80
|
-
[device]: arrowSetting ? controlOverContentSetting ? 'inside' : 'outside' : 'none'
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
return result;
|
|
84
|
-
};
|
|
85
73
|
const mappingNavigationCarousel = (setting)=>{
|
|
86
74
|
const generateValueByDevices = (value)=>{
|
|
87
75
|
const newValue = {
|
|
@@ -128,5 +116,4 @@ exports.getClassArrowDisplay = getClassArrowDisplay;
|
|
|
128
116
|
exports.getClassArrowRotate = getClassArrowRotate;
|
|
129
117
|
exports.getData = getData;
|
|
130
118
|
exports.getResponsiveSetting = getResponsiveSetting;
|
|
131
|
-
exports.getUpdatedArrowDisplay = getUpdatedArrowDisplay;
|
|
132
119
|
exports.mappingNavigationCarousel = mappingNavigationCarousel;
|
|
@@ -15,7 +15,7 @@ const ProductList = (props)=>{
|
|
|
15
15
|
const { setting, styles, pageContext } = props;
|
|
16
16
|
const isSalesPage = pageContext?.pageType === 'GP_FUNNEL_PAGE';
|
|
17
17
|
if (isSalesPage) return '';
|
|
18
|
-
const { hasRelatedExclude, relatedExcludeTrim, collectionID,
|
|
18
|
+
const { hasRelatedExclude, relatedExcludeTrim, collectionID, isLatestProducts, isGrid, numberOfProducts, productListId, productListHandles, sortedBy, isReverse, productSrc, productNumber, isSorted, relatedTag } = index.getDataLiquid(props);
|
|
19
19
|
const getRelatedProduct = ()=>{
|
|
20
20
|
return core.template /* liquid */ `
|
|
21
21
|
${core.RenderIf(productSrc === 'RelatedProduct', `
|
|
@@ -150,7 +150,7 @@ const ProductList = (props)=>{
|
|
|
150
150
|
if productSrc == 'RelatedProduct'
|
|
151
151
|
${getRelatedProduct()}
|
|
152
152
|
elsif productSrc == 'PickProduct'
|
|
153
|
-
unless ${
|
|
153
|
+
unless ${isLatestProducts}
|
|
154
154
|
assign products = null | sort
|
|
155
155
|
for handle in productHandles
|
|
156
156
|
assign productH = all_products[handle] | sort
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var common = require('../../../../carousel/
|
|
4
|
-
var common$1 = require('../../../../carousel/dots/common/common.js');
|
|
3
|
+
var common = require('../../../../carousel/dots/common/common.js');
|
|
5
4
|
var product = require('../../../helpers/product.js');
|
|
6
5
|
var productFeaturedImage = require('../../ProductImages/common/productFeaturedImage.js');
|
|
7
6
|
var _const = require('./const.js');
|
|
@@ -10,8 +9,7 @@ const getData = (props)=>{
|
|
|
10
9
|
const { setting, styles } = props;
|
|
11
10
|
const productSetting = setting?.productSetting ?? {};
|
|
12
11
|
const isRelatedProduct = productSetting.productSrc === 'RelatedProduct';
|
|
13
|
-
const
|
|
14
|
-
const dotStyle = common$1.getUpdatedDotStyle(setting?.dot, setting?.dotStyle);
|
|
12
|
+
const dotStyle = common.getUpdatedDotStyle(setting?.dot, setting?.dotStyle);
|
|
15
13
|
const carouselConfigSetting = {
|
|
16
14
|
dotSize: {
|
|
17
15
|
desktop: 12
|
|
@@ -19,6 +17,9 @@ const getData = (props)=>{
|
|
|
19
17
|
dotGapToCarousel: {
|
|
20
18
|
desktop: 16
|
|
21
19
|
},
|
|
20
|
+
arrowIconSize: setting?.arrowIconSize ?? {
|
|
21
|
+
desktop: 24
|
|
22
|
+
},
|
|
22
23
|
...setting
|
|
23
24
|
};
|
|
24
25
|
delete carouselConfigSetting.childItem;
|
|
@@ -40,7 +41,6 @@ const getData = (props)=>{
|
|
|
40
41
|
return {
|
|
41
42
|
isRelatedProduct,
|
|
42
43
|
productSetting,
|
|
43
|
-
navigationStyle,
|
|
44
44
|
dotStyle,
|
|
45
45
|
carouselConfigSetting,
|
|
46
46
|
carouselConfigStyle
|
|
@@ -55,7 +55,7 @@ const getDataLiquid = (props)=>{
|
|
|
55
55
|
const relatedExcludeTrim = mainRelatedExclude?.split(',').map((item)=>item.trim()).toString();
|
|
56
56
|
const productSrc = productSetting?.productSrc ?? 'Collection';
|
|
57
57
|
const collectionID = productSetting?.collectionId?.replace(_const.PREFIX_COLLECTION_ID, '') ?? 'latest';
|
|
58
|
-
const
|
|
58
|
+
const isLatestProducts = productSetting?.productSrc === 'PickProduct' && productSetting?.productIds?.length === 0;
|
|
59
59
|
const isGrid = styles?.layout === 'grid';
|
|
60
60
|
const numberOfProducts = productFeaturedImage.convertUnitToNumber(setting?.numberOfProducts, 4);
|
|
61
61
|
const productListId = productSrc === 'PickProduct' && productSetting?.productIds?.length ? productSetting?.productIds.map((p)=>p.replace(_const.PREFIX_PRODUCT_ID, '')) : [];
|
|
@@ -64,12 +64,19 @@ const getDataLiquid = (props)=>{
|
|
|
64
64
|
const sortedArray = (productSetting?.productSrc === 'Collection' || productSetting?.productSrc === 'DynamicCollection') && isSorted ? setting?.orderBy?.split('_') : 'none';
|
|
65
65
|
const sortedBy = isSorted && sortedArray?.[0] === 'TITLE' ? "| sort: 'title'" : "| sort: 'updated_at'";
|
|
66
66
|
const isReverse = sortedArray?.[sortedArray.length - 1] === 'DESC';
|
|
67
|
-
const
|
|
67
|
+
const getProductNumber = ()=>{
|
|
68
|
+
switch(productSrc){
|
|
69
|
+
case 'PickProduct':
|
|
70
|
+
return isLatestProducts ? 4 : productSetting?.numOfSelectedProducts ?? 4;
|
|
71
|
+
default:
|
|
72
|
+
return numberOfProducts;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
68
75
|
return {
|
|
69
76
|
hasRelatedExclude,
|
|
70
77
|
relatedExcludeTrim,
|
|
71
78
|
collectionID,
|
|
72
|
-
|
|
79
|
+
isLatestProducts,
|
|
73
80
|
isGrid,
|
|
74
81
|
numberOfProducts,
|
|
75
82
|
productListId,
|
|
@@ -80,7 +87,7 @@ const getDataLiquid = (props)=>{
|
|
|
80
87
|
productSetting,
|
|
81
88
|
isSorted,
|
|
82
89
|
relatedTag,
|
|
83
|
-
productNumber
|
|
90
|
+
productNumber: getProductNumber()
|
|
84
91
|
};
|
|
85
92
|
};
|
|
86
93
|
|
|
@@ -68,18 +68,6 @@ const getArrowDisplayStyle = (arrowType)=>{
|
|
|
68
68
|
});
|
|
69
69
|
return result;
|
|
70
70
|
};
|
|
71
|
-
const getUpdatedArrowDisplay = (arrow, controlOverContent)=>{
|
|
72
|
-
let result = {};
|
|
73
|
-
devices.forEach((device)=>{
|
|
74
|
-
const arrowSetting = getResponsiveValueByScreen(arrow, device);
|
|
75
|
-
const controlOverContentSetting = getResponsiveValueByScreen(controlOverContent, device);
|
|
76
|
-
result = {
|
|
77
|
-
...result,
|
|
78
|
-
[device]: arrowSetting ? controlOverContentSetting ? 'inside' : 'outside' : 'none'
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
71
|
const mappingNavigationCarousel = (setting)=>{
|
|
84
72
|
const generateValueByDevices = (value)=>{
|
|
85
73
|
const newValue = {
|
|
@@ -120,4 +108,4 @@ const getData = (props)=>{
|
|
|
120
108
|
};
|
|
121
109
|
};
|
|
122
110
|
|
|
123
|
-
export { getArrowDisplayStyle, getArrowPositionStyle, getClassArrowDisplay, getClassArrowRotate, getData, getResponsiveSetting,
|
|
111
|
+
export { getArrowDisplayStyle, getArrowPositionStyle, getClassArrowDisplay, getClassArrowRotate, getData, getResponsiveSetting, mappingNavigationCarousel };
|
|
@@ -11,7 +11,7 @@ const ProductList = (props)=>{
|
|
|
11
11
|
const { setting, styles, pageContext } = props;
|
|
12
12
|
const isSalesPage = pageContext?.pageType === 'GP_FUNNEL_PAGE';
|
|
13
13
|
if (isSalesPage) return '';
|
|
14
|
-
const { hasRelatedExclude, relatedExcludeTrim, collectionID,
|
|
14
|
+
const { hasRelatedExclude, relatedExcludeTrim, collectionID, isLatestProducts, isGrid, numberOfProducts, productListId, productListHandles, sortedBy, isReverse, productSrc, productNumber, isSorted, relatedTag } = getDataLiquid(props);
|
|
15
15
|
const getRelatedProduct = ()=>{
|
|
16
16
|
return template /* liquid */ `
|
|
17
17
|
${RenderIf(productSrc === 'RelatedProduct', `
|
|
@@ -146,7 +146,7 @@ const ProductList = (props)=>{
|
|
|
146
146
|
if productSrc == 'RelatedProduct'
|
|
147
147
|
${getRelatedProduct()}
|
|
148
148
|
elsif productSrc == 'PickProduct'
|
|
149
|
-
unless ${
|
|
149
|
+
unless ${isLatestProducts}
|
|
150
150
|
assign products = null | sort
|
|
151
151
|
for handle in productHandles
|
|
152
152
|
assign productH = all_products[handle] | sort
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getUpdatedArrowDisplay } from '../../../../carousel/arrow/common/common.js';
|
|
2
1
|
import { getUpdatedDotStyle } from '../../../../carousel/dots/common/common.js';
|
|
3
2
|
import { getSizeSetting } from '../../../helpers/product.js';
|
|
4
3
|
import { convertUnitToNumber } from '../../ProductImages/common/productFeaturedImage.js';
|
|
@@ -8,7 +7,6 @@ const getData = (props)=>{
|
|
|
8
7
|
const { setting, styles } = props;
|
|
9
8
|
const productSetting = setting?.productSetting ?? {};
|
|
10
9
|
const isRelatedProduct = productSetting.productSrc === 'RelatedProduct';
|
|
11
|
-
const navigationStyle = getUpdatedArrowDisplay(setting?.arrow, setting?.controlOverContent);
|
|
12
10
|
const dotStyle = getUpdatedDotStyle(setting?.dot, setting?.dotStyle);
|
|
13
11
|
const carouselConfigSetting = {
|
|
14
12
|
dotSize: {
|
|
@@ -17,6 +15,9 @@ const getData = (props)=>{
|
|
|
17
15
|
dotGapToCarousel: {
|
|
18
16
|
desktop: 16
|
|
19
17
|
},
|
|
18
|
+
arrowIconSize: setting?.arrowIconSize ?? {
|
|
19
|
+
desktop: 24
|
|
20
|
+
},
|
|
20
21
|
...setting
|
|
21
22
|
};
|
|
22
23
|
delete carouselConfigSetting.childItem;
|
|
@@ -38,7 +39,6 @@ const getData = (props)=>{
|
|
|
38
39
|
return {
|
|
39
40
|
isRelatedProduct,
|
|
40
41
|
productSetting,
|
|
41
|
-
navigationStyle,
|
|
42
42
|
dotStyle,
|
|
43
43
|
carouselConfigSetting,
|
|
44
44
|
carouselConfigStyle
|
|
@@ -53,7 +53,7 @@ const getDataLiquid = (props)=>{
|
|
|
53
53
|
const relatedExcludeTrim = mainRelatedExclude?.split(',').map((item)=>item.trim()).toString();
|
|
54
54
|
const productSrc = productSetting?.productSrc ?? 'Collection';
|
|
55
55
|
const collectionID = productSetting?.collectionId?.replace(PREFIX_COLLECTION_ID, '') ?? 'latest';
|
|
56
|
-
const
|
|
56
|
+
const isLatestProducts = productSetting?.productSrc === 'PickProduct' && productSetting?.productIds?.length === 0;
|
|
57
57
|
const isGrid = styles?.layout === 'grid';
|
|
58
58
|
const numberOfProducts = convertUnitToNumber(setting?.numberOfProducts, 4);
|
|
59
59
|
const productListId = productSrc === 'PickProduct' && productSetting?.productIds?.length ? productSetting?.productIds.map((p)=>p.replace(PREFIX_PRODUCT_ID, '')) : [];
|
|
@@ -62,12 +62,19 @@ const getDataLiquid = (props)=>{
|
|
|
62
62
|
const sortedArray = (productSetting?.productSrc === 'Collection' || productSetting?.productSrc === 'DynamicCollection') && isSorted ? setting?.orderBy?.split('_') : 'none';
|
|
63
63
|
const sortedBy = isSorted && sortedArray?.[0] === 'TITLE' ? "| sort: 'title'" : "| sort: 'updated_at'";
|
|
64
64
|
const isReverse = sortedArray?.[sortedArray.length - 1] === 'DESC';
|
|
65
|
-
const
|
|
65
|
+
const getProductNumber = ()=>{
|
|
66
|
+
switch(productSrc){
|
|
67
|
+
case 'PickProduct':
|
|
68
|
+
return isLatestProducts ? 4 : productSetting?.numOfSelectedProducts ?? 4;
|
|
69
|
+
default:
|
|
70
|
+
return numberOfProducts;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
66
73
|
return {
|
|
67
74
|
hasRelatedExclude,
|
|
68
75
|
relatedExcludeTrim,
|
|
69
76
|
collectionID,
|
|
70
|
-
|
|
77
|
+
isLatestProducts,
|
|
71
78
|
isGrid,
|
|
72
79
|
numberOfProducts,
|
|
73
80
|
productListId,
|
|
@@ -78,7 +85,7 @@ const getDataLiquid = (props)=>{
|
|
|
78
85
|
productSetting,
|
|
79
86
|
isSorted,
|
|
80
87
|
relatedTag,
|
|
81
|
-
productNumber
|
|
88
|
+
productNumber: getProductNumber()
|
|
82
89
|
};
|
|
83
90
|
};
|
|
84
91
|
|