@gem-sdk/components 2.0.0-dev.533 → 2.0.0-dev.535
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/collection/components/collection-description/common/index.js +0 -2
- package/dist/cjs/collection/components/collection-description/common/styles.js +4 -4
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.js +5 -5
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.liquid.js +6 -9
- package/dist/cjs/collection/components/collection-paginator/common/index.js +2 -1
- package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +4 -9
- package/dist/cjs/collection/setting/collection-banner/configs/settings.js +38 -35
- package/dist/cjs/collection/setting/collection-banner/configs/uiV2.js +47 -43
- package/dist/cjs/collection/setting/collection-description/configs/uiV2.js +38 -4
- package/dist/cjs/collection/setting/collection-paginator/configs/settings.js +7 -3
- package/dist/cjs/collection/setting/collection-paginator/configs/uiV2.js +64 -31
- package/dist/cjs/collection/setting/collection-toolbar/configs/settings.js +2 -2
- package/dist/cjs/collection/setting/collection-toolbar/configs/uiV2.js +1 -1
- package/dist/cjs/estimate-delivery/components/EstimateDate.js +23 -58
- package/dist/cjs/estimate-delivery/components/common/getAdvanced.js +10 -0
- package/dist/cjs/estimate-delivery/components/common/getNewSetting.js +86 -0
- package/dist/cjs/estimate-delivery/components/common/getStyle.js +10 -0
- package/dist/cjs/estimate-delivery/index.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/settings.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/uiV1.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/uiV2.js +1 -1
- package/dist/cjs/index.liquid.js +6 -5
- package/dist/cjs/tab/components/Tabs.js +0 -4
- package/dist/cjs/tab/components/common/getStyle.js +4 -11
- package/dist/cjs/tab/setting/Tabs.js +2 -1
- package/dist/cjs/tab/setting/configs/settings.js +62 -14
- package/dist/cjs/tab/setting/configs/uiV2.js +15 -2
- package/dist/cjs/text/components/TextInline.js +10 -11
- package/dist/cjs/text/components/common/getClasses.js +8 -4
- package/dist/cjs/text/components/common/getStyle.js +9 -0
- package/dist/esm/collection/components/collection-description/common/index.js +1 -2
- package/dist/esm/collection/components/collection-description/common/styles.js +5 -5
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.js +7 -7
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.liquid.js +7 -10
- package/dist/esm/collection/components/collection-paginator/common/index.js +2 -1
- package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +4 -9
- package/dist/esm/collection/setting/collection-banner/configs/settings.js +38 -35
- package/dist/esm/collection/setting/collection-banner/configs/uiV2.js +47 -43
- package/dist/esm/collection/setting/collection-description/configs/uiV2.js +38 -4
- package/dist/esm/collection/setting/collection-paginator/configs/settings.js +7 -3
- package/dist/esm/collection/setting/collection-paginator/configs/uiV2.js +64 -31
- package/dist/esm/collection/setting/collection-toolbar/configs/settings.js +2 -2
- package/dist/esm/collection/setting/collection-toolbar/configs/uiV2.js +1 -1
- package/dist/esm/estimate-delivery/components/EstimateDate.js +23 -58
- package/dist/esm/estimate-delivery/components/common/getAdvanced.js +8 -0
- package/dist/esm/estimate-delivery/components/common/getNewSetting.js +84 -0
- package/dist/esm/estimate-delivery/components/common/getStyle.js +8 -0
- package/dist/esm/estimate-delivery/index.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/settings.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/uiV1.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/uiV2.js +1 -1
- package/dist/esm/index.liquid.js +5 -4
- package/dist/esm/tab/components/Tabs.js +1 -5
- package/dist/esm/tab/components/common/getStyle.js +5 -11
- package/dist/esm/tab/setting/Tabs.js +2 -1
- package/dist/esm/tab/setting/configs/settings.js +62 -14
- package/dist/esm/tab/setting/configs/uiV2.js +15 -2
- package/dist/esm/text/components/TextInline.js +11 -12
- package/dist/esm/text/components/common/getClasses.js +8 -5
- package/dist/esm/text/components/common/getStyle.js +9 -1
- package/dist/types/index.d.ts +43 -7
- package/package.json +2 -2
- /package/dist/cjs/estimate-delivery/{const.js → components/common/const.js} +0 -0
- /package/dist/esm/estimate-delivery/{const.js → components/common/const.js} +0 -0
|
@@ -4,74 +4,39 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var
|
|
7
|
+
var getNewSetting = require('./common/getNewSetting.js');
|
|
8
|
+
var system = require('@gem-sdk/system');
|
|
9
|
+
var getAdvanced = require('./common/getAdvanced.js');
|
|
8
10
|
var Text = require('../../text/components/Text.js');
|
|
9
|
-
var _const = require('../const.js');
|
|
10
|
-
var TextInline = require('../../text/components/TextInline.js');
|
|
11
11
|
|
|
12
12
|
const EstimateDate = ({ setting, styles, builderAttrs, style, builderProps, advanced, children })=>{
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default:
|
|
28
|
-
return 'div';
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
31
|
-
setting?.htmlTag
|
|
32
|
-
]);
|
|
33
|
-
const getDayEst = ()=>{
|
|
34
|
-
const currentDay = new Date(Date.now());
|
|
35
|
-
const settingTypeFormat = setting?.typeFormat === 'Custom' ? setting?.customFormat : setting?.typeFormat;
|
|
36
|
-
if (!settingTypeFormat) return '';
|
|
37
|
-
if (setting?.typeEstimate === _const.ESTIMATE_DAYS.SPECIFIC) {
|
|
38
|
-
const text = `${_const.getDayFormat(_const.getFutureDay(Number(setting?.estimateTime)), settingTypeFormat)}`;
|
|
39
|
-
return text;
|
|
40
|
-
}
|
|
41
|
-
_const.getDayFormat(currentDay);
|
|
42
|
-
const text = `${_const.getDayFormat(_const.getFutureDay(Number(setting?.minEstimate)), settingTypeFormat)} - ${_const.getDayFormat(_const.getFutureDay(Number(setting?.maxEstimate)), settingTypeFormat)}`;
|
|
43
|
-
return text;
|
|
44
|
-
};
|
|
13
|
+
const wrapperClasses = system.createClass({
|
|
14
|
+
'estimate-date-container': true
|
|
15
|
+
});
|
|
16
|
+
const advancedClass = getAdvanced.getClassAdvanced({
|
|
17
|
+
setting,
|
|
18
|
+
advanced,
|
|
19
|
+
type: 'React'
|
|
20
|
+
});
|
|
21
|
+
const newSetting = getNewSetting.getNewSetting({
|
|
22
|
+
type: 'React',
|
|
23
|
+
styles,
|
|
24
|
+
setting,
|
|
25
|
+
builderProps
|
|
26
|
+
});
|
|
45
27
|
return /*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
46
28
|
builderProps: builderProps,
|
|
47
29
|
builderAttrs: builderAttrs,
|
|
48
|
-
advanced:
|
|
30
|
+
advanced: {
|
|
31
|
+
...advanced,
|
|
32
|
+
cssClass: advancedClass
|
|
33
|
+
},
|
|
49
34
|
style: style,
|
|
50
35
|
styles: {
|
|
51
36
|
align: styles?.align
|
|
52
37
|
},
|
|
53
|
-
setting:
|
|
54
|
-
|
|
55
|
-
styles: {
|
|
56
|
-
align: styles?.align,
|
|
57
|
-
typo: styles?.typoCustom
|
|
58
|
-
},
|
|
59
|
-
setting: {
|
|
60
|
-
text: setting?.customText
|
|
61
|
-
}
|
|
62
|
-
}) : ''} ${TextInline.default({
|
|
63
|
-
styles: {
|
|
64
|
-
align: styles?.align,
|
|
65
|
-
typo: styles?.typoDate
|
|
66
|
-
},
|
|
67
|
-
setting: {
|
|
68
|
-
text: getDayEst()
|
|
69
|
-
}
|
|
70
|
-
})}`,
|
|
71
|
-
htmlTag: headingLevel,
|
|
72
|
-
globalSize: setting?.globalSize,
|
|
73
|
-
background: setting?.background
|
|
74
|
-
},
|
|
38
|
+
setting: newSetting,
|
|
39
|
+
className: wrapperClasses,
|
|
75
40
|
children: children
|
|
76
41
|
});
|
|
77
42
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _const = require('./const.js');
|
|
4
|
+
|
|
5
|
+
const getClassAdvanced = ({ setting, advanced, type })=>{
|
|
6
|
+
const conditionRenderClassHiddenLiquid = type === 'Liquid' && setting?.ifOutOfStock === _const.OUT_OF_STOCK.HIDE;
|
|
7
|
+
return `${conditionRenderClassHiddenLiquid && '{% if product %} !gp-hidden trigger-hidden-class {% endif %}'} ${advanced?.cssClass}`;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.getClassAdvanced = getClassAdvanced;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var TextInline = require('../../../text/components/TextInline.js');
|
|
4
|
+
var helpers = require('../../../helpers.js');
|
|
5
|
+
var _const = require('./const.js');
|
|
6
|
+
var system = require('@gem-sdk/system');
|
|
7
|
+
var getStyle = require('./getStyle.js');
|
|
8
|
+
|
|
9
|
+
const getDayEst = (setting)=>{
|
|
10
|
+
const currentDay = new Date(Date.now());
|
|
11
|
+
const settingTypeFormat = setting?.typeFormat === 'Custom' ? setting?.customFormat : setting?.typeFormat;
|
|
12
|
+
if (!settingTypeFormat) return '';
|
|
13
|
+
if (setting?.typeEstimate === _const.ESTIMATE_DAYS.SPECIFIC) {
|
|
14
|
+
const text = `${_const.getDayFormat(_const.getFutureDay(Number(setting?.estimateTime)), settingTypeFormat)}`;
|
|
15
|
+
return text;
|
|
16
|
+
}
|
|
17
|
+
_const.getDayFormat(currentDay);
|
|
18
|
+
const text = `${_const.getDayFormat(_const.getFutureDay(Number(setting?.minEstimate)), settingTypeFormat)} - ${_const.getDayFormat(_const.getFutureDay(Number(setting?.maxEstimate)), settingTypeFormat)}`;
|
|
19
|
+
return text;
|
|
20
|
+
};
|
|
21
|
+
const EstimateDateLevel = (setting)=>{
|
|
22
|
+
switch(setting?.htmlTag){
|
|
23
|
+
case 1:
|
|
24
|
+
return 'h1';
|
|
25
|
+
case 2:
|
|
26
|
+
return 'h2';
|
|
27
|
+
case 3:
|
|
28
|
+
return 'h3';
|
|
29
|
+
case 4:
|
|
30
|
+
return 'h4';
|
|
31
|
+
case 5:
|
|
32
|
+
return 'h5';
|
|
33
|
+
case 6:
|
|
34
|
+
return 'h6';
|
|
35
|
+
default:
|
|
36
|
+
return 'div';
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const getNewSetting = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
40
|
+
const isReact = type === 'React';
|
|
41
|
+
const textContent = getTextContent({
|
|
42
|
+
type,
|
|
43
|
+
styles,
|
|
44
|
+
setting,
|
|
45
|
+
builderProps,
|
|
46
|
+
pageContext
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
text: textContent,
|
|
50
|
+
htmlTag: EstimateDateLevel(setting),
|
|
51
|
+
globalSize: setting?.globalSize,
|
|
52
|
+
background: setting?.background,
|
|
53
|
+
...!isReact && {
|
|
54
|
+
translate: setting?.translate,
|
|
55
|
+
isForceValue: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const getTextContent = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
60
|
+
const isReact = type === 'React';
|
|
61
|
+
const estimateClasses = system.createClass({
|
|
62
|
+
'estimate-date-main': true
|
|
63
|
+
});
|
|
64
|
+
const textWithTranslate = isReact ? setting?.customText : helpers.getDynamicSourceLocales({
|
|
65
|
+
val: setting?.customText,
|
|
66
|
+
uid: builderProps?.uid,
|
|
67
|
+
settingId: setting?.translate || '',
|
|
68
|
+
pageContext,
|
|
69
|
+
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
|
|
70
|
+
translate: setting?.translate
|
|
71
|
+
}).toString();
|
|
72
|
+
return `${TextInline.default({
|
|
73
|
+
styles: getStyle.getStyleEstimateDate(styles, 'typoCustom'),
|
|
74
|
+
setting: {
|
|
75
|
+
text: textWithTranslate
|
|
76
|
+
}
|
|
77
|
+
})} ${TextInline.default({
|
|
78
|
+
styles: getStyle.getStyleEstimateDate(styles, 'typoDate'),
|
|
79
|
+
setting: {
|
|
80
|
+
text: getDayEst(setting)
|
|
81
|
+
},
|
|
82
|
+
className: estimateClasses
|
|
83
|
+
})}`;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.getNewSetting = getNewSetting;
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -30,10 +30,6 @@ var Countdown_liquid = require('./countdown-timer/components/Countdown.liquid.js
|
|
|
30
30
|
var Coupon_liquid = require('./coupon/components/Coupon.liquid.js');
|
|
31
31
|
var Dialog_liquid = require('./dialog/components/Dialog.liquid.js');
|
|
32
32
|
require('@gem-sdk/core');
|
|
33
|
-
var Text_liquid = require('./text/components/Text.liquid.js');
|
|
34
|
-
require('react/jsx-runtime');
|
|
35
|
-
require('react');
|
|
36
|
-
require('next/link');
|
|
37
33
|
var Col_liquid = require('./grid/col/Col.liquid.js');
|
|
38
34
|
var Row_liquid = require('./grid/row/Row.liquid.js');
|
|
39
35
|
var Section_liquid = require('./grid/section/Section.liquid.js');
|
|
@@ -59,6 +55,7 @@ var ImageComparison_liquid = require('./image-comparison/components/ImageCompari
|
|
|
59
55
|
var Line_liquid = require('./line/components/Line.liquid.js');
|
|
60
56
|
var MarqueeItem_liquid = require('./marquee/components/MarqueeItem.liquid.js');
|
|
61
57
|
var Marquee_liquid = require('./marquee/components/Marquee.liquid.js');
|
|
58
|
+
var Text_liquid = require('./text/components/Text.liquid.js');
|
|
62
59
|
var DynamicCheckout_liquid = require('./product/components/DynamicCheckout/DynamicCheckout.liquid.js');
|
|
63
60
|
var UploadFile_liquid = require('./product/components/FileUpload/components/UploadFile.liquid.js');
|
|
64
61
|
var Product_liquid = require('./product/components/ProductWrap/Product.liquid.js');
|
|
@@ -201,6 +198,10 @@ var StellarDeliveryDatePickup_liquid = require('./third-party/components/Stellar
|
|
|
201
198
|
var ThirdPartySlot_liquid = require('./third-party-slot/components/ThirdPartySlot.liquid.js');
|
|
202
199
|
var ShopPayInstallments_liquid = require('./shop-pay-installment/components/ShopPayInstallments.liquid.js');
|
|
203
200
|
var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
|
|
201
|
+
require('react/jsx-runtime');
|
|
202
|
+
require('react');
|
|
203
|
+
require('next/link');
|
|
204
|
+
require('@gem-sdk/system');
|
|
204
205
|
|
|
205
206
|
|
|
206
207
|
|
|
@@ -232,7 +233,6 @@ exports.CollectionBanner = CollectionBanner_liquid.default;
|
|
|
232
233
|
exports.Countdown = Countdown_liquid.default;
|
|
233
234
|
exports.Coupon = Coupon_liquid.default;
|
|
234
235
|
exports.Dialog = Dialog_liquid.default;
|
|
235
|
-
exports.Text = Text_liquid.default;
|
|
236
236
|
exports.Col = Col_liquid.default;
|
|
237
237
|
exports.Row = Row_liquid.default;
|
|
238
238
|
exports.Section = Section_liquid.default;
|
|
@@ -258,6 +258,7 @@ exports.ImageComparison = ImageComparison_liquid.default;
|
|
|
258
258
|
exports.Line = Line_liquid.default;
|
|
259
259
|
exports.MarqueeItem = MarqueeItem_liquid.default;
|
|
260
260
|
exports.Marquee = Marquee_liquid.default;
|
|
261
|
+
exports.Text = Text_liquid.default;
|
|
261
262
|
exports.DynamicCheckout = DynamicCheckout_liquid.default;
|
|
262
263
|
exports.FileUpload = UploadFile_liquid.default;
|
|
263
264
|
exports.Product = Product_liquid.default;
|
|
@@ -33,9 +33,6 @@ const Tabs = (props)=>{
|
|
|
33
33
|
const wrapperStyle = system.createStyle({
|
|
34
34
|
...getStyle.getStyleWrapper(setting, style)
|
|
35
35
|
});
|
|
36
|
-
const containStyle = system.createStyle({
|
|
37
|
-
...getStyle.getContainStyle(setting)
|
|
38
|
-
});
|
|
39
36
|
const wrapperClasses = system.createClass({
|
|
40
37
|
...getClasses.getClassesWrapper({
|
|
41
38
|
builderProps,
|
|
@@ -152,7 +149,6 @@ const Tabs = (props)=>{
|
|
|
152
149
|
}),
|
|
153
150
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
154
151
|
className: containClasses,
|
|
155
|
-
style: containStyle,
|
|
156
152
|
children: [
|
|
157
153
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
158
154
|
className: tabParentListClasses,
|
|
@@ -5,7 +5,7 @@ var helpers = require('../../../helpers.js');
|
|
|
5
5
|
var common = require('./common.js');
|
|
6
6
|
|
|
7
7
|
const getStyleWrapper = (setting, style)=>{
|
|
8
|
-
const { background } = setting ?? {};
|
|
8
|
+
const { background, containWidth, align } = setting ?? {};
|
|
9
9
|
const composeStyles = {
|
|
10
10
|
...style,
|
|
11
11
|
...core.getStyleBackgroundByDevice(background),
|
|
@@ -13,15 +13,9 @@ const getStyleWrapper = (setting, style)=>{
|
|
|
13
13
|
desktop: true,
|
|
14
14
|
tablet: true,
|
|
15
15
|
mobile: true
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
const getContainStyle = (setting)=>{
|
|
21
|
-
const { containWidth, align } = setting ?? {};
|
|
22
|
-
const composeStyles = {
|
|
23
|
-
...core.makeStyleResponsive('js', align),
|
|
24
|
-
...core.makeStyleResponsive('w', core.makeWidth(containWidth))
|
|
16
|
+
}),
|
|
17
|
+
...core.makeStyleResponsive('w', core.makeWidth(containWidth)),
|
|
18
|
+
...core.makeStyleResponsive('as', align)
|
|
25
19
|
};
|
|
26
20
|
return helpers.filterTruthyStyles(composeStyles);
|
|
27
21
|
};
|
|
@@ -98,7 +92,6 @@ const getTabItemStyle = (style)=>{
|
|
|
98
92
|
};
|
|
99
93
|
|
|
100
94
|
exports.getContainContentStyle = getContainContentStyle;
|
|
101
|
-
exports.getContainStyle = getContainStyle;
|
|
102
95
|
exports.getItemStyle = getItemStyle;
|
|
103
96
|
exports.getStyleWrapper = getStyleWrapper;
|
|
104
97
|
exports.getTabItemStyle = getTabItemStyle;
|
|
@@ -10,7 +10,8 @@ const TabsSettings = [
|
|
|
10
10
|
type: 'child-item',
|
|
11
11
|
default: [
|
|
12
12
|
'Tab 1',
|
|
13
|
-
'Tab 2'
|
|
13
|
+
'Tab 2',
|
|
14
|
+
'Tab 3'
|
|
14
15
|
],
|
|
15
16
|
expandItem: true
|
|
16
17
|
},
|
|
@@ -71,7 +72,10 @@ const TabsSettings = [
|
|
|
71
72
|
id: 'labelTypoV2',
|
|
72
73
|
type: 'typography-v2',
|
|
73
74
|
default: {
|
|
74
|
-
type: 'paragraph-1'
|
|
75
|
+
type: 'paragraph-1',
|
|
76
|
+
attrs: {
|
|
77
|
+
color: 'text-1'
|
|
78
|
+
}
|
|
75
79
|
},
|
|
76
80
|
hiddenSetting: {
|
|
77
81
|
},
|
|
@@ -150,10 +154,7 @@ const TabsSettings = [
|
|
|
150
154
|
},
|
|
151
155
|
{
|
|
152
156
|
id: 'padding',
|
|
153
|
-
type: 'padding-v2'
|
|
154
|
-
devices: {
|
|
155
|
-
desktop: {}
|
|
156
|
-
}
|
|
157
|
+
type: 'padding-v2'
|
|
157
158
|
},
|
|
158
159
|
{
|
|
159
160
|
id: 'labelAlign',
|
|
@@ -184,6 +185,18 @@ const TabsSettings = [
|
|
|
184
185
|
}
|
|
185
186
|
]
|
|
186
187
|
},
|
|
188
|
+
{
|
|
189
|
+
id: 'enableHoverEffect',
|
|
190
|
+
label: '',
|
|
191
|
+
type: 'toggle',
|
|
192
|
+
default: false
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'enableActiveEffect',
|
|
196
|
+
label: '',
|
|
197
|
+
type: 'toggle',
|
|
198
|
+
default: false
|
|
199
|
+
},
|
|
187
200
|
{
|
|
188
201
|
id: 'behavior-state-group',
|
|
189
202
|
type: 'behavior-state',
|
|
@@ -199,6 +212,10 @@ const TabsSettings = [
|
|
|
199
212
|
normal: true,
|
|
200
213
|
hover: true,
|
|
201
214
|
active: true
|
|
215
|
+
},
|
|
216
|
+
compoDefaultValue: {
|
|
217
|
+
normal: 'bg-2',
|
|
218
|
+
hover: 'bg-2'
|
|
202
219
|
}
|
|
203
220
|
},
|
|
204
221
|
{
|
|
@@ -206,12 +223,17 @@ const TabsSettings = [
|
|
|
206
223
|
label: 'Text Color',
|
|
207
224
|
type: 'color-picker-v2',
|
|
208
225
|
default: {
|
|
209
|
-
normal: '
|
|
226
|
+
normal: 'text-1'
|
|
210
227
|
},
|
|
211
228
|
state: {
|
|
212
229
|
normal: true,
|
|
213
230
|
hover: true,
|
|
214
231
|
active: true
|
|
232
|
+
},
|
|
233
|
+
compoDefaultValue: {
|
|
234
|
+
normal: 'text-1',
|
|
235
|
+
hover: 'text-1',
|
|
236
|
+
active: 'text-1'
|
|
215
237
|
}
|
|
216
238
|
},
|
|
217
239
|
{
|
|
@@ -223,7 +245,7 @@ const TabsSettings = [
|
|
|
223
245
|
border: 'none',
|
|
224
246
|
width: '1px 1px 1px 1px',
|
|
225
247
|
borderWidth: '1px',
|
|
226
|
-
color: '#
|
|
248
|
+
color: '#7D7D7D',
|
|
227
249
|
isCustom: false,
|
|
228
250
|
position: 'all'
|
|
229
251
|
},
|
|
@@ -231,7 +253,7 @@ const TabsSettings = [
|
|
|
231
253
|
border: 'none',
|
|
232
254
|
width: '1px 1px 1px 1px',
|
|
233
255
|
borderWidth: '1px',
|
|
234
|
-
color: '
|
|
256
|
+
color: 'line-2',
|
|
235
257
|
isCustom: false,
|
|
236
258
|
position: 'all'
|
|
237
259
|
},
|
|
@@ -239,7 +261,7 @@ const TabsSettings = [
|
|
|
239
261
|
border: 'solid',
|
|
240
262
|
width: '0px 0px 2px 0px',
|
|
241
263
|
borderWidth: '2px',
|
|
242
|
-
color: '
|
|
264
|
+
color: 'line-2',
|
|
243
265
|
position: 'bottom',
|
|
244
266
|
isCustom: true
|
|
245
267
|
}
|
|
@@ -248,6 +270,32 @@ const TabsSettings = [
|
|
|
248
270
|
hover: true,
|
|
249
271
|
normal: true,
|
|
250
272
|
active: true
|
|
273
|
+
},
|
|
274
|
+
compoDefaultValue: {
|
|
275
|
+
normal: {
|
|
276
|
+
border: 'solid',
|
|
277
|
+
width: '1px 1px 1px 1px',
|
|
278
|
+
borderWidth: '1px',
|
|
279
|
+
color: '#7D7D7D',
|
|
280
|
+
isCustom: false,
|
|
281
|
+
position: 'all'
|
|
282
|
+
},
|
|
283
|
+
hover: {
|
|
284
|
+
border: 'solid',
|
|
285
|
+
width: '1px 1px 1px 1px',
|
|
286
|
+
borderWidth: '1px',
|
|
287
|
+
color: 'line-2',
|
|
288
|
+
isCustom: false,
|
|
289
|
+
position: 'all'
|
|
290
|
+
},
|
|
291
|
+
active: {
|
|
292
|
+
border: 'solid',
|
|
293
|
+
width: '1px 1px 1px 1px',
|
|
294
|
+
borderWidth: '1px',
|
|
295
|
+
color: 'line-1',
|
|
296
|
+
isCustom: false,
|
|
297
|
+
position: 'all'
|
|
298
|
+
}
|
|
251
299
|
}
|
|
252
300
|
}
|
|
253
301
|
]
|
|
@@ -262,7 +310,7 @@ const TabsSettings = [
|
|
|
262
310
|
],
|
|
263
311
|
devices: {
|
|
264
312
|
desktop: {
|
|
265
|
-
default: '
|
|
313
|
+
default: '1200px'
|
|
266
314
|
}
|
|
267
315
|
}
|
|
268
316
|
},
|
|
@@ -318,7 +366,7 @@ const TabsSettings = [
|
|
|
318
366
|
options: [
|
|
319
367
|
{
|
|
320
368
|
label: 'Left',
|
|
321
|
-
value: '
|
|
369
|
+
value: 'start',
|
|
322
370
|
type: 'align',
|
|
323
371
|
tooltip: 'Align left',
|
|
324
372
|
iconName: 'gp-align-left'
|
|
@@ -332,7 +380,7 @@ const TabsSettings = [
|
|
|
332
380
|
},
|
|
333
381
|
{
|
|
334
382
|
label: 'Right',
|
|
335
|
-
value: '
|
|
383
|
+
value: 'end',
|
|
336
384
|
type: 'align',
|
|
337
385
|
tooltip: 'Align right',
|
|
338
386
|
iconName: 'gp-align-right'
|
|
@@ -340,7 +388,7 @@ const TabsSettings = [
|
|
|
340
388
|
],
|
|
341
389
|
devices: {
|
|
342
390
|
desktop: {
|
|
343
|
-
default: '
|
|
391
|
+
default: 'center'
|
|
344
392
|
}
|
|
345
393
|
}
|
|
346
394
|
}
|
|
@@ -164,7 +164,9 @@ const SettingUIV2 = [
|
|
|
164
164
|
type: 'combo',
|
|
165
165
|
iconName: 'polaris-edit',
|
|
166
166
|
fixedValue: 'Enabled',
|
|
167
|
-
|
|
167
|
+
setting: {
|
|
168
|
+
id: 'enableHoverEffect'
|
|
169
|
+
},
|
|
168
170
|
popoverLabel: {
|
|
169
171
|
en: 'Tabs hover effect'
|
|
170
172
|
},
|
|
@@ -178,6 +180,15 @@ const SettingUIV2 = [
|
|
|
178
180
|
state: 'hover'
|
|
179
181
|
}
|
|
180
182
|
},
|
|
183
|
+
{
|
|
184
|
+
label: {
|
|
185
|
+
en: 'Background'
|
|
186
|
+
},
|
|
187
|
+
setting: {
|
|
188
|
+
id: 'labelBgColor',
|
|
189
|
+
state: 'hover'
|
|
190
|
+
}
|
|
191
|
+
},
|
|
181
192
|
{
|
|
182
193
|
label: {
|
|
183
194
|
en: 'Border'
|
|
@@ -194,9 +205,11 @@ const SettingUIV2 = [
|
|
|
194
205
|
en: 'Active state'
|
|
195
206
|
},
|
|
196
207
|
type: 'combo',
|
|
208
|
+
setting: {
|
|
209
|
+
id: 'enableActiveEffect'
|
|
210
|
+
},
|
|
197
211
|
iconName: 'polaris-edit',
|
|
198
212
|
fixedValue: 'Enabled',
|
|
199
|
-
isHideClear: true,
|
|
200
213
|
popoverLabel: {
|
|
201
214
|
en: 'Tabs active state'
|
|
202
215
|
},
|
|
@@ -3,29 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
+
var system = require('@gem-sdk/system');
|
|
7
|
+
var getStyle = require('./common/getStyle.js');
|
|
8
|
+
var getClasses = require('./common/getClasses.js');
|
|
6
9
|
|
|
7
10
|
const TextInline = ({ styles, setting, className, elementAttrs, ...props })=>{
|
|
8
|
-
const appendTypoStyle = core.composeTypographyStyle(styles?.typo);
|
|
9
|
-
const appendTypoClass = core.composeTypographyClassName(styles?.typo);
|
|
10
11
|
const { text } = setting ?? {};
|
|
12
|
+
const getClassText = system.createClass({
|
|
13
|
+
...getClasses.composeClasses(core.cls(className, core.composeTypographyClassName(styles?.typo)))
|
|
14
|
+
});
|
|
11
15
|
const getStyleText = ()=>{
|
|
12
|
-
const objectStyle = {
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
overflow: 'hidden'
|
|
16
|
-
};
|
|
16
|
+
const objectStyle = system.createStyle({
|
|
17
|
+
...getStyle.getTextStyleInline(styles)
|
|
18
|
+
});
|
|
17
19
|
const styleInline = Object.entries(objectStyle).map(([key, value])=>`${key}:${value}`).join(';');
|
|
18
20
|
return styleInline;
|
|
19
21
|
};
|
|
20
22
|
return `
|
|
21
23
|
<span
|
|
22
|
-
${{
|
|
23
|
-
...elementAttrs
|
|
24
|
-
}}
|
|
25
24
|
${{
|
|
26
25
|
...props
|
|
27
26
|
}}
|
|
28
|
-
class="${
|
|
27
|
+
class="${getClassText}"
|
|
29
28
|
style="${getStyleText()}"
|
|
30
29
|
>
|
|
31
30
|
${text}
|
|
@@ -19,10 +19,7 @@ const getContainerClasses = ({ setting })=>{
|
|
|
19
19
|
const { excludeFlex } = setting ?? {};
|
|
20
20
|
let classList = '';
|
|
21
21
|
if (!excludeFlex) classList += ' gp-flex';
|
|
22
|
-
return classList
|
|
23
|
-
acc[item] = true;
|
|
24
|
-
return acc;
|
|
25
|
-
}, {});
|
|
22
|
+
return composeClasses(classList);
|
|
26
23
|
};
|
|
27
24
|
const getTextClasses = ({ styles, setting, className, mode })=>{
|
|
28
25
|
const { text, options } = setting ?? {};
|
|
@@ -53,7 +50,14 @@ const getTextClasses = ({ styles, setting, className, mode })=>{
|
|
|
53
50
|
...staticClasses
|
|
54
51
|
};
|
|
55
52
|
};
|
|
53
|
+
function composeClasses(classList) {
|
|
54
|
+
return classList.split(' ').reduce((acc, item)=>{
|
|
55
|
+
acc[item] = true;
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
}
|
|
56
59
|
|
|
60
|
+
exports.composeClasses = composeClasses;
|
|
57
61
|
exports.getClasses = getClasses;
|
|
58
62
|
exports.getContainerClasses = getContainerClasses;
|
|
59
63
|
exports.getTextClasses = getTextClasses;
|
|
@@ -63,7 +63,16 @@ const getTextStyle = (styles, setting)=>{
|
|
|
63
63
|
};
|
|
64
64
|
return filterTruthyStyles(composeStyles);
|
|
65
65
|
};
|
|
66
|
+
const getTextStyleInline = (styles)=>{
|
|
67
|
+
const composeStyles = {
|
|
68
|
+
...core.composeTypographyStyle(styles?.typo),
|
|
69
|
+
'word-break': 'break-word',
|
|
70
|
+
overflow: 'hidden'
|
|
71
|
+
};
|
|
72
|
+
return filterTruthyStyles(composeStyles);
|
|
73
|
+
};
|
|
66
74
|
|
|
67
75
|
exports.getContainerStyle = getContainerStyle;
|
|
68
76
|
exports.getStyle = getStyle;
|
|
69
77
|
exports.getTextStyle = getTextStyle;
|
|
78
|
+
exports.getTextStyleInline = getTextStyleInline;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '@gem-sdk/core';
|
|
2
2
|
import { getDynamicSourceLocales } from '../../../../helpers.js';
|
|
3
3
|
|
|
4
|
-
const getTag = (htmlTag)=>htmlTag === 'html' ? 'div' : 'p';
|
|
5
4
|
const getViewMoreText = ({ setting, builderProps, pageContext, type })=>{
|
|
6
5
|
if (type === 'liquid') {
|
|
7
6
|
return getDynamicSourceLocales({
|
|
@@ -29,4 +28,4 @@ const getViewLessText = ({ setting, builderProps, pageContext, type })=>{
|
|
|
29
28
|
return setting?.viewLessText;
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
export {
|
|
31
|
+
export { getViewLessText, getViewMoreText };
|