@gem-sdk/components 2.0.0-dev.591 → 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/cjs/tab/components/Tabs.js +3 -5
- package/dist/cjs/tab/components/Tabs.liquid.js +3 -5
- package/dist/cjs/tab/components/common/common.js +1 -1
- package/dist/cjs/tab/components/common/getClasses.js +1 -3
- package/dist/cjs/tab/components/common/getStyle.js +3 -2
- package/dist/cjs/tab/setting/Tabs.js +3 -0
- package/dist/cjs/tab/setting/configs/settings.js +38 -8
- package/dist/cjs/tab/setting/configs/uiV2.js +10 -1
- package/dist/cjs/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +1 -1
- 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/dist/esm/tab/components/Tabs.js +3 -5
- package/dist/esm/tab/components/Tabs.liquid.js +3 -5
- package/dist/esm/tab/components/common/common.js +1 -1
- package/dist/esm/tab/components/common/getClasses.js +1 -3
- package/dist/esm/tab/components/common/getStyle.js +3 -2
- package/dist/esm/tab/setting/Tabs.js +3 -0
- package/dist/esm/tab/setting/configs/settings.js +38 -8
- package/dist/esm/tab/setting/configs/uiV2.js +10 -1
- package/dist/esm/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +1 -1
- package/dist/types/index.d.ts +1 -0
- 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
|
|
|
@@ -44,11 +44,9 @@ const Tabs = (props)=>{
|
|
|
44
44
|
setting
|
|
45
45
|
})
|
|
46
46
|
});
|
|
47
|
-
const styleTagClasses =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
builderProps
|
|
51
|
-
})
|
|
47
|
+
const styleTagClasses = getClasses.getStyleTagClasses({
|
|
48
|
+
panelWidth,
|
|
49
|
+
builderProps
|
|
52
50
|
});
|
|
53
51
|
const tabParentListClasses = system.createClass({
|
|
54
52
|
...getClasses.getTabParentListClasses()
|
|
@@ -46,11 +46,9 @@ const Tabs = (props)=>{
|
|
|
46
46
|
setting
|
|
47
47
|
})
|
|
48
48
|
});
|
|
49
|
-
const styleTagClasses =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
builderProps
|
|
53
|
-
})
|
|
49
|
+
const styleTagClasses = getClasses.getStyleTagClasses({
|
|
50
|
+
panelWidth,
|
|
51
|
+
builderProps
|
|
54
52
|
});
|
|
55
53
|
const tabParentListClasses = system.createClass({
|
|
56
54
|
...getClasses.getTabParentListClasses()
|
|
@@ -5,7 +5,7 @@ var core = require('@gem-sdk/core');
|
|
|
5
5
|
const makeStyleLayoutFullWidthResponsive = (panelWidth, builderProps)=>{
|
|
6
6
|
return core.DEVICES.map((device)=>{
|
|
7
7
|
if (core.getValueByDevice(panelWidth, device) === '100%') return `.${builderProps?.uid}
|
|
8
|
-
.wrap-width_full_${device}_top_true { width: 100%; }
|
|
8
|
+
.wrap-width_full_${device}_top_true { width: 100%; } .${builderProps?.uid} .wrap-width_full_${device}_top_true .gp-tab-item { flex: 1 }`;
|
|
9
9
|
}).join('');
|
|
10
10
|
};
|
|
11
11
|
const makeDeviceDefault = (data = {})=>{
|
|
@@ -57,9 +57,7 @@ const getStyleTagClasses = ({ panelWidth, builderProps })=>{
|
|
|
57
57
|
white-space: break-spaces;
|
|
58
58
|
}`;
|
|
59
59
|
if (layoutFullWidthResponsiveClass) classList += ` ${layoutFullWidthResponsiveClass}`;
|
|
60
|
-
return
|
|
61
|
-
...core.composeClasses(classList)
|
|
62
|
-
};
|
|
60
|
+
return classList;
|
|
63
61
|
};
|
|
64
62
|
const getWrapperContentClasses = ()=>{
|
|
65
63
|
const classList = 'gp-flex gp-flex-1 gp-min-w-0';
|
|
@@ -63,9 +63,10 @@ const getItemStyle = (setting, isNotLiquid, isActive)=>{
|
|
|
63
63
|
return helpers.filterTruthyStyles(composeStyles);
|
|
64
64
|
};
|
|
65
65
|
const getTabParentListStyle = (setting)=>{
|
|
66
|
-
const { panelAlign } = setting ?? {};
|
|
66
|
+
const { panelAlign, panelAlignVertical } = setting ?? {};
|
|
67
67
|
const composeStyles = {
|
|
68
|
-
...core.makeStyleResponsive('jc', panelAlign)
|
|
68
|
+
...core.makeStyleResponsive('jc', panelAlign),
|
|
69
|
+
...core.makeStyleResponsive('ai', panelAlignVertical)
|
|
69
70
|
};
|
|
70
71
|
return helpers.filterTruthyStyles(composeStyles);
|
|
71
72
|
};
|
|
@@ -53,12 +53,6 @@ const TabsSettings = [
|
|
|
53
53
|
devices: {
|
|
54
54
|
desktop: {
|
|
55
55
|
default: 'top'
|
|
56
|
-
},
|
|
57
|
-
tablet: {
|
|
58
|
-
default: 'top'
|
|
59
|
-
},
|
|
60
|
-
mobile: {
|
|
61
|
-
default: 'top'
|
|
62
56
|
}
|
|
63
57
|
}
|
|
64
58
|
},
|
|
@@ -147,6 +141,39 @@ const TabsSettings = [
|
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
143
|
},
|
|
144
|
+
{
|
|
145
|
+
id: 'panelAlignVertical',
|
|
146
|
+
type: 'option:value',
|
|
147
|
+
label: 'Alignment',
|
|
148
|
+
options: [
|
|
149
|
+
{
|
|
150
|
+
label: 'Top',
|
|
151
|
+
value: 'start',
|
|
152
|
+
type: 'align',
|
|
153
|
+
tooltip: 'Align Top',
|
|
154
|
+
iconName: 'gp-align-top'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: 'Center',
|
|
158
|
+
value: 'center',
|
|
159
|
+
type: 'align',
|
|
160
|
+
tooltip: 'Align center',
|
|
161
|
+
iconName: 'gp-align-center'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: 'Bottom',
|
|
165
|
+
value: 'end',
|
|
166
|
+
type: 'align',
|
|
167
|
+
tooltip: 'Align Bottom',
|
|
168
|
+
iconName: 'gp-align-bottom'
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
devices: {
|
|
172
|
+
desktop: {
|
|
173
|
+
default: 'start'
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
150
177
|
{
|
|
151
178
|
id: 'labelWidth',
|
|
152
179
|
label: 'Width',
|
|
@@ -163,7 +190,10 @@ const TabsSettings = [
|
|
|
163
190
|
},
|
|
164
191
|
{
|
|
165
192
|
id: 'padding',
|
|
166
|
-
type: 'padding-v2'
|
|
193
|
+
type: 'padding-v2',
|
|
194
|
+
devices: {
|
|
195
|
+
desktop: {}
|
|
196
|
+
}
|
|
167
197
|
},
|
|
168
198
|
{
|
|
169
199
|
id: 'labelAlign',
|
|
@@ -322,7 +352,7 @@ const TabsSettings = [
|
|
|
322
352
|
],
|
|
323
353
|
devices: {
|
|
324
354
|
desktop: {
|
|
325
|
-
default: '
|
|
355
|
+
default: '100%'
|
|
326
356
|
}
|
|
327
357
|
}
|
|
328
358
|
},
|
|
@@ -150,7 +150,7 @@ const SettingUIV2 = [
|
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
conditionDisplay: 'labelWidth != "100%"',
|
|
153
|
+
conditionDisplay: 'position == "top" && labelWidth != "100%"',
|
|
154
154
|
label: {
|
|
155
155
|
en: 'Tabs align'
|
|
156
156
|
},
|
|
@@ -158,6 +158,15 @@ const SettingUIV2 = [
|
|
|
158
158
|
id: 'panelAlign'
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
|
+
{
|
|
162
|
+
conditionDisplay: 'position != "top" && labelWidth != "100%"',
|
|
163
|
+
label: {
|
|
164
|
+
en: 'Tabs align'
|
|
165
|
+
},
|
|
166
|
+
setting: {
|
|
167
|
+
id: 'panelAlignVertical'
|
|
168
|
+
}
|
|
169
|
+
},
|
|
161
170
|
{
|
|
162
171
|
label: {
|
|
163
172
|
en: 'Hover effect'
|
|
@@ -114,7 +114,7 @@ const HTML5Embed = (props)=>{
|
|
|
114
114
|
class="${videoYoutubeClasses}"
|
|
115
115
|
${controls ? 'controls' : undefined}
|
|
116
116
|
${loop ? 'loop' : undefined}
|
|
117
|
-
${
|
|
117
|
+
${muted ? 'muted' : undefined}
|
|
118
118
|
${autoplay ? 'autoplay' : undefined}
|
|
119
119
|
playsinline
|
|
120
120
|
src="${srcUnLazyVideo}"
|
|
@@ -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
|
|
|
@@ -40,11 +40,9 @@ const Tabs = (props)=>{
|
|
|
40
40
|
setting
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
|
-
const styleTagClasses =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
builderProps
|
|
47
|
-
})
|
|
43
|
+
const styleTagClasses = getStyleTagClasses({
|
|
44
|
+
panelWidth,
|
|
45
|
+
builderProps
|
|
48
46
|
});
|
|
49
47
|
const tabParentListClasses = createClass({
|
|
50
48
|
...getTabParentListClasses()
|
|
@@ -42,11 +42,9 @@ const Tabs = (props)=>{
|
|
|
42
42
|
setting
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
|
-
const styleTagClasses =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
builderProps
|
|
49
|
-
})
|
|
45
|
+
const styleTagClasses = getStyleTagClasses({
|
|
46
|
+
panelWidth,
|
|
47
|
+
builderProps
|
|
50
48
|
});
|
|
51
49
|
const tabParentListClasses = createClass({
|
|
52
50
|
...getTabParentListClasses()
|
|
@@ -3,7 +3,7 @@ import { DEVICES, getValueByDevice } from '@gem-sdk/core';
|
|
|
3
3
|
const makeStyleLayoutFullWidthResponsive = (panelWidth, builderProps)=>{
|
|
4
4
|
return DEVICES.map((device)=>{
|
|
5
5
|
if (getValueByDevice(panelWidth, device) === '100%') return `.${builderProps?.uid}
|
|
6
|
-
.wrap-width_full_${device}_top_true { width: 100%; }
|
|
6
|
+
.wrap-width_full_${device}_top_true { width: 100%; } .${builderProps?.uid} .wrap-width_full_${device}_top_true .gp-tab-item { flex: 1 }`;
|
|
7
7
|
}).join('');
|
|
8
8
|
};
|
|
9
9
|
const makeDeviceDefault = (data = {})=>{
|
|
@@ -55,9 +55,7 @@ const getStyleTagClasses = ({ panelWidth, builderProps })=>{
|
|
|
55
55
|
white-space: break-spaces;
|
|
56
56
|
}`;
|
|
57
57
|
if (layoutFullWidthResponsiveClass) classList += ` ${layoutFullWidthResponsiveClass}`;
|
|
58
|
-
return
|
|
59
|
-
...composeClasses(classList)
|
|
60
|
-
};
|
|
58
|
+
return classList;
|
|
61
59
|
};
|
|
62
60
|
const getWrapperContentClasses = ()=>{
|
|
63
61
|
const classList = 'gp-flex gp-flex-1 gp-min-w-0';
|
|
@@ -61,9 +61,10 @@ const getItemStyle = (setting, isNotLiquid, isActive)=>{
|
|
|
61
61
|
return filterTruthyStyles(composeStyles);
|
|
62
62
|
};
|
|
63
63
|
const getTabParentListStyle = (setting)=>{
|
|
64
|
-
const { panelAlign } = setting ?? {};
|
|
64
|
+
const { panelAlign, panelAlignVertical } = setting ?? {};
|
|
65
65
|
const composeStyles = {
|
|
66
|
-
...makeStyleResponsive('jc', panelAlign)
|
|
66
|
+
...makeStyleResponsive('jc', panelAlign),
|
|
67
|
+
...makeStyleResponsive('ai', panelAlignVertical)
|
|
67
68
|
};
|
|
68
69
|
return filterTruthyStyles(composeStyles);
|
|
69
70
|
};
|
|
@@ -51,12 +51,6 @@ const TabsSettings = [
|
|
|
51
51
|
devices: {
|
|
52
52
|
desktop: {
|
|
53
53
|
default: 'top'
|
|
54
|
-
},
|
|
55
|
-
tablet: {
|
|
56
|
-
default: 'top'
|
|
57
|
-
},
|
|
58
|
-
mobile: {
|
|
59
|
-
default: 'top'
|
|
60
54
|
}
|
|
61
55
|
}
|
|
62
56
|
},
|
|
@@ -145,6 +139,39 @@ const TabsSettings = [
|
|
|
145
139
|
}
|
|
146
140
|
}
|
|
147
141
|
},
|
|
142
|
+
{
|
|
143
|
+
id: 'panelAlignVertical',
|
|
144
|
+
type: 'option:value',
|
|
145
|
+
label: 'Alignment',
|
|
146
|
+
options: [
|
|
147
|
+
{
|
|
148
|
+
label: 'Top',
|
|
149
|
+
value: 'start',
|
|
150
|
+
type: 'align',
|
|
151
|
+
tooltip: 'Align Top',
|
|
152
|
+
iconName: 'gp-align-top'
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'Center',
|
|
156
|
+
value: 'center',
|
|
157
|
+
type: 'align',
|
|
158
|
+
tooltip: 'Align center',
|
|
159
|
+
iconName: 'gp-align-center'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: 'Bottom',
|
|
163
|
+
value: 'end',
|
|
164
|
+
type: 'align',
|
|
165
|
+
tooltip: 'Align Bottom',
|
|
166
|
+
iconName: 'gp-align-bottom'
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
devices: {
|
|
170
|
+
desktop: {
|
|
171
|
+
default: 'start'
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
148
175
|
{
|
|
149
176
|
id: 'labelWidth',
|
|
150
177
|
label: 'Width',
|
|
@@ -161,7 +188,10 @@ const TabsSettings = [
|
|
|
161
188
|
},
|
|
162
189
|
{
|
|
163
190
|
id: 'padding',
|
|
164
|
-
type: 'padding-v2'
|
|
191
|
+
type: 'padding-v2',
|
|
192
|
+
devices: {
|
|
193
|
+
desktop: {}
|
|
194
|
+
}
|
|
165
195
|
},
|
|
166
196
|
{
|
|
167
197
|
id: 'labelAlign',
|
|
@@ -320,7 +350,7 @@ const TabsSettings = [
|
|
|
320
350
|
],
|
|
321
351
|
devices: {
|
|
322
352
|
desktop: {
|
|
323
|
-
default: '
|
|
353
|
+
default: '100%'
|
|
324
354
|
}
|
|
325
355
|
}
|
|
326
356
|
},
|
|
@@ -148,7 +148,7 @@ const SettingUIV2 = [
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
|
-
conditionDisplay: 'labelWidth != "100%"',
|
|
151
|
+
conditionDisplay: 'position == "top" && labelWidth != "100%"',
|
|
152
152
|
label: {
|
|
153
153
|
en: 'Tabs align'
|
|
154
154
|
},
|
|
@@ -156,6 +156,15 @@ const SettingUIV2 = [
|
|
|
156
156
|
id: 'panelAlign'
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
+
{
|
|
160
|
+
conditionDisplay: 'position != "top" && labelWidth != "100%"',
|
|
161
|
+
label: {
|
|
162
|
+
en: 'Tabs align'
|
|
163
|
+
},
|
|
164
|
+
setting: {
|
|
165
|
+
id: 'panelAlignVertical'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
159
168
|
{
|
|
160
169
|
label: {
|
|
161
170
|
en: 'Hover effect'
|
|
@@ -110,7 +110,7 @@ const HTML5Embed = (props)=>{
|
|
|
110
110
|
class="${videoYoutubeClasses}"
|
|
111
111
|
${controls ? 'controls' : undefined}
|
|
112
112
|
${loop ? 'loop' : undefined}
|
|
113
|
-
${
|
|
113
|
+
${muted ? 'muted' : undefined}
|
|
114
114
|
${autoplay ? 'autoplay' : undefined}
|
|
115
115
|
playsinline
|
|
116
116
|
src="${srcUnLazyVideo}"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4244,6 +4244,7 @@ type TabsProps = BasePropsWrap<{
|
|
|
4244
4244
|
panelFullWidth?: ObjectDevices$1<boolean>;
|
|
4245
4245
|
panelWidth?: ObjectDevices$1<string>;
|
|
4246
4246
|
panelAlign?: ObjectDevices$1<AlignProp>;
|
|
4247
|
+
panelAlignVertical?: ObjectDevices$1<string>;
|
|
4247
4248
|
labelAlign?: ObjectDevices$1<AlignProp>;
|
|
4248
4249
|
align?: ObjectDevices$1<any>;
|
|
4249
4250
|
labelWidth?: ObjectDevices$1<string>;
|